public final class EmptyTraversalSideEffects extends Object implements TraversalSideEffects
TraversalSideEffects.ExceptionsSIDE_EFFECTS| Modifier and Type | Method and Description |
|---|---|
TraversalSideEffects |
clone()
Cloning is used to duplicate the sideEffects typically in OLAP environments.
|
<V> Optional<V> |
get(String key)
Get the sideEffect associated with the provided key.
|
<V> Optional<Supplier<V>> |
getRegisteredSupplier(String key)
Get the registered
Supplier associated with the specified key. |
<S> Supplier<S> |
getSackInitialValue()
If sacks are enabled, get the initial value of the
Traverser sack. |
<S> BinaryOperator<S> |
getSackMerger()
If sacks are enabled and a merge function has been specified, then get it (else get
null). |
<S> UnaryOperator<S> |
getSackSplitter()
If sacks are enabled and a split operator has been specified, then get it (else get
null). |
static EmptyTraversalSideEffects |
instance() |
Set<String> |
keys()
The keys of the sideEffect which includes registered
Supplier keys. |
void |
mergeInto(TraversalSideEffects sideEffects)
Add the current
TraversalSideEffects data and suppliers to the provided TraversalSideEffects. |
void |
registerSupplier(String key,
Supplier supplier)
Register a
Supplier with the provided key. |
void |
remove(String key)
Remove both the value and registered
Supplier associated with provided key. |
void |
set(String key,
Object value)
Set the specified key to the specified value.
|
void |
setLocalVertex(Vertex vertex)
In a distributed
GraphComputer traversal, the sideEffects of the traversal are not a single object within a single JVM. |
<S> void |
setSack(Supplier<S> initialValue,
UnaryOperator<S> splitOperator,
BinaryOperator<S> mergeOperator)
Set the initial value of each
Traverser "sack" along with the operators for splitting and merging sacks. |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, getOrCreate, registerSupplierIfAbsentpublic void set(String key, Object value)
TraversalSideEffectsSupplier is provided, it is NOT assumed to be a supplier as set by registerSupplier().set in interface TraversalSideEffectskey - the keyvalue - the valuepublic <V> Optional<V> get(String key) throws IllegalArgumentException
TraversalSideEffectsOptional.
Else if the sideEffect has a registered Supplier for that key, generate the object, store the object in the sideEffects, and return it.get in interface TraversalSideEffectsV - the type of the value to retrievekey - the key to get the value forIllegalArgumentException - if the key does not reference an object or a registered supplier.public void remove(String key)
TraversalSideEffectsSupplier associated with provided key.remove in interface TraversalSideEffectskey - the key of the value and registered supplier to removepublic Set<String> keys()
TraversalSideEffectsSupplier keys.
In essence, that which is possible to get().keys in interface TraversalSideEffectspublic void registerSupplier(String key, Supplier supplier)
TraversalSideEffectsSupplier with the provided key.
When sideEffects get() are called, if no object exists and there exists a registered supplier for the key, the object is generated.
Registered suppliers are used for the lazy generation of sideEffect data.registerSupplier in interface TraversalSideEffectskey - the key to register the supplier withsupplier - the supplier that will generate an object when get() is called if it hasn't already been createdpublic <V> Optional<Supplier<V>> getRegisteredSupplier(String key)
TraversalSideEffectsSupplier associated with the specified key.getRegisteredSupplier in interface TraversalSideEffectsV - The object type of the supplierkey - the key associated with the supplierpublic <S> void setSack(Supplier<S> initialValue, UnaryOperator<S> splitOperator, BinaryOperator<S> mergeOperator)
TraversalSideEffectsTraverser "sack" along with the operators for splitting and merging sacks.
If no split operator is provided, then a direct memory copy is assumed (this is typically good for primitive types and strings).
If no merge operator is provided, then traversers with sacks will not be merged.setSack in interface TraversalSideEffectsS - the sack typeinitialValue - the initial value supplier of the traverser sacksplitOperator - the split operator for splitting traverser sacksmergeOperator - the merge operator for merging traverser sackspublic <S> Supplier<S> getSackInitialValue()
TraversalSideEffectsTraverser sack.
If its not enabled, then null is returned.getSackInitialValue in interface TraversalSideEffectsS - the sack typepublic <S> UnaryOperator<S> getSackSplitter()
TraversalSideEffectsnull).
The split operator is used to split a sack when a bifurcation in a Traverser happens.getSackSplitter in interface TraversalSideEffectsS - the sack typepublic <S> BinaryOperator<S> getSackMerger()
TraversalSideEffectsnull).
The merge function is used to merge two sacks when two Traversers converge.getSackMerger in interface TraversalSideEffectsS - the sack typepublic void setLocalVertex(Vertex vertex)
TraversalSideEffectsGraphComputer traversal, the sideEffects of the traversal are not a single object within a single JVM.
Instead, the sideEffects are distributed across the graph and the pieces are stored on the computing vertices.
This method is necessary to call when the Traversal is processing the Traversers at a particular Vertex.setLocalVertex in interface TraversalSideEffectsvertex - the vertex where the traversal is currently executing.public TraversalSideEffects clone()
TraversalSideEffectsclone in interface TraversalSideEffectsclone in class Objectpublic void mergeInto(TraversalSideEffects sideEffects)
TraversalSideEffectsTraversalSideEffects data and suppliers to the provided TraversalSideEffects.mergeInto in interface TraversalSideEffectssideEffects - the sideEffects to add this traversal's sideEffect data to.public static EmptyTraversalSideEffects instance()
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.