use of com.baidu.hugegraph.computer.core.store.entry.EntryInputImpl in project hugegraph-computer by hugegraph.
the class WriteBuffersTest method wrapForRead.
@Test
public void wrapForRead() throws IOException {
GraphFactory graphFactory = context().graphFactory();
WriteBuffers buffers = new WriteBuffers(context(), 10, 20);
Vertex vertex = graphFactory.createVertex(BytesId.of(1L), new DoubleValue(0.5d));
buffers.writeVertex(vertex);
buffers.prepareSorting();
try (RandomAccessInput input = buffers.wrapForRead()) {
EntryInput entryInput = new EntryInputImpl(input);
StreamGraphInput graphInput = new StreamGraphInput(context(), entryInput);
vertex.value(null);
Assert.assertEquals(vertex, graphInput.readVertex());
}
}
Aggregations