Class HdfsOutput
- java.lang.Object
-
- org.apache.hugegraph.computer.core.output.AbstractComputerOutput
-
- org.apache.hugegraph.computer.core.output.hdfs.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.PathbuildPath(java.lang.String dir, java.lang.String jobId, int partition)voidclose()protected java.lang.StringconstructValueString(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)protected booleanfilter(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)voidinit(org.apache.hugegraph.computer.core.config.Config config, int partition)voidmergePartitions(org.apache.hugegraph.computer.core.config.Config config)static org.apache.hadoop.fs.FileSystemopenHDFS(org.apache.hugegraph.computer.core.config.Config config, org.apache.hadoop.conf.Configuration conf)voidwrite(org.apache.hugegraph.computer.core.graph.vertex.Vertex vertex)protected voidwriteBytes(byte[] bytes)protected voidwriteString(java.lang.String string)
-
-
-
Method Detail
-
init
public void init(org.apache.hugegraph.computer.core.config.Config config, int partition)- Specified by:
initin interfaceorg.apache.hugegraph.computer.core.output.ComputerOutput- Overrides:
initin classorg.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.IOExceptionjava.lang.InterruptedException
-
-