Module: Fluent::KinesisHelper::API::BatchRequest

Included in:
Fluent::KinesisFirehoseOutput, Fluent::KinesisStreamsAggregatedOutput, Fluent::KinesisStreamsOutput
Defined in:
lib/fluent/plugin/kinesis_helper/api.rb

Defined Under Namespace

Modules: BatchRequestParams Classes: Backoff

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(mod) ⇒ Object



48
49
50
# File 'lib/fluent/plugin/kinesis_helper/api.rb', line 48

def self.included(mod)
  mod.include BatchRequestParams
end

Instance Method Details

#configure(conf) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/fluent/plugin/kinesis_helper/api.rb', line 52

def configure(conf)
  super
  if @batch_request_max_count.nil?
    @batch_request_max_count = self.class::BatchRequestLimitCount
  elsif @batch_request_max_count > self.class::BatchRequestLimitCount
    raise ConfigError, "batch_request_max_count can't be grater than #{self.class::BatchRequestLimitCount}."
  end
  if @batch_request_max_size.nil?
    @batch_request_max_size = self.class::BatchRequestLimitSize
  elsif @batch_request_max_size > self.class::BatchRequestLimitSize
    raise ConfigError, "batch_request_max_size can't be grater than #{self.class::BatchRequestLimitSize}."
  end
end

#size_of_values(record) ⇒ Object



66
67
68
# File 'lib/fluent/plugin/kinesis_helper/api.rb', line 66

def size_of_values(record)
  record.compact.map(&:size).inject(:+) || 0
end