Class: Aws::KCLrb::V2::RecordProcessorBase Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/aws/kclrb/record_processor.rb

Overview

This class is abstract.

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:

  1. #init_processor will be called once
  2. #process_records will be called zero or more times
  3. #lease_lost will be called zero to one time
  4. #shard_ended will be called zero or more times
  5. #shutdown_requested will be called zero to one time

Direct Known Subclasses

V2ToV1Adapter

Instance Method Summary collapse

Instance Method Details

#init_processor(initialize_input) ⇒ Object

This method is abstract.

Called once by a KCLProcess before any calls to process_records.

Parameters:



98
99
100
# File 'lib/aws/kclrb/record_processor.rb', line 98

def init_processor(initialize_input)
  fail NotImplementedError.new
end

#lease_lost(lease_lost_input) ⇒ Object

This method is abstract.

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.

Parameters:

  • lease_lost_input (LeaseLostInput)

    Lease lost input object

    • Clients should not checkpoint because there is possibly another record processor which has acquired the lease for this shard.


122
123
124
# File 'lib/aws/kclrb/record_processor.rb', line 122

def lease_lost(lease_lost_input)
  fail NotImplementedError.new
end

#process_records(process_records_input) ⇒ Object

This method is 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.

Parameters:

  • record_processor_input (RecordProcessorInput)

    Process records input object



109
110
111
# File 'lib/aws/kclrb/record_processor.rb', line 109

def process_records(process_records_input)
  fail NotImplementedError.new
end

#shard_ended(shard_ended_input) ⇒ Object

This method is abstract.

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.

Parameters:

  • shard_ended_input (ShardEndedInput)

    Shard ended input object

    • Clients need to checkpoint at this time.


134
135
136
# File 'lib/aws/kclrb/record_processor.rb', line 134

def shard_ended(shard_ended_input)
  fail NotImplementedError.new
end

#shutdown_requested(shutdown_requested_input) ⇒ Object

This method is abstract.

Called by a KCLProcess instance to indicate that this record processor is requesting a shutdown. This method should be overriden if required.

Parameters:



143
144
# File 'lib/aws/kclrb/record_processor.rb', line 143

def shutdown_requested(shutdown_requested_input)
end

#versionObject



146
147
148
# File 'lib/aws/kclrb/record_processor.rb', line 146

def version
  2
end