Class: LogStashLogger::Device::Kinesis

Inherits:
AwsStream show all
Defined in:
lib/logstash-logger/device/kinesis.rb

Constant Summary

Constants inherited from AwsStream

AwsStream::DEFAULT_REGION, AwsStream::DEFAULT_STREAM

Instance Attribute Summary

Attributes inherited from AwsStream

#aws_region, #stream

Attributes inherited from Connectable

#buffer_logger

Attributes inherited from Base

#error_logger, #io, #sync

Instance Method Summary collapse

Methods inherited from AwsStream

#close!, #connect, #initialize, #with_connection, #write_batch, #write_one

Methods inherited from Connectable

#close, #connect, #connected?, #flush, #initialize, #on_full_buffer_receive, #reconnect, #to_io, #with_connection, #write, #write_batch, #write_one

Methods included from Buffer

#buffer_flush, #buffer_full?, #buffer_initialize, #buffer_receive, #reset_buffer

Methods inherited from Base

#close, #close!, #flush, #initialize, #to_io, #unrecoverable_error?, #write, #write_batch, #write_one

Constructor Details

This class inherits a constructor from LogStashLogger::Device::AwsStream

Instance Method Details

#get_response_records(resp) ⇒ Object



33
34
35
# File 'lib/logstash-logger/device/kinesis.rb', line 33

def get_response_records(resp)
  resp.records
end

#is_successful_response(resp) ⇒ Object



29
30
31
# File 'lib/logstash-logger/device/kinesis.rb', line 29

def is_successful_response(resp)
  resp.failed_record_count == 0
end

#put_records(records) ⇒ Object



22
23
24
25
26
27
# File 'lib/logstash-logger/device/kinesis.rb', line 22

def put_records(records)
  @io.put_records({
    records: records,
    stream_name: @stream
  })
end

#transform_message(message) ⇒ Object



15
16
17
18
19
20
# File 'lib/logstash-logger/device/kinesis.rb', line 15

def transform_message(message)
  {
    data: message,
    partition_key: SecureRandom.uuid
  }
end