Class: Rdkafka::Admin::IncrementalAlterConfigsReport

Inherits:
Object
  • Object
show all
Defined in:
lib/rdkafka/admin/incremental_alter_configs_report.rb

Overview

Report for incremental alter configs operation result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_entries:, entry_count:) ⇒ IncrementalAlterConfigsReport

Returns a new instance of IncrementalAlterConfigsReport.

Parameters:

  • config_entries (FFI::Pointer)

    pointer to config entries array

  • entry_count (Integer)

    number of config entries



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rdkafka/admin/incremental_alter_configs_report.rb', line 11

def initialize(config_entries:, entry_count:)
  @resources = []

  return if config_entries == FFI::Pointer::NULL

  config_entries
    .read_array_of_pointer(entry_count)
    .each { |config_resource_result_ptr| validate!(config_resource_result_ptr) }
    .each do |config_resource_result_ptr|
      config_resource_result = ConfigResourceBindingResult.new(config_resource_result_ptr)

      pointer_to_size_t = FFI::MemoryPointer.new(:int32)
      configs_ptr = Bindings.rd_kafka_ConfigResource_configs(
        config_resource_result_ptr,
        pointer_to_size_t
      )

      configs_ptr
        .read_array_of_pointer(pointer_to_size_t.read_int)
        .map { |config_ptr| ConfigBindingResult.new(config_ptr) }
        .each { |config_binding| config_resource_result.configs << config_binding }

      @resources << config_resource_result
    end
ensure
  return if config_entries == FFI::Pointer::NULL

  Bindings.rd_kafka_ConfigResource_destroy_array(config_entries, entry_count)
end

Instance Attribute Details

#resourcesObject (readonly)

Returns the value of attribute resources.



7
8
9
# File 'lib/rdkafka/admin/incremental_alter_configs_report.rb', line 7

def resources
  @resources
end