Class: Aws::KCLrb::RecordProcessorBase Abstract
- Inherits:
-
Object
- Object
- Aws::KCLrb::RecordProcessorBase
- Defined in:
- lib/aws/kclrb/record_processor.rb
Overview
Base class for implementing a record processor.
A RecordProcessor
processes a shard in a stream. See the corresponding KCL interface.
Its methods will be called as follows:
- #init_processor will be called once
- #process_records will be called zero or more times
- #shutdown will be called if this MultiLangDaemon instance loses the lease to this shard
Instance Method Summary collapse
-
#init_processor(shard_id) ⇒ Object
abstract
Called once by a KCLProcess before any calls to process_records.
-
#process_records(records, checkpointer) ⇒ Object
abstract
Called by a KCLProcess with a list of records to be processed and a checkpointer which accepts sequence numbers from the records to indicate where in the stream to checkpoint.
-
#shutdown(checkpointer, reason) ⇒ Object
abstract
Called by a KCLProcess instance to indicate that this record processor should shutdown.
-
#shutdown_requested(checkpointer) ⇒ Object
abstract
Called by a KCLProcess instance to indicate that this record processor is requesting a shutdown.
- #version ⇒ Object
Instance Method Details
#init_processor(shard_id) ⇒ Object
Called once by a KCLProcess before any calls to process_records.
22 23 24 |
# File 'lib/aws/kclrb/record_processor.rb', line 22 def init_processor(shard_id) fail NotImplementedError.new end |
#process_records(records, checkpointer) ⇒ Object
Called by a KCLProcess with a list of records to be processed and a checkpointer which accepts sequence numbers from the records to indicate where in the stream to checkpoint.
42 43 44 |
# File 'lib/aws/kclrb/record_processor.rb', line 42 def process_records(records, checkpointer) fail NotImplementedError.new end |
#shutdown(checkpointer, reason) ⇒ Object
Called by a KCLProcess instance to indicate that this record processor should shutdown. After this is called, there will be no more calls to any other methods of this record processor.
62 63 64 |
# File 'lib/aws/kclrb/record_processor.rb', line 62 def shutdown(checkpointer, reason) fail NotImplementedError.new end |
#shutdown_requested(checkpointer) ⇒ Object
Called by a KCLProcess instance to indicate that this record processor is requesting a shutdown. This method should be overriden if required.
72 73 |
# File 'lib/aws/kclrb/record_processor.rb', line 72 def shutdown_requested(checkpointer) end |
#version ⇒ Object
75 76 77 |
# File 'lib/aws/kclrb/record_processor.rb', line 75 def version 1 end |