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.
Instance Method Details
#init_processor(shard_id) ⇒ Object
Called once by a KCLProcess before any calls to process_records.
32 33 34 |
# File 'lib/aws/kclrb/record_processor.rb', line 32 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.
52 53 54 |
# File 'lib/aws/kclrb/record_processor.rb', line 52 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.
72 73 74 |
# File 'lib/aws/kclrb/record_processor.rb', line 72 def shutdown(checkpointer, reason) fail NotImplementedError.new end |