Search in sources :

Example 11 with DataOutput

use of org.janusgraph.graphdb.database.serialize.DataOutput in project janusgraph by JanusGraph.

the class KCVSLog method getMarkerColumn.

/**
 * ###################################
 *  Getting/setting Log Settings
 * ###################################
 */
private StaticBuffer getMarkerColumn(int partitionId, int bucketId) {
    DataOutput out = manager.serializer.getDataOutput(1 + 4 + 4);
    out.putByte(MARKER_PREFIX);
    out.putInt(partitionId);
    out.putInt(bucketId);
    return out.getStaticBuffer();
}
Also used : DataOutput(org.janusgraph.graphdb.database.serialize.DataOutput)

Example 12 with DataOutput

use of org.janusgraph.graphdb.database.serialize.DataOutput in project janusgraph by JanusGraph.

the class KCVSLog method getLogKey.

private StaticBuffer getLogKey(final int partitionId, final int bucketId, final int timeslice) {
    Preconditions.checkArgument(partitionId >= 0 && partitionId < (1 << manager.partitionBitWidth));
    Preconditions.checkArgument(bucketId >= 0 && bucketId < numBuckets);
    DataOutput o = manager.serializer.getDataOutput(3 * 4);
    // Offset to put significant bits in front
    o.putInt((partitionId << (32 - manager.partitionBitWidth)));
    o.putInt(bucketId);
    o.putInt(timeslice);
    return o.getStaticBuffer();
}
Also used : DataOutput(org.janusgraph.graphdb.database.serialize.DataOutput)

Example 13 with DataOutput

use of org.janusgraph.graphdb.database.serialize.DataOutput in project janusgraph by JanusGraph.

the class KCVSLog method getSettingKey.

private StaticBuffer getSettingKey(String identifier) {
    DataOutput out = manager.serializer.getDataOutput(4 + 2 + identifier.length());
    out.putInt(SYSTEM_PARTITION_ID);
    out.writeObjectNotNull(identifier);
    return out.getStaticBuffer();
}
Also used : DataOutput(org.janusgraph.graphdb.database.serialize.DataOutput)

Example 14 with DataOutput

use of org.janusgraph.graphdb.database.serialize.DataOutput in project janusgraph by JanusGraph.

the class KeyValueStoreUtil method getBuffer.

public static StaticBuffer getBuffer(String s) {
    DataOutput out = serial.getDataOutput(50);
    out.writeObjectNotNull(s);
    return out.getStaticBuffer();
}
Also used : DataOutput(org.janusgraph.graphdb.database.serialize.DataOutput)

Example 15 with DataOutput

use of org.janusgraph.graphdb.database.serialize.DataOutput in project janusgraph by JanusGraph.

the class SerializerTest method getStringBuffer.

private StaticBuffer getStringBuffer(String value) {
    DataOutput o = serialize.getDataOutput(value.length() + 10);
    o.writeObject(value, String.class);
    return o.getStaticBuffer();
}
Also used : DataOutput(org.janusgraph.graphdb.database.serialize.DataOutput)

Aggregations

DataOutput (org.janusgraph.graphdb.database.serialize.DataOutput)39 ReadBuffer (org.janusgraph.diskstorage.ReadBuffer)16 Test (org.junit.jupiter.api.Test)14 StaticBuffer (org.janusgraph.diskstorage.StaticBuffer)10 HashMap (java.util.HashMap)3 Map (java.util.Map)3 StaticArrayEntry (org.janusgraph.diskstorage.util.StaticArrayEntry)3 TClass1Serializer (org.janusgraph.graphdb.serializer.attributes.TClass1Serializer)3 TClass2 (org.janusgraph.graphdb.serializer.attributes.TClass2)3 SpatialContextFactory (org.locationtech.spatial4j.context.SpatialContextFactory)3 EnumMap (java.util.EnumMap)2 PropertyKey (org.janusgraph.core.PropertyKey)2 Geoshape (org.janusgraph.core.attribute.Geoshape)2 DirectionID (org.janusgraph.graphdb.database.idhandling.IDHandler.DirectionID)2 RelationCategory (org.janusgraph.graphdb.internal.RelationCategory)2 TClass1 (org.janusgraph.graphdb.serializer.attributes.TClass1)2 TEnum (org.janusgraph.graphdb.serializer.attributes.TEnum)2 JanusGraphSchemaVertex (org.janusgraph.graphdb.types.vertices.JanusGraphSchemaVertex)2 LoggerFactory (org.slf4j.LoggerFactory)2 LongArrayList (com.carrotsearch.hppc.LongArrayList)1