Class HdfsOutput

  • All Implemented Interfaces:
    org.apache.hugegraph.computer.core.output.ComputerOutput

    public class HdfsOutput
    extends org.apache.hugegraph.computer.core.output.AbstractComputerOutput
    • Constructor Summary

      Constructors 
      Constructor Description
      HdfsOutput()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.hadoop.fs.Path buildPath​(java.lang.String dir, java.lang.String jobId, int partition)  
      void close()  
      protected java.lang.String constructValueString​(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)  
      protected boolean filter​(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)  
      void init​(org.apache.hugegraph.computer.core.config.Config config, int partition)  
      void mergePartitions​(org.apache.hugegraph.computer.core.config.Config config)  
      static org.apache.hadoop.fs.FileSystem openHDFS​(org.apache.hugegraph.computer.core.config.Config config, org.apache.hadoop.conf.Configuration conf)  
      void write​(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)  
      protected void writeBytes​(byte[] bytes)  
      protected void writeString​(java.lang.String string)  
      • Methods inherited from class org.apache.hugegraph.computer.core.output.AbstractComputerOutput

        name, partition
      • Methods inherited from class java.lang.Object

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

      • HdfsOutput

        public HdfsOutput()
    • Method Detail

      • init

        public void init​(org.apache.hugegraph.computer.core.config.Config config,
                         int partition)
        Specified by:
        init in interface org.apache.hugegraph.computer.core.output.ComputerOutput
        Overrides:
        init in class org.apache.hugegraph.computer.core.output.AbstractComputerOutput
      • write

        public void write​(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)
      • filter

        protected boolean filter​(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)
      • writeBytes

        protected void writeBytes​(byte[] bytes)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • writeString

        protected void writeString​(java.lang.String string)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • constructValueString

        protected java.lang.String constructValueString​(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)
      • buildPath

        public static org.apache.hadoop.fs.Path buildPath​(java.lang.String dir,
                                                          java.lang.String jobId,
                                                          int partition)
      • mergePartitions

        public void mergePartitions​(org.apache.hugegraph.computer.core.config.Config config)
      • close

        public void close()
      • openHDFS

        public static org.apache.hadoop.fs.FileSystem openHDFS​(org.apache.hugegraph.computer.core.config.Config config,
                                                               org.apache.hadoop.conf.Configuration conf)
                                                        throws java.io.IOException,
                                                               java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException