T - the return type of the projection. It is equal to the journal event type
if the projection is null or it is the identity projectionJ - journal event typepublic abstract class EventJournalReadOperation<T,J> extends Operation implements IdentifiedDataSerializable, PartitionAwareOperation, BlockingOperation
null in which case all elements are returned
and no projection is applied.| Modifier and Type | Field and Description |
|---|---|
protected int |
maxSize |
protected int |
minSize |
protected String |
name |
protected DistributedObjectNamespace |
namespace |
protected ReadResultSetImpl<J,T> |
resultSet |
protected long |
sequence |
protected long |
startSequence |
GENERIC_PARTITION_ID| Constructor and Description |
|---|
EventJournalReadOperation() |
EventJournalReadOperation(String name,
long startSequence,
int minSize,
int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeRun()
Checks the precondition that the start sequence is already
available (in the event journal) or is the sequence of the
next event to be added into the journal.
|
protected abstract ReadResultSetImpl<J,T> |
createResultSet() |
protected abstract EventJournal<J> |
getJournal() |
Object |
getResponse() |
abstract String |
getServiceName() |
WaitNotifyKey |
getWaitKey() |
void |
logError(Throwable e)
Logs Exception/Error thrown during operation execution.
|
void |
onWaitExpire() |
protected void |
readInternal(ObjectDataInput in) |
void |
run() |
boolean |
shouldWait()
On every invocation this method reads from the event journal until
it has collected the minimum required number of response items.
|
protected void |
writeInternal(ObjectDataOutput out) |
afterRun, executedLocally, getCallerAddress, getCallerUuid, getCallId, getCallTimeout, getConnection, getInvocationTime, getLogger, getNodeEngine, getOperationResponseHandler, getPartitionId, getReplicaIndex, getService, getWaitTimeout, isUrgent, onExecutionFailure, onInvocationException, onSetCallId, readData, returnsResponse, sendResponse, setCallerUuid, setNodeEngine, setOperationResponseHandler, setPartitionId, setReplicaIndex, setService, setServiceName, setValidateTarget, setWaitTimeout, toString, toString, validatesTarget, writeDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFactoryId, getIdreadData, writeDatagetPartitionIdgetWaitTimeoutprotected String name
protected int minSize
protected int maxSize
protected long startSequence
protected transient ReadResultSetImpl<J,T> resultSet
protected transient long sequence
protected transient DistributedObjectNamespace namespace
public EventJournalReadOperation()
public EventJournalReadOperation(String name, long startSequence, int minSize, int maxSize)
public void beforeRun()
public boolean shouldWait()
true if there are currently not enough
elements in the response and the operation should be parked.shouldWait in interface BlockingOperationpublic Object getResponse()
getResponse in class Operationpublic WaitNotifyKey getWaitKey()
getWaitKey in interface BlockingOperationpublic void onWaitExpire()
onWaitExpire in interface BlockingOperationprotected void writeInternal(ObjectDataOutput out) throws IOException
writeInternal in class OperationIOExceptionprotected void readInternal(ObjectDataInput in) throws IOException
readInternal in class OperationIOExceptionpublic void logError(Throwable e)
Operationpublic abstract String getServiceName()
getServiceName in class Operationprotected abstract ReadResultSetImpl<J,T> createResultSet()
protected abstract EventJournal<J> getJournal()
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.