Search in sources :

Example 36 with BytesOutput

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

the class BytesId method of.

public static BytesId of(UUID value) {
    E.checkArgument(value != null, "The value can't be null");
    long high = value.getMostSignificantBits();
    long low = value.getLeastSignificantBits();
    BytesOutput output = IOFactory.createBytesOutput(16);
    try {
        output.writeLong(high);
        output.writeLong(low);
    } catch (IOException e) {
        throw new ComputerException("Failed to write UUID object to " + "BytesId");
    }
    return new BytesId(IdType.UUID, output.buffer(), output.position());
}
Also used : BytesOutput(com.baidu.hugegraph.computer.core.io.BytesOutput) IOException(java.io.IOException) ComputerException(com.baidu.hugegraph.computer.core.common.exception.ComputerException)

Aggregations

BytesOutput (com.baidu.hugegraph.computer.core.io.BytesOutput)36 BytesInput (com.baidu.hugegraph.computer.core.io.BytesInput)16 Test (org.junit.Test)16 EntryOutput (com.baidu.hugegraph.computer.core.store.entry.EntryOutput)11 EntryOutputImpl (com.baidu.hugegraph.computer.core.store.entry.EntryOutputImpl)11 Sorter (com.baidu.hugegraph.computer.core.sort.Sorter)7 CombineKvInnerSortFlusher (com.baidu.hugegraph.computer.core.sort.flusher.CombineKvInnerSortFlusher)7 InnerSortFlusher (com.baidu.hugegraph.computer.core.sort.flusher.InnerSortFlusher)5 KvEntriesInput (com.baidu.hugegraph.computer.core.store.buffer.KvEntriesInput)5 KvEntry (com.baidu.hugegraph.computer.core.store.entry.KvEntry)5 ArrayList (java.util.ArrayList)5 PointerCombiner (com.baidu.hugegraph.computer.core.combiner.PointerCombiner)4 Config (com.baidu.hugegraph.computer.core.config.Config)4 Id (com.baidu.hugegraph.computer.core.graph.id.Id)4 IntValue (com.baidu.hugegraph.computer.core.graph.value.IntValue)4 GraphComputeOutput (com.baidu.hugegraph.computer.core.io.GraphComputeOutput)4 RandomAccessInput (com.baidu.hugegraph.computer.core.io.RandomAccessInput)4 StreamGraphOutput (com.baidu.hugegraph.computer.core.io.StreamGraphOutput)4 KvInnerSortFlusher (com.baidu.hugegraph.computer.core.sort.flusher.KvInnerSortFlusher)4 KvEntryWriter (com.baidu.hugegraph.computer.core.store.entry.KvEntryWriter)4