Class TinkerMemory
java.lang.Object
org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerMemory
- All Implemented Interfaces:
Memory,Memory.Admin
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.computer.Memory
Memory.Admin, Memory.Exceptions -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSet the value of the provided key.protected voidcheckKeyValue(String key, Object value) protected voidcomplete()protected void<R> RGet the value associated with the provided key.intGet the current iteration number.longGet the amount of milliseconds theGraphComputerhas been executing thus far.voidbooleanA helper method that states whether the current iteration is 0.keys()The set of keys currently associated with this memory.voidvoidsetIteration(int iteration) voidsetRuntime(long runTime) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tinkerpop.gremlin.process.computer.Memory.Admin
asImmutable
-
Field Details
-
memoryKeys
-
previousMap
-
currentMap
-
-
Constructor Details
-
TinkerMemory
-
-
Method Details
-
keys
Description copied from interface:MemoryThe set of keys currently associated with this memory. -
incrIteration
public void incrIteration()- Specified by:
incrIterationin interfaceMemory.Admin
-
setIteration
public void setIteration(int iteration) - Specified by:
setIterationin interfaceMemory.Admin
-
getIteration
public int getIteration()Description copied from interface:MemoryGet the current iteration number.- Specified by:
getIterationin interfaceMemory- Returns:
- the current iteration
-
setRuntime
public void setRuntime(long runTime) - Specified by:
setRuntimein interfaceMemory.Admin
-
getRuntime
public long getRuntime()Description copied from interface:MemoryGet the amount of milliseconds theGraphComputerhas been executing thus far.- Specified by:
getRuntimein interfaceMemory- Returns:
- the total time in milliseconds
-
complete
protected void complete() -
completeSubRound
protected void completeSubRound() -
isInitialIteration
public boolean isInitialIteration()Description copied from interface:MemoryA helper method that states whether the current iteration is 0.- Specified by:
isInitialIterationin interfaceMemory- Returns:
- whether this is the first iteration
-
get
Description copied from interface:MemoryGet the value associated with the provided key.- Specified by:
getin interfaceMemory- Type Parameters:
R- the type of the value- Parameters:
key- the key of the value- Returns:
- the value
- Throws:
IllegalArgumentException- is thrown if the key does not exist
-
set
-
add
Description copied from interface:MemorySet the value of the provided key. This is typically called in setup() and/or terminate() of theVertexProgram. If this is called during execute(), there is no guarantee as to the ultimately stored value as call order is indeterminate. It is up to the implementation to determine the states in which this method can be called. -
toString
-
checkKeyValue
-