Class: Heller::TopicMetadataResponse

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/heller/topic_metadata_response.rb

Instance Method Summary collapse

Constructor Details

#initialize(underlying) ⇒ TopicMetadataResponse

Returns a new instance of TopicMetadataResponse.



7
8
9
10
11
12
13
14
15
# File 'lib/heller/topic_metadata_response.rb', line 7

def initialize(underlying)
  @underlying = underlying

  @cache = Hash.new.tap do |h|
    CACHES.each do |type|
      h[type] = Hash.new({})
    end
  end
end

Instance Method Details

#each(&block) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/heller/topic_metadata_response.rb', line 17

def each(&block)
  .each do ||
    ..each do ||
      yield .topic, 
    end
  end
end

#isr_for(topic, partition) ⇒ Object Also known as: in_sync_replicas_for



33
34
35
# File 'lib/heller/topic_metadata_response.rb', line 33

def isr_for(topic, partition)
  with_cache(:isr, topic, partition)
end

#leader_for(topic, partition) ⇒ Object



29
30
31
# File 'lib/heller/topic_metadata_response.rb', line 29

def leader_for(topic, partition)
  with_cache(:leader, topic, partition)
end

#metadataObject



25
26
27
# File 'lib/heller/topic_metadata_response.rb', line 25

def 
  @underlying.
end