class Mondrian::OLAP::CacheControl

Public Class Methods

new(connection, cube) click to toggle source
# File lib/mondrian/olap/cube.rb, line 465
def initialize(connection, cube)
  @connection = connection
  @cube = cube
  @mondrian_cube = @cube.raw_cube.unwrap(Java::MondrianOlap::Cube.java_class)
  @cache_control = @connection.raw_cache_control
end

Public Instance Methods

flush_region_cache_with_full_names(*full_names) click to toggle source
# File lib/mondrian/olap/cube.rb, line 477
def flush_region_cache_with_full_names(*full_names)
  members = full_names.map { |name| @cube.member(*name).mondrian_member }
  flush(members)
end
flush_region_cache_with_segments(*segment_names) click to toggle source
# File lib/mondrian/olap/cube.rb, line 472
def flush_region_cache_with_segments(*segment_names)
  members = segment_names.map { |name| @cube.member_by_segments(*name).mondrian_member }
  flush(members)
end

Private Instance Methods

flush(members) click to toggle source
# File lib/mondrian/olap/cube.rb, line 484
def flush(members)
  regions = members.map do |member|
    @cache_control.create_member_region(member, true)
  end
  regions << @cache_control.create_measures_region(@mondrian_cube)
  @cache_control.flush(@cache_control.create_crossjoin_region(*regions))
end