E - the type of Eventpublic abstract class AbstractListenEventBatchingProcessor<E extends Event> extends AbstractListenEventProcessor<E>
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractListenEventBatchingProcessor.FlowFileEventBatch
Wrapper to hold a FlowFile and the events that have been appended to it.
|
| Modifier and Type | Field and Description |
|---|---|
static PropertyDescriptor |
MAX_BATCH_SIZE |
static PropertyDescriptor |
MESSAGE_DELIMITER |
protected byte[] |
messageDemarcatorBytes |
charset, CHARSET, descriptors, dispatcher, errorEvents, events, MAX_CONNECTIONS, MAX_MESSAGE_QUEUE_SIZE, MAX_SOCKET_BUFFER_SIZE, POLL_TIMEOUT_MS, port, PORT, RECV_BUFFER_SIZE, REL_SUCCESS, relationships| Constructor and Description |
|---|
AbstractListenEventBatchingProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Map<String,String> |
getAttributes(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
Creates the attributes for the FlowFile of the given batch.
|
protected Map<String,AbstractListenEventBatchingProcessor.FlowFileEventBatch> |
getBatches(ProcessSession session,
int totalBatchSize,
byte[] messageDemarcatorBytes)
Batches together up to the batchSize events.
|
protected String |
getBatchKey(E event) |
protected abstract String |
getTransitUri(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
Creates the transit uri to be used when reporting a provenance receive event for the given batch.
|
protected void |
init(ProcessorInitializationContext context) |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
protected void |
postProcess(ProcessContext context,
ProcessSession session,
List<E> events)
Called at the end of onTrigger to allow sub-classes to take post processing action on the events
|
createBufferPool, createDispatcher, getAdditionalProperties, getAdditionalRelationships, getDispatcherPort, getErrorQueueSize, getLongPollTimeout, getMessage, getQueueSize, getRelationships, getSupportedPropertyDescriptors, onUnscheduledonTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTruecustomValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final PropertyDescriptor MAX_BATCH_SIZE
public static final PropertyDescriptor MESSAGE_DELIMITER
protected volatile byte[] messageDemarcatorBytes
public AbstractListenEventBatchingProcessor()
protected void init(ProcessorInitializationContext context)
init in class AbstractListenEventProcessor<E extends Event>@OnScheduled public void onScheduled(ProcessContext context) throws IOException
onScheduled in class AbstractListenEventProcessor<E extends Event>IOExceptionpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionprotected abstract Map<String,String> getAttributes(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
batch - the current batchprotected abstract String getTransitUri(AbstractListenEventBatchingProcessor.FlowFileEventBatch batch)
batch - the current batchprotected void postProcess(ProcessContext context, ProcessSession session, List<E> events)
context - the current contextsession - the current sessionevents - the list of all events processed by the current execution of onTriggerprotected Map<String,AbstractListenEventBatchingProcessor.FlowFileEventBatch> getBatches(ProcessSession session, int totalBatchSize, byte[] messageDemarcatorBytes)
session - the current sessiontotalBatchSize - the total number of events to processmessageDemarcatorBytes - the demarcator to put between messages when writing to a FlowFileCopyright © 2019 Apache NiFi Project. All rights reserved.