.setThreadId(Thread.currentThread().getId())
.setPurpose(purpose)
.setIsShared(isShared).build();
byte[] lockMetadata = toBytes(data);
InterProcessReadWriteLock lock = new ZKInterProcessReadWriteLock(zkWatcher, tableLockZNode,
METADATA_HANDLER);
return isShared ? lock.readLock(lockMetadata) : lock.writeLock(lockMetadata);
}