Class MasterComputeContext<CONFIG extends PregelConfig>
- java.lang.Object
-
- org.neo4j.gds.beta.pregel.context.PregelContext<CONFIG>
-
- org.neo4j.gds.beta.pregel.context.MasterComputeContext<CONFIG>
-
public class MasterComputeContext<CONFIG extends PregelConfig> extends PregelContext<CONFIG>
-
-
Field Summary
-
Fields inherited from class org.neo4j.gds.beta.pregel.context.PregelContext
config
-
-
Constructor Summary
Constructors Constructor Description MasterComputeContext(CONFIG config, org.neo4j.gds.api.Graph graph, int iteration, NodeValue nodeValue, java.util.concurrent.ExecutorService executorService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]doubleArrayNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.doubledoubleNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.java.util.concurrent.ExecutorServiceexecutorService()Returns an executor service that can be used for parallel master computations.voidforEachNode(java.util.function.LongPredicate consumer)Accepts a consumer function that is called for every node in the graph.booleanisInitialSuperstep()Indicates if the current superstep is the first superstep.booleanisMultiGraph()Indicates whether the input graph is a multi-graph.long[]longArrayNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.longlongNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.longnodeCount()Number of nodes in the input graph.longrelationshipCount()Number of relationships in the input graph.voidsetNodeValue(long nodeId, java.lang.String key, double value)Sets a node double value for given the node schema key.voidsetNodeValue(long nodeId, java.lang.String key, double[] value)Sets a node long value for given the node schema key.voidsetNodeValue(long nodeId, java.lang.String key, long value)Sets a node long value for given the node schema key.voidsetNodeValue(long nodeId, java.lang.String key, long[] value)Sets a node long value for given the node schema key.intsuperstep()Returns the current superstep (0-based).-
Methods inherited from class org.neo4j.gds.beta.pregel.context.PregelContext
config
-
-
-
-
Method Detail
-
isMultiGraph
public boolean isMultiGraph()
Description copied from class:PregelContextIndicates whether the input graph is a multi-graph.- Specified by:
isMultiGraphin classPregelContext<CONFIG extends PregelConfig>
-
nodeCount
public long nodeCount()
Description copied from class:PregelContextNumber of nodes in the input graph.- Specified by:
nodeCountin classPregelContext<CONFIG extends PregelConfig>
-
relationshipCount
public long relationshipCount()
Description copied from class:PregelContextNumber of relationships in the input graph.- Specified by:
relationshipCountin classPregelContext<CONFIG extends PregelConfig>
-
superstep
public int superstep()
Returns the current superstep (0-based).
-
executorService
public java.util.concurrent.ExecutorService executorService()
Returns an executor service that can be used for parallel master computations.
-
isInitialSuperstep
public boolean isInitialSuperstep()
Indicates if the current superstep is the first superstep.
-
forEachNode
public void forEachNode(java.util.function.LongPredicate consumer)
Accepts a consumer function that is called for every node in the graph. The consumer receives one node id at the time. If the consumer returns true, the next node is passed in. Otherwise the iteration stops.- Parameters:
consumer-
-
doubleNodeValue
public double doubleNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.- Throws:
java.lang.IllegalArgumentException- if the key does not exist or the value is not a double
-
longNodeValue
public long longNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.- Throws:
java.lang.IllegalArgumentException- if the key does not exist or the value is not a long
-
longArrayNodeValue
public long[] longArrayNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.- Throws:
java.lang.IllegalArgumentException- if the key does not exist or the value is not a long array
-
doubleArrayNodeValue
public double[] doubleArrayNodeValue(long nodeId, java.lang.String key)Returns the node value for the given node schema key.- Throws:
java.lang.IllegalArgumentException- if the key does not exist or the value is not a double array
-
setNodeValue
public void setNodeValue(long nodeId, java.lang.String key, double value)Sets a node double value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
setNodeValue
public void setNodeValue(long nodeId, java.lang.String key, long value)Sets a node long value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
setNodeValue
public void setNodeValue(long nodeId, java.lang.String key, long[] value)Sets a node long value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
setNodeValue
public void setNodeValue(long nodeId, java.lang.String key, double[] value)Sets a node long value for given the node schema key.- Parameters:
key- node schema keyvalue- property value
-
-