Search in sources :

Example 1 with VertexInput

use of com.baidu.hugegraph.computer.core.compute.input.VertexInput in project hugegraph-computer by hugegraph.

the class FileGraphPartition method beforeOutput.

private void beforeOutput() throws IOException {
    this.vertexInput = new VertexInput(this.context, this.vertexFile, this.vertexCount);
    this.edgesInput = new EdgesInput(this.context, this.edgeFile);
    this.vertexInput.init();
    this.edgesInput.init();
    this.preStatusFile = this.curStatusFile;
    this.preValueFile = this.curValueFile;
    this.preStatusInput = new BufferedFileInput(this.preStatusFile);
    this.preValueInput = new BufferedFileInput(this.preValueFile);
}
Also used : BufferedFileInput(com.baidu.hugegraph.computer.core.io.BufferedFileInput) VertexInput(com.baidu.hugegraph.computer.core.compute.input.VertexInput) EdgesInput(com.baidu.hugegraph.computer.core.compute.input.EdgesInput)

Example 2 with VertexInput

use of com.baidu.hugegraph.computer.core.compute.input.VertexInput in project hugegraph-computer by hugegraph.

the class FileGraphPartition method beforeCompute.

private void beforeCompute(int superstep) throws IOException {
    this.vertexInput = new VertexInput(this.context, this.vertexFile, this.vertexCount);
    this.edgesInput = new EdgesInput(this.context, this.edgeFile);
    // Inputs of vertex, edges, status, and value.
    this.vertexInput.init();
    this.edgesInput.init();
    if (superstep != 0) {
        this.preStatusFile = this.curStatusFile;
        this.preValueFile = this.curValueFile;
        this.preStatusInput = new BufferedFileInput(this.preStatusFile);
        this.preValueInput = new BufferedFileInput(this.preValueFile);
    }
    // Outputs of vertex's status and vertex's value.
    String statusPath = this.fileGenerator.randomDirectory(STATUS, Integer.toString(superstep), Integer.toString(this.partition));
    String valuePath = this.fileGenerator.randomDirectory(VALUE, Integer.toString(superstep), Integer.toString(this.partition));
    this.curStatusFile = new File(statusPath);
    this.curValueFile = new File(valuePath);
    createFile(this.curStatusFile);
    createFile(this.curValueFile);
    this.curStatusOutput = new BufferedFileOutput(this.curStatusFile);
    this.curValueOutput = new BufferedFileOutput(this.curValueFile);
}
Also used : BufferedFileInput(com.baidu.hugegraph.computer.core.io.BufferedFileInput) BufferedFileOutput(com.baidu.hugegraph.computer.core.io.BufferedFileOutput) VertexInput(com.baidu.hugegraph.computer.core.compute.input.VertexInput) File(java.io.File) EdgesInput(com.baidu.hugegraph.computer.core.compute.input.EdgesInput)

Aggregations

EdgesInput (com.baidu.hugegraph.computer.core.compute.input.EdgesInput)2 VertexInput (com.baidu.hugegraph.computer.core.compute.input.VertexInput)2 BufferedFileInput (com.baidu.hugegraph.computer.core.io.BufferedFileInput)2 BufferedFileOutput (com.baidu.hugegraph.computer.core.io.BufferedFileOutput)1 File (java.io.File)1