public interface IIndexTable
IInputKey
-specific slice of an instance store to realize a
IQueryRuntimeContext
. Implemented by a customizable data store that is responsible for:
IInputKey
,Can be specialized for unary / binary / etc., opposite edges or node subtypes, specific types, distributed storage, etc.
Writeable API is specific to the customized implementations (e.g. unary).
Precondition: the associated input key is enumerable, see IQueryMetaContext.isEnumerable(IInputKey)
.
EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same.
AbstractIndexTable
instead.Modifier and Type | Method and Description |
---|---|
void |
addUpdateListener(Tuple seed,
IQueryRuntimeContextListener listener)
Subscribes for updates in the table, optionally seeded with the given tuple.
|
boolean |
containsTuple(ITuple seed)
Simpler form of
enumerateTuples(TupleMask, ITuple) in the case where all values of the tuples are bound
by the seed. |
int |
countTuples(TupleMask seedMask,
ITuple seed)
Returns the number of tuples, optionally seeded with the given tuple.
|
default java.lang.Iterable<Tuple> |
enumerateTuples(TupleMask seedMask,
ITuple seed)
Returns the tuples, optionally seeded with the given tuple.
|
default java.lang.Iterable<? extends java.lang.Object> |
enumerateValues(TupleMask seedMask,
ITuple seed)
Simpler form of
enumerateTuples(TupleMask, ITuple) in the case where all values of the tuples are bound
by the seed except for one. |
java.util.Optional<java.lang.Long> |
estimateProjectionSize(TupleMask groupMask,
Accuracy requiredAccuracy)
Gives an estimate of the number of different groups the tuples of the table are projected into by the given mask
(e.g.
|
IInputKey |
getInputKey() |
void |
removeUpdateListener(Tuple seed,
IQueryRuntimeContextListener listener)
Unsubscribes from updates in the table, optionally seeded with the given tuple.
|
java.util.stream.Stream<? extends Tuple> |
streamTuples(TupleMask seedMask,
ITuple seed)
Returns the tuples, optionally seeded with the given tuple.
|
java.util.stream.Stream<? extends java.lang.Object> |
streamValues(TupleMask seedMask,
ITuple seed)
Simpler form of
enumerateTuples(TupleMask, ITuple) in the case where all values of the tuples are bound
by the seed except for one. |
IInputKey getInputKey()
default java.lang.Iterable<Tuple> enumerateTuples(TupleMask seedMask, ITuple seed)
Consider using the more idiomatic streamTuples(TupleMask, ITuple)
instead.
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.java.util.stream.Stream<? extends Tuple> streamTuples(TupleMask seedMask, ITuple seed)
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.default java.lang.Iterable<? extends java.lang.Object> enumerateValues(TupleMask seedMask, ITuple seed)
enumerateTuples(TupleMask, ITuple)
in the case where all values of the tuples are bound
by the seed except for one.
Selects the tuples in the table, optionally seeded with the given tuple, and then returns the single value from each tuple which is not bound by the seed mask.
Consider using the more idiomatic streamValues(TupleMask, ITuple)
instead.
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask, and seedMask must include all parameters in any arbitrary order except one.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.java.util.stream.Stream<? extends java.lang.Object> streamValues(TupleMask seedMask, ITuple seed)
enumerateTuples(TupleMask, ITuple)
in the case where all values of the tuples are bound
by the seed except for one.
Selects the tuples in the table, optionally seeded with the given tuple, and then returns the single value from each tuple which is not bound by the seed mask.
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask, and seedMask must include all parameters in any arbitrary order except one.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.boolean containsTuple(ITuple seed)
enumerateTuples(TupleMask, ITuple)
in the case where all values of the tuples are bound
by the seed.
Returns whether the given tuple is in the table identified by the input key.
seed
- a row tuple of fixed values whose presence in the table is queriedint countTuples(TupleMask seedMask, ITuple seed)
Selects the tuples in the table, optionally seeded with the given tuple, and then returns their number.
seedMask
- a mask that extracts those parameters of the input key (from the entire parameter list) that should be
bound to a fixed value; must not be null. Note: any given index must occur at most
once in seedMask.seed
- the tuple of fixed values restricting the row set to be considered, in the same order as given in
parameterSeedMask, so that for each considered row tuple,
projectedParameterSeed.equals(parameterSeedMask.transform(row)) should hold. Must not be null.java.util.Optional<java.lang.Long> estimateProjectionSize(TupleMask groupMask, Accuracy requiredAccuracy)
Derived tables may return Optional.empty()
if it would be costly to provide an answer up to the required precision.
Direct storage tables are expected to always be able to give an exact count.
PRE: TupleMask.isNonrepeating()
must hold for the group mask.
void addUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)
This should be called after initializing a result cache by an enumeration method.
seed
- can be null or a tuple with matching arity;
if non-null, notifications will delivered only about those updates of the table
that match the seed at positions where the seed is non-null.listener
- will be notified of future changesvoid removeUpdateListener(Tuple seed, IQueryRuntimeContextListener listener)
seed
- can be null or a tuple with matching arity;
see addUpdateListener(Tuple, IQueryRuntimeContextListener)
for definition.listener
- will no longer be notified of future changes