Class AggregateOperationContext
java.lang.Object
com.gigaspaces.internal.server.space.BatchQueryOperationContext
com.gigaspaces.internal.server.space.AggregateOperationContext
Created by niv on 6/17/14.
-
Field Summary
Fields inherited from class BatchQueryOperationContext
_processedUids -
Constructor Summary
ConstructorsConstructorDescriptionAggregateOperationContext(ITemplatePacket template, int maxEntries, int minEntries, boolean skipProcessedUidsStore) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidThrows if the deadline has passed.static voidassertWithinExecutionTimeout(long startNanos, long timeout, String spaceName) The check ofassertWithinExecutionDeadline()for the work a partition does once its scan, and with it this context, is over: building the aggregators' results.voidCalled by a scan for every entry it visits whenBatchQueryOperationContext.hasExecutionDeadline(); throws once the operation has run past its execution timeout.voidbooleanbooleanWhether a scan has to callBatchQueryOperationContext.checkExecutionDeadline()for every entry it visits.booleanisInProcessedUids(String uid) protected booleanbooleanbooleanvoidHandles an exception that was thrown while executing the batch operationvoidsetExecutionDeadline(long startNanos, long timeout, boolean checkEveryEntry, String spaceName) Gives the aggregation an execution deadline.
-
Constructor Details
-
AggregateOperationContext
public AggregateOperationContext(ITemplatePacket template, int maxEntries, int minEntries, boolean skipProcessedUidsStore)
-
-
Method Details
-
setExecutionDeadline
public void setExecutionDeadline(long startNanos, long timeout, boolean checkEveryEntry, String spaceName) Gives the aggregation an execution deadline.- Parameters:
startNanos-System.nanoTime()when the operation started on this partitiontimeout- the execution timeout in milliseconds, greater than zerocheckEveryEntry- whether to read the clock after every entry - for custom aggregatorsspaceName- the partition, for the message
-
hasExecutionDeadline
public boolean hasExecutionDeadline()Description copied from class:BatchQueryOperationContextWhether a scan has to callBatchQueryOperationContext.checkExecutionDeadline()for every entry it visits. Only an aggregation with an execution timeout does; a scan asks once, so the other operations pay nothing per entry.- Overrides:
hasExecutionDeadlinein classBatchQueryOperationContext
-
checkExecutionDeadline
public void checkExecutionDeadline()Description copied from class:BatchQueryOperationContextCalled by a scan for every entry it visits whenBatchQueryOperationContext.hasExecutionDeadline(); throws once the operation has run past its execution timeout.- Overrides:
checkExecutionDeadlinein classBatchQueryOperationContext
-
assertWithinExecutionDeadline
public void assertWithinExecutionDeadline()Throws if the deadline has passed. UnlikecheckExecutionDeadline()it reads the clock every time, which is what the check after the scan needs: a partition that finished late fails like one that is still scanning, whatever the order of its entries. -
assertWithinExecutionTimeout
The check ofassertWithinExecutionDeadline()for the work a partition does once its scan, and with it this context, is over: building the aggregators' results.- Parameters:
timeout- the execution timeout in milliseconds; zero or less for no limit
-
onException
Description copied from class:BatchQueryOperationContextHandles an exception that was thrown while executing the batch operation- Specified by:
onExceptionin classBatchQueryOperationContext
-
needToProcessExecption
public boolean needToProcessExecption()- Overrides:
needToProcessExecptionin classBatchQueryOperationContext
-
needProcessEntriesForReturnedResult
public boolean needProcessEntriesForReturnedResult()- Overrides:
needProcessEntriesForReturnedResultin classBatchQueryOperationContext
-
createProcessedUidsIfNeeded
public void createProcessedUidsIfNeeded()- Overrides:
createProcessedUidsIfNeededin classBatchQueryOperationContext
-
isInProcessedUids
- Overrides:
isInProcessedUidsin classBatchQueryOperationContext
-
addToProcessedUidsIfNeeded
- Overrides:
addToProcessedUidsIfNeededin classBatchQueryOperationContext
-
keepResultsInBatchContext
protected boolean keepResultsInBatchContext()- Overrides:
keepResultsInBatchContextin classBatchQueryOperationContext
-
hasAnyEntries
public boolean hasAnyEntries()- Overrides:
hasAnyEntriesin classBatchQueryOperationContext
-