Show TOC

Batch ProcessingLocate this document in the navigation structure

Details about how to control the manner in which AdapterRow instances are sent and processed by Event Stream Processor.

Sending individual AdapterRow instances to Event Stream Processor results in minimal latency, but can reduce overall throughput due to network overhead. Sending AdapterRow instances using batch processing or blocks can improve overall throughput with some reduction in latency. See Batch Processing in the SAP Event Stream Processor: Developer Guide.

When not part of a block, AdapterRow instances are published individually over the network to ESP when the sendRow() or sendRowData() method is invoked.

You can demarcate a block explicitly within the source code, or implicitly using the adapter configuration file. A block is demarcated explicitly when either a BATCH_START flag (sends the block using envelopes) or a TRANS_START flag (sends the block using transactions) is set in the current or preceding AdapterRow instances. The end of a block is demarcated by an AdapterRow instance with a BLOCK_END flag, or when an AdapterRow is sent to ESP with the sendEnd() method instead of sendRow() or sendRowData().

If the AdapterRow instance is not explicitly part of a block, and the optional EspPublisher module property MaxPubPoolSize is set to a value greater than 1, the adapter framework automatically uses blocks to transmit the records. The MaxPubPoolSize parameter specifies the maximum size of the record pool before all records in the pool are published.

If the optional EspPublisher module property MaxPubPoolTime is configured, this also causes publishing of the record pool in blocks. MaxPubPoolTime specifies the maximum period of time, in milliseconds, for which records are pooled before being published.

If the threshold value of either MaxPubPoolSize or MaxPubPoolTime is reached, the record pool is published using blocks. A third optional configuration property, UseTransactions, controls whether the blocks are published using envelopes or transactions.

If event blocks are neither demarcated explicitly in the adapter code, nor implicitly used based on the adapter configuration, records are published individually.

A typical transaction block using AdapterRow might look like this:
  1. An AdapterRow with a block flag that is set to TRANS_START
  2. Various AdapterRows with block flags that are set to BLOCK_DATA
  3. An AdapterRow with a block flag set to BLOCK_END

For AdapterRow instances with no data and only the start or end flag, set each data position in the instance to null. See the $STREAMING_HOME/adapters/framework/examples/src/com/sybase/esp/adapter/framework/examplemodules/ExampleRowInputTransporter.java example for publishing AdapterRow instances in various ways.

An AdapterRow instance cannot contain records from multiple transactions. If using blocks, records from an AdapterRow instance are published in one transaction or envelope.