amazon_kclpy/v2/processor.py [7:40]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class RecordProcessorBase(object):
    """
    Base class for implementing a record processor.A RecordProcessor processes a shard in a stream.
    Its methods will be called with this pattern:

    - initialize 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
    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def initialize(self, initialize_input):
        """
        Called once by a KCLProcess before any calls to process_records

        :param amazon_kclpy.messages.InitializeInput initialize_input: Information about the
            initialization request for the record processor
        """
        raise NotImplementedError

    @abc.abstractmethod
    def process_records(self, process_records_input):
        """
        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.

        :param amazon_kclpy.messages.ProcessRecordsInput process_records_input: the records, and metadata about the
            records.

        """
        raise NotImplementedError

    @abc.abstractmethod
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



amazon_kclpy/v3/processor.py [8:40]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class RecordProcessorBase(object):
    """
    Base class for implementing a record processor. Each RecordProcessor processes a single shard in a stream.

    The record processor represents a lifecycle where it will be initialized, possibly process records, and
    finally be terminated.
    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def initialize(self, initialize_input):
        """
        Called once by a the KCL to allow the record processor to configure itself before starting to process records.

        :param amazon_kclpy.messages.InitializeInput initialize_input: Information about the
            initialization request for the record processor
        """
        raise NotImplementedError

    @abc.abstractmethod
    def process_records(self, process_records_input):
        """
        This is called whenever records are received.  The method will be provided the batch of records that were
        received.  A checkpointer is also supplied that allows the application to checkpoint its progress within the
        shard.

        :param amazon_kclpy.messages.ProcessRecordsInput process_records_input: the records, metadata about the
            records, and a checkpointer.

        """
        raise NotImplementedError

    @abc.abstractmethod
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



