.setCreateTime(EnvironmentEdgeManager.currentTimeMillis()).build();
byte[] lockMetadata = toBytes(data);
InterProcessReadWriteLock lock = new ZKInterProcessReadWriteLock(zkWatcher, tableLockZNode,
METADATA_HANDLER);
return isShared ? lock.readLock(lockMetadata) : lock.writeLock(lockMetadata);
}
}
private static byte[] toBytes(ZooKeeperProtos.TableLock data) {
return ProtobufUtil.prependPBMagic(data.toByteArray());