public final class SparkMemory extends Object implements Memory.Admin, Serializable
Memory.Admin, Memory.Exceptions| Modifier and Type | Field and Description |
|---|---|
Map<String,MemoryComputeKey> |
memoryComputeKeys |
| Constructor and Description |
|---|
SparkMemory(VertexProgram<?> vertexProgram,
Set<MapReduce> mapReducers,
JavaSparkContext sparkContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String key,
Object value)
Set the value of the provided key.
|
protected void |
broadcastMemory(JavaSparkContext sparkContext) |
protected void |
complete() |
<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 |
incrIteration() |
Set<String> |
keys()
The set of keys currently associated with this memory.
|
void |
set(String key,
Object value) |
protected void |
setInExecute(boolean inExecute) |
void |
setIteration(int iteration) |
void |
setRuntime(long runTime) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasImmutableasMap, exists, isInitialIterationpublic final Map<String,MemoryComputeKey> memoryComputeKeys
public SparkMemory(VertexProgram<?> vertexProgram, Set<MapReduce> mapReducers, JavaSparkContext sparkContext)
public Set<String> keys()
Memorypublic void incrIteration()
incrIteration in interface Memory.Adminpublic void setIteration(int iteration)
setIteration in interface Memory.Adminpublic int getIteration()
MemorygetIteration in interface Memorypublic void setRuntime(long runTime)
setRuntime in interface Memory.Adminpublic long getRuntime()
MemoryGraphComputer has been executing thus far.getRuntime in interface Memorypublic <R> R get(String key) throws IllegalArgumentException
Memoryget in interface MemoryR - the type of the valuekey - the key of the valueIllegalArgumentException - is thrown if the key does not existpublic void add(String key, Object value)
MemoryVertexProgram.
If this is called during execute(), there is no guarantee as to the ultimately stored value as call order is indeterminate.protected void complete()
protected void setInExecute(boolean inExecute)
protected void broadcastMemory(JavaSparkContext sparkContext)
Copyright © 2013–2016 Apache Software Foundation. All rights reserved.