use of voldemort.store.slop.Slop in project voldemort by voldemort.
the class SlopSerializer method toObject.
public Slop toObject(byte[] bytes) {
DataInputStream input = new DataInputStream(new ByteArrayInputStream(bytes));
try {
VSlopProto.Slop proto = ProtoUtils.readToBuilder(input, VSlopProto.Slop.newBuilder()).build();
String storeName = proto.getStore();
Slop.Operation op = Slop.Operation.valueOf(proto.getOperation());
byte[] key = ProtoUtils.decodeBytes(proto.getKey()).get();
byte[] value = null;
if (proto.hasValue())
value = ProtoUtils.decodeBytes(proto.getValue()).get();
int nodeId = proto.getNodeId();
Date arrived = new Date(proto.getArrived());
return new Slop(storeName, op, key, value, nodeId, arrived);
} catch (IOException e) {
throw new SerializationException(e);
}
}
Aggregations