Search in sources :

Example 16 with WriteByteBuffer

use of com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer in project titan by thinkaurelius.

the class VariableLong method positiveByteBuffer.

public static StaticBuffer positiveByteBuffer(final long value) {
    WriteBuffer buffer = new WriteByteBuffer(positiveLength(value));
    writePositive(buffer, value);
    return buffer.getStaticBuffer();
}
Also used : WriteBuffer(com.thinkaurelius.titan.diskstorage.WriteBuffer) WriteByteBuffer(com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer)

Example 17 with WriteByteBuffer

use of com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer in project titan by thinkaurelius.

the class VariableLong method positiveByteBuffer.

public static StaticBuffer positiveByteBuffer(long[] value) {
    int len = 0;
    for (long aValue : value) len += positiveLength(aValue);
    WriteBuffer buffer = new WriteByteBuffer(len);
    for (long aValue : value) writePositive(buffer, aValue);
    return buffer.getStaticBuffer();
}
Also used : WriteBuffer(com.thinkaurelius.titan.diskstorage.WriteBuffer) WriteByteBuffer(com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer)

Example 18 with WriteByteBuffer

use of com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer in project titan by thinkaurelius.

the class ConsistentKeyLockerSerializer method toLockKey.

public StaticBuffer toLockKey(StaticBuffer key, StaticBuffer column) {
    WriteBuffer b = new WriteByteBuffer(key.length() + column.length() + 4);
    b.putInt(key.length());
    WriteBufferUtil.put(b, key);
    WriteBufferUtil.put(b, column);
    return b.getStaticBuffer();
}
Also used : WriteBuffer(com.thinkaurelius.titan.diskstorage.WriteBuffer) WriteByteBuffer(com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer)

Aggregations

WriteByteBuffer (com.thinkaurelius.titan.diskstorage.util.WriteByteBuffer)18 WriteBuffer (com.thinkaurelius.titan.diskstorage.WriteBuffer)14 Test (org.junit.Test)7 ReadBuffer (com.thinkaurelius.titan.diskstorage.ReadBuffer)4 StaticArrayEntry (com.thinkaurelius.titan.diskstorage.util.StaticArrayEntry)3 StaticBuffer (com.thinkaurelius.titan.diskstorage.StaticBuffer)2 KeyValueEntry (com.thinkaurelius.titan.diskstorage.keycolumnvalue.keyvalue.KeyValueEntry)2 ReadArrayBuffer (com.thinkaurelius.titan.diskstorage.util.ReadArrayBuffer)1 DataOutput (com.thinkaurelius.titan.graphdb.database.serialize.DataOutput)1 KryoSerializer (com.thinkaurelius.titan.graphdb.database.serialize.kryo.KryoSerializer)1 RelationType (com.thinkaurelius.titan.graphdb.internal.RelationType)1 UUID (java.util.UUID)1 StopWatch (org.apache.commons.lang.time.StopWatch)1