Class EntryHolderAggregatorContext
java.lang.Object
com.gigaspaces.query.aggregators.SpaceEntriesAggregatorContext
com.gigaspaces.internal.query.EntryHolderAggregatorContext
- Since:
- 10.0
- Author:
- Niv Ingberg
-
Constructor Summary
ConstructorsConstructorDescriptionEntryHolderAggregatorContext(List<SpaceEntriesAggregator> aggregators, ITemplateHolder template, int partitionId) EntryHolderAggregatorContext(List<SpaceEntriesAggregator> aggregators, ITemplateHolder template, int partitionId, FieldSecurityEnforcer.PiiAccess piiAccess) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyProjectionTemplate(RawEntry entry) voidThrows once the aggregation has run past its execution timeout; seewithExecutionDeadline(SpaceEntriesAggregatorContext).int[]fixedPropertiesToRead(IServerTypeDesc typeDesc) The fixed properties of an entry of this type that the aggregators need read out of its block, ornullwhen this set of aggregators cannot be served without the entry itself.intprotected ObjectgetPathValueImpl(String path) The value behind one declared path.The entry itself, which in the in-place state does not exist: only the declared paths were read, and the view holding them is indexed by position, so a property asked for by name would come back asnullrather than as what the entry holds.The type being scanned, which a declaring aggregator may ask for andSpaceIteratorAggregatordoes ask for on this very route - so it cannot be left to the base implementation, which reads it offgetServerEntry().voidmaskPii(IEntryPacket packet) Field level security: omits the PII properties the user lacks read privilege for from an entry built by an aggregator directly (e.g.booleanWhether some aggregator wants this entry itself, asked once per entry.voidscan(Context context, IEntryData entryData, String uid, boolean isTransient) voidscanInPlace(ServerEntry values, IEntryPacket packet, String uid) AsscanInPlace(ServerEntry, String), for an entryneedsWholeEntry()answered yes to andtakesAProjectedPacket()let through: what the aggregator reaches for throughgetRawEntry()is then the packet built out of the block.voidscanInPlace(ServerEntry values, String uid) Aggregates one entry from values read out of the block it occupies, instead of from an entry built for the purpose.booleanWhether a yes fromneedsWholeEntry()may be answered with a packet narrowed to the template's projection instead of the entry.static EntryHolderAggregatorContextThe context of an aggregation that has an execution timeout, ornull.Methods inherited from class SpaceEntriesAggregatorContext
aggregate, getAggregators, getPathValue
-
Constructor Details
-
EntryHolderAggregatorContext
public EntryHolderAggregatorContext(List<SpaceEntriesAggregator> aggregators, ITemplateHolder template, int partitionId) -
EntryHolderAggregatorContext
public EntryHolderAggregatorContext(List<SpaceEntriesAggregator> aggregators, ITemplateHolder template, int partitionId, FieldSecurityEnforcer.PiiAccess piiAccess)
-
-
Method Details
-
withExecutionDeadline
public static EntryHolderAggregatorContext withExecutionDeadline(SpaceEntriesAggregatorContext context) The context of an aggregation that has an execution timeout, ornull. For an aggregator that walks an index itself instead of being handed entries by the scan: it then has to callcheckExecutionDeadline()as it goes, as the scan would between entries (PIC-6362). -
checkExecutionDeadline
public void checkExecutionDeadline()Throws once the aggregation has run past its execution timeout; seewithExecutionDeadline(SpaceEntriesAggregatorContext). -
scan
-
scanInPlace
Aggregates one entry from values read out of the block it occupies, instead of from an entry built for the purpose. Only legitimate afterfixedPropertiesToRead(IServerTypeDesc)has answered for this entry's type andneedsWholeEntry()has answered no, or has answered yes and been handed a packet through the overload below - which is also what makes the typeresolve(IServerTypeDesc)last saw this entry's own, asgetTypeDescriptor()relies on.- Parameters:
values- the values read under the entry's state lock, holding at least the positionsfixedPropertiesToRead(IServerTypeDesc)asked foruid- the entry's uid, which lives in its cache info rather than in its block
-
scanInPlace
AsscanInPlace(ServerEntry, String), for an entryneedsWholeEntry()answered yes to andtakesAProjectedPacket()let through: what the aggregator reaches for throughgetRawEntry()is then the packet built out of the block.- Parameters:
packet- the entry's packet, narrowed to the template's projection, ornull
-
fixedPropertiesToRead
The fixed properties of an entry of this type that the aggregators need read out of its block, ornullwhen this set of aggregators cannot be served without the entry itself.Resolving has to happen before the scan reaches the block, because the values are read eagerly under the entry's state lock and what to read has to be known by then. It is kept per type rather than per scan: one scan covers a type and its subtypes, and a property's position is the type descriptor's, not the engine's.
-
needsWholeEntry
public boolean needsWholeEntry()Whether some aggregator wants this entry itself, asked once per entry. Only an aggregator that can change its mind mid-scan is asked at all - seeMayNeedWholeEntryfor why that is not something the public aggregator API offers - so for every other set this is a walk over the list and nothing more. -
takesAProjectedPacket
public boolean takesAProjectedPacket()Whether a yes fromneedsWholeEntry()may be answered with a packet narrowed to the template's projection instead of the entry. Only when the aggregator asking is the whole set: any other aggregator beside it would be handed the same packet bygetRawEntry(), holes and all, where on the materialising path it would get the entry. -
getPartitionId
public int getPartitionId()- Specified by:
getPartitionIdin classSpaceEntriesAggregatorContext
-
getEntryUid
- Specified by:
getEntryUidin classSpaceEntriesAggregatorContext
-
getRawEntry
- Specified by:
getRawEntryin classSpaceEntriesAggregatorContext- Returns:
- the raw entry match by this context
- See Also:
-
maskPii
Field level security: omits the PII properties the user lacks read privilege for from an entry built by an aggregator directly (e.g. from an index scan) instead of viagetRawEntry(). -
applyProjectionTemplate
- Specified by:
applyProjectionTemplatein classSpaceEntriesAggregatorContext
-
getServerEntry
The entry itself, which in the in-place state does not exist: only the declared paths were read, and the view holding them is indexed by position, so a property asked for by name would come back asnullrather than as what the entry holds. Refused for the same reasongetRawEntry()is, and refused whatever the user may read - nothing leaves the block this way at all, which is why there is no masking here.- Specified by:
getServerEntryin classSpaceEntriesAggregatorContext
-
getTypeDescriptor
The type being scanned, which a declaring aggregator may ask for andSpaceIteratorAggregatordoes ask for on this very route - so it cannot be left to the base implementation, which reads it offgetServerEntry(). Answered from the descriptorresolve(IServerTypeDesc)last saw, which is this entry's own: the scan covers a type together with its subtypes, and the paths were resolved against the same descriptor the values were then read by.- Overrides:
getTypeDescriptorin classSpaceEntriesAggregatorContext
-
getPathValueImpl
The value behind one declared path. In the in-place state the paths were resolved to positions before the block was read, so this is a lookup rather than the type descriptor walk the entry data would do - and a path nobody declared cannot be answered at all, which is a bug in the declaration rather than a value that happens to be missing.Field level security is enforced on both states, in different places for the same reason the values are read in different places: the materialising state asks per path, as it always has, because the set of paths that will be asked for is not known in advance; the in-place state asked for all of them at once in
resolve(IServerTypeDesc), because knowing them in advance is what let the block be read at all.- Overrides:
getPathValueImplin classSpaceEntriesAggregatorContext
-