/** * Decode long from byte array * * @param ba byte array * @return long value */ public static long decodeLong(byte[] ba) { return decodeLong(ba, 0); }
public static long getTimestamp(byte[] data) { return ByteArrayUtil.decodeLong(data, 1); }
public static long getTxDoneTimestamp(byte[] data) { return ByteArrayUtil.decodeLong(data, 1); }
public static long getCommitTimestamp(byte[] data) { return ByteArrayUtil.decodeLong(data, 1); }
public ReadLockValue(byte[] enc) { List<Bytes> fields = ByteArrayUtil.split(enc); if (fields.size() != 5) { throw new IllegalArgumentException("more fields than expected"); } this.prow = fields.get(0); this.pcol = new Column(fields.get(1), fields.get(2), fields.get(3)); this.transactor = ByteArrayUtil.decodeLong(fields.get(4).toArray()); }
public LockValue(byte[] enc) { List<Bytes> fields = ByteArrayUtil.split(enc); if (fields.size() != 6) { throw new IllegalArgumentException("more fields than expected"); } this.prow = fields.get(0); this.pcol = new Column(fields.get(1), fields.get(2), fields.get(3)); this.isWrite = (fields.get(4).byteAt(0) & 0x1) == 0x1; this.isDelete = (fields.get(4).byteAt(0) & 0x2) == 0x2; this.isTrigger = (fields.get(4).byteAt(0) & 0x4) == 0x4; this.transactor = ByteArrayUtil.decodeLong(fields.get(5).toArray()); }