Class ImmutableClassesGiraphConfiguration<I extends org.apache.hadoop.io.WritableComparable,​V extends org.apache.hadoop.io.Writable,​E extends org.apache.hadoop.io.Writable>

  • Type Parameters:
    I - Vertex id
    V - Vertex data
    E - Edge data
    All Implemented Interfaces:
    Iterable<Map.Entry<String,​String>>, GiraphConstants, org.apache.hadoop.io.Writable

    public class ImmutableClassesGiraphConfiguration<I extends org.apache.hadoop.io.WritableComparable,​V extends org.apache.hadoop.io.Writable,​E extends org.apache.hadoop.io.Writable>
    extends GiraphConfiguration
    The classes set here are immutable, the remaining configuration is mutable. Classes are immutable and final to provide the best performance for instantiation. Everything is thread-safe.
    • Constructor Detail

      • ImmutableClassesGiraphConfiguration

        public ImmutableClassesGiraphConfiguration​(org.apache.hadoop.conf.Configuration configuration)
        Non- simplefragment parameterized constructor use for VertexInputForm.
        Parameters:
        configuration - configuration.
      • ImmutableClassesGiraphConfiguration

        public ImmutableClassesGiraphConfiguration​(org.apache.hadoop.conf.Configuration configuration,
                                                   IFragment fragment)
      • ImmutableClassesGiraphConfiguration

        public ImmutableClassesGiraphConfiguration​(org.apache.hadoop.conf.Configuration configuration,
                                                   String cppFragStr,
                                                   int fid,
                                                   int fnum)
    • Method Detail

      • configureIfPossible

        public void configureIfPossible​(Object obj)
        Configure an object with this instance if the object is configurable.
        Parameters:
        obj - Object
      • createVertex

        public org.apache.giraph.graph.Vertex<I,​V,​E> createVertex()
        Create a vertex
        Returns:
        Instantiated vertex
      • createWrappedVertexOutputFormat

        public org.apache.giraph.io.internal.WrappedVertexOutputFormat<I,​V,​E> createWrappedVertexOutputFormat()
        Create a wrapper for user vertex output format, which makes sure that Configuration parameters are set properly in all methods related to this format.
        Returns:
        Wrapper around user vertex output format
      • getVertexOutputFormatClass

        public Class<? extends org.apache.giraph.io.VertexOutputFormat<I,​V,​E>> getVertexOutputFormatClass()
        Get the user's subclassed VertexOutputFormat.
        Returns:
        User's vertex output format class
      • getEdgeInputFormatClass

        public Class<? extends org.apache.giraph.io.EdgeInputFormat<I,​E>> getEdgeInputFormatClass()
        Get the user's subclassed EdgeInputFormat.
        Returns:
        User's edge input format class
      • getDefaultWorkerFile

        public String getDefaultWorkerFile()
        Generate the string for default work file to write data to. shall be unique for each run.
      • createWorkerContext

        public WorkerContext createWorkerContext()
        Create a user worker context
        Returns:
        Instantiated user worker context
      • getComputationClass

        public Class<? extends org.apache.giraph.graph.Computation<I,​V,​E,​? extends org.apache.hadoop.io.Writable,​? extends org.apache.hadoop.io.Writable>> getComputationClass()
        Description copied from class: GiraphConfiguration
        Get the user's subclassed Computation
        Overrides:
        getComputationClass in class GiraphConfiguration
        Returns:
        User's computation class
      • getVertexIdClass

        public Class<I> getVertexIdClass()
        Get the user's subclassed vertex index class.
        Returns:
        User's vertex index class
      • createVertexId

        public I createVertexId()
      • getVertexValueClass

        public Class<V> getVertexValueClass()
      • createVertexValue

        public V createVertexValue()
      • getEdgeValueClass

        public Class<E> getEdgeValueClass()
      • createEdgeValue

        public E createEdgeValue()
      • createInComingMessageValue

        public org.apache.hadoop.io.Writable createInComingMessageValue()
      • createOutgoingMessageValue

        public org.apache.hadoop.io.Writable createOutgoingMessageValue()
      • getGrapeOidClass

        public Class<?> getGrapeOidClass()
      • getGrapeVidClass

        public Class<?> getGrapeVidClass()
      • getGrapeVdataClass

        public Class<?> getGrapeVdataClass()
      • getGrapeEdataClass

        public Class<?> getGrapeEdataClass()
      • getIncomingMessageValueClass

        public <M extends org.apache.hadoop.io.Writable> Class<M> getIncomingMessageValueClass()
        Get the user's subclassed incoming message value class.
        Type Parameters:
        M - Message data
        Returns:
        User's vertex message value class
      • getOutgoingMessageValueClass

        public <M extends org.apache.hadoop.io.Writable> Class<M> getOutgoingMessageValueClass()
        Get the user's subclassed outgoing message value class.
        Type Parameters:
        M - Message type
        Returns:
        User's vertex message value class
      • getIncomingMessageClasses

        public <M extends org.apache.hadoop.io.Writable> org.apache.giraph.conf.MessageClasses<I,​M> getIncomingMessageClasses()
        Get incoming message classes
        Type Parameters:
        M - message type
        Returns:
        incoming message classes
      • getOutgoingMessageClasses

        public <M extends org.apache.hadoop.io.Writable> org.apache.giraph.conf.MessageClasses<I,​M> getOutgoingMessageClasses()
        Get outgoing message classes
        Type Parameters:
        M - message type
        Returns:
        outgoing message classes
      • createOutgoingMessageValueFactory

        public <M extends org.apache.hadoop.io.Writable> org.apache.giraph.factories.MessageValueFactory<M> createOutgoingMessageValueFactory()
        Create new outgoing message value factory
        Type Parameters:
        M - message type
        Returns:
        outgoing message value factory
      • createIncomingMessageValueFactory

        public <M extends org.apache.hadoop.io.Writable> org.apache.giraph.factories.MessageValueFactory<M> createIncomingMessageValueFactory()
        Create new incoming message value factory
        Type Parameters:
        M - message type
        Returns:
        incoming message value factory
      • setMessageCombinerClass

        public void setMessageCombinerClass​(Class<? extends org.apache.giraph.combiner.MessageCombiner> messageCombinerClass)
        Description copied from class: GiraphConfiguration
        Set the message combiner class (optional)
        Overrides:
        setMessageCombinerClass in class GiraphConfiguration
        Parameters:
        messageCombinerClass - Determines how vertex messages are combined
      • createOutgoingMessageCombiner

        public <M extends org.apache.hadoop.io.Writable> org.apache.giraph.combiner.MessageCombiner<? super I,​M> createOutgoingMessageCombiner()
        Create a user combiner class
        Type Parameters:
        M - Message data
        Returns:
        Instantiated user combiner class
      • useOutgoingMessageCombiner

        public boolean useOutgoingMessageCombiner()
        Check if user set a combiner
        Returns:
        True iff user set a combiner class
      • updateSuperstepClasses

        public void updateSuperstepClasses​(org.apache.giraph.master.SuperstepClasses superstepClasses)
        Update Computation and MessageCombiner class used
        Parameters:
        superstepClasses - SuperstepClasses
      • getMasterComputeClass

        public Class<? extends MasterCompute> getMasterComputeClass()
        Get the user's subclassed MasterCompute
        Returns:
        User's master class
      • createMasterCompute

        public MasterCompute createMasterCompute()
        Create a user master
        Returns:
        Instantiated user master
      • getWorkerId

        public int getWorkerId()
      • getWorkerNum

        public int getWorkerNum()
      • getInetAddressMaxResolveTime

        public int getInetAddressMaxResolveTime()
      • getUseUnsafeSerialization

        public boolean getUseUnsafeSerialization()
        Whether to use an unsafe serialization
        Returns:
        whether to use unsafe serialization
      • createExtendedDataOutput

        public org.apache.giraph.utils.ExtendedDataOutput createExtendedDataOutput()
        Create an extended data output (can be subclassed)
        Returns:
        ExtendedDataOutput object
      • createExtendedDataOutput

        public org.apache.giraph.utils.ExtendedDataOutput createExtendedDataOutput​(int expectedSize)
        Create an extended data output (can be subclassed)
        Parameters:
        expectedSize - Expected size
        Returns:
        ExtendedDataOutput object
      • createExtendedDataOutput

        public org.apache.giraph.utils.ExtendedDataOutput createExtendedDataOutput​(byte[] buf,
                                                                                   int pos)
        Create an extended data output (can be subclassed)
        Parameters:
        buf - Buffer to use for the output (reuse perhaps)
        pos - How much of the buffer is already used
        Returns:
        ExtendedDataOutput object
      • createExtendedDataInput

        public org.apache.giraph.utils.ExtendedDataInput createExtendedDataInput​(byte[] buf,
                                                                                 int off,
                                                                                 int length)
        Create an extended data input (can be subclassed)
        Parameters:
        buf - Buffer to use for the input
        off - Where to start reading in the buffer
        length - Maximum length of the buffer
        Returns:
        ExtendedDataInput object
      • createExtendedDataInput

        public org.apache.giraph.utils.ExtendedDataInput createExtendedDataInput​(byte[] buf)
        Create an extended data input (can be subclassed)
        Parameters:
        buf - Buffer to use for the input
        Returns:
        ExtendedDataInput object
      • createExtendedDataInput

        public org.apache.giraph.utils.ExtendedDataInput createExtendedDataInput​(org.apache.giraph.utils.ExtendedDataOutput extendedDataOutput)
        Create extendedDataInput based on extendedDataOutput
        Parameters:
        extendedDataOutput - extendedDataOutput
        Returns:
        extendedDataInput
      • getOutMessageCacheType

        public String getOutMessageCacheType()