Class MasterComputeContext<CONFIG extends PregelConfig>

    • Field Summary

    • Constructor Summary

      Constructors 
      Constructor Description
      MasterComputeContext​(CONFIG config, 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.
      double doubleNodeValue​(long nodeId, java.lang.String key)
      Returns the node value for the given node schema key.
      java.util.concurrent.ExecutorService executorService()
      Returns an executor service that can be used for parallel master computations.
      void forEachNode​(java.util.function.LongPredicate consumer)
      Accepts a consumer function that is called for every node in the graph.
      boolean isInitialSuperstep()
      Indicates if the current superstep is the first superstep.
      boolean isMultiGraph()
      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.
      long longNodeValue​(long nodeId, java.lang.String key)
      Returns the node value for the given node schema key.
      long nodeCount()
      Number of nodes in the input graph.
      long relationshipCount()
      Number of relationships in the input graph.
      void setNodeValue​(long nodeId, java.lang.String key, double value)
      Sets a node double value for given the node schema key.
      void setNodeValue​(long nodeId, java.lang.String key, double[] value)
      Sets a node long value for given the node schema key.
      void setNodeValue​(long nodeId, java.lang.String key, long value)
      Sets a node long value for given the node schema key.
      void setNodeValue​(long nodeId, java.lang.String key, long[] value)
      Sets a node long value for given the node schema key.
      int superstep()
      Returns the current superstep (0-based).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MasterComputeContext

        public MasterComputeContext​(CONFIG config,
                                    Graph graph,
                                    int iteration,
                                    NodeValue nodeValue,
                                    java.util.concurrent.ExecutorService executorService)
    • Method Detail

      • 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 key
        value - 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 key
        value - 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 key
        value - 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 key
        value - property value