public final class TinkerMemory extends Object implements Memory.Admin
Memory.Admin, Memory.Exceptions
Modifier and Type | Field and Description |
---|---|
Map<String,Object> |
currentMap |
Set<String> |
memoryKeys |
Map<String,Object> |
previousMap |
Constructor and Description |
---|
TinkerMemory(VertexProgram<?> vertexProgram,
Set<MapReduce> mapReducers) |
Modifier and Type | Method and Description |
---|---|
void |
and(String key,
boolean bool)
Logically AND the provided boolean value with the boolean value currently stored at the key.
|
protected void |
complete() |
protected void |
completeSubRound() |
<R> R |
get(String key)
Get the value associated with the provided key.
|
int |
getIteration()
Get the current iteration number.
|
long |
getRuntime()
Get the amount of milliseconds the
GraphComputer has been executing thus far. |
void |
incr(String key,
long delta)
Add the provided delta value to the long value currently stored at the key.
|
void |
incrIteration() |
boolean |
isInitialIteration()
A helper method that states whether the current iteration is 0.
|
Set<String> |
keys()
The set of keys currently associated with this memory.
|
void |
or(String key,
boolean bool)
Logically OR the provided boolean value with the boolean value currently stored at the key.
|
void |
set(String key,
Object value)
Set the value of the provided key.
|
void |
setIteration(int iteration) |
void |
setRuntime(long runTime) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asImmutable
public TinkerMemory(VertexProgram<?> vertexProgram, Set<MapReduce> mapReducers)
public Set<String> keys()
Memory
public void incrIteration()
incrIteration
in interface Memory.Admin
public void setIteration(int iteration)
setIteration
in interface Memory.Admin
public int getIteration()
Memory
getIteration
in interface Memory
public void setRuntime(long runTime)
setRuntime
in interface Memory.Admin
public long getRuntime()
Memory
GraphComputer
has been executing thus far.getRuntime
in interface Memory
protected void complete()
protected void completeSubRound()
public boolean isInitialIteration()
Memory
isInitialIteration
in interface Memory
public <R> R get(String key) throws IllegalArgumentException
Memory
get
in interface Memory
R
- the type of the valuekey
- the key of the valueIllegalArgumentException
- is thrown if the key does not existpublic void incr(String key, long delta)
Memory
public void and(String key, boolean bool)
Memory
public void or(String key, boolean bool)
Memory
public void set(String key, Object value)
Memory
VertexProgram
.
If this is called during execute(), there is no guarantee as to the ultimately stored value as call order is indeterminate.Copyright © 2013–2015 Apache Software Foundation. All rights reserved.