Search in sources :

Example 1 with StreamGraphOutput

use of com.baidu.hugegraph.computer.core.io.StreamGraphOutput in project hugegraph-computer by hugegraph.

the class ComputeManagerTest method writeEdges.

private static byte[] writeEdges(Vertex vertex, EdgeFrequency freq) throws IOException {
    BytesOutput bytesOutput = IOFactory.createBytesOutput(Constants.SMALL_BUF_SIZE);
    EntryOutput entryOutput = new EntryOutputImpl(bytesOutput);
    GraphComputeOutput output = new StreamGraphOutput(context(), entryOutput);
    Whitebox.setInternalState(output, "frequency", freq);
    output.writeEdges(vertex);
    return bytesOutput.toByteArray();
}
Also used : EntryOutput(com.baidu.hugegraph.computer.core.store.entry.EntryOutput) EntryOutputImpl(com.baidu.hugegraph.computer.core.store.entry.EntryOutputImpl) BytesOutput(com.baidu.hugegraph.computer.core.io.BytesOutput) StreamGraphOutput(com.baidu.hugegraph.computer.core.io.StreamGraphOutput) GraphComputeOutput(com.baidu.hugegraph.computer.core.io.GraphComputeOutput)

Example 2 with StreamGraphOutput

use of com.baidu.hugegraph.computer.core.io.StreamGraphOutput in project hugegraph-computer by hugegraph.

the class EdgesInputTest method writeEdges.

private static byte[] writeEdges(Vertex vertex, EdgeFrequency freq) throws IOException {
    BytesOutput bytesOutput = IOFactory.createBytesOutput(Constants.SMALL_BUF_SIZE);
    EntryOutput entryOutput = new EntryOutputImpl(bytesOutput);
    GraphComputeOutput output = new StreamGraphOutput(context(), entryOutput);
    Whitebox.setInternalState(output, "frequency", freq);
    output.writeEdges(vertex);
    return bytesOutput.toByteArray();
}
Also used : EntryOutput(com.baidu.hugegraph.computer.core.store.entry.EntryOutput) EntryOutputImpl(com.baidu.hugegraph.computer.core.store.entry.EntryOutputImpl) BytesOutput(com.baidu.hugegraph.computer.core.io.BytesOutput) StreamGraphOutput(com.baidu.hugegraph.computer.core.io.StreamGraphOutput) GraphComputeOutput(com.baidu.hugegraph.computer.core.io.GraphComputeOutput)

Example 3 with StreamGraphOutput

use of com.baidu.hugegraph.computer.core.io.StreamGraphOutput in project hugegraph-computer by hugegraph.

the class EdgesInputTest method writeVertex.

private static byte[] writeVertex(Vertex vertex) throws IOException {
    BytesOutput bytesOutput = IOFactory.createBytesOutput(Constants.SMALL_BUF_SIZE);
    EntryOutput entryOutput = new EntryOutputImpl(bytesOutput);
    GraphComputeOutput output = new StreamGraphOutput(context(), entryOutput);
    output.writeVertex(vertex);
    return bytesOutput.toByteArray();
}
Also used : EntryOutput(com.baidu.hugegraph.computer.core.store.entry.EntryOutput) EntryOutputImpl(com.baidu.hugegraph.computer.core.store.entry.EntryOutputImpl) BytesOutput(com.baidu.hugegraph.computer.core.io.BytesOutput) StreamGraphOutput(com.baidu.hugegraph.computer.core.io.StreamGraphOutput) GraphComputeOutput(com.baidu.hugegraph.computer.core.io.GraphComputeOutput)

Example 4 with StreamGraphOutput

use of com.baidu.hugegraph.computer.core.io.StreamGraphOutput in project hugegraph-computer by hugegraph.

the class ComputeManagerTest method writeVertex.

private static byte[] writeVertex(Vertex vertex) throws IOException {
    BytesOutput bytesOutput = IOFactory.createBytesOutput(Constants.SMALL_BUF_SIZE);
    EntryOutput entryOutput = new EntryOutputImpl(bytesOutput);
    GraphComputeOutput output = new StreamGraphOutput(context(), entryOutput);
    output.writeVertex(vertex);
    return bytesOutput.toByteArray();
}
Also used : EntryOutput(com.baidu.hugegraph.computer.core.store.entry.EntryOutput) EntryOutputImpl(com.baidu.hugegraph.computer.core.store.entry.EntryOutputImpl) BytesOutput(com.baidu.hugegraph.computer.core.io.BytesOutput) StreamGraphOutput(com.baidu.hugegraph.computer.core.io.StreamGraphOutput) GraphComputeOutput(com.baidu.hugegraph.computer.core.io.GraphComputeOutput)

Aggregations

BytesOutput (com.baidu.hugegraph.computer.core.io.BytesOutput)4 GraphComputeOutput (com.baidu.hugegraph.computer.core.io.GraphComputeOutput)4 StreamGraphOutput (com.baidu.hugegraph.computer.core.io.StreamGraphOutput)4 EntryOutput (com.baidu.hugegraph.computer.core.store.entry.EntryOutput)4 EntryOutputImpl (com.baidu.hugegraph.computer.core.store.entry.EntryOutputImpl)4