private boolean unlock(String[] paths, int index, HiveLockObjectData data) { if (!lock.tryLock()) { return false; } try { if (index == paths.length) { if (hasLock()) { datas.remove(data.getQueryId()); } return true; } Node child = children == null ? null : children.get(paths[index]); if (child == null) { return true; // should not happen } if (child.unlock(paths, index + 1, data)) { if (!child.hasLock() && !child.hasChild()) { children.remove(paths[index]); } return true; } return false; } finally { lock.unlock(); } }
private boolean unlock(String[] paths, int index, HiveLockObjectData data) { if (!lock.tryLock()) { return false; } try { if (index == paths.length) { if (hasLock()) { datas.remove(data.getQueryId()); } return true; } Node child = children == null ? null : children.get(paths[index]); if (child == null) { return true; // should not happen } if (child.unlock(paths, index + 1, data)) { if (!child.hasLock() && !child.hasChild()) { children.remove(paths[index]); } return true; } return false; } finally { lock.unlock(); } }
private boolean unlock(String[] paths, int index, HiveLockObjectData data) { if (!lock.tryLock()) { return false; } try { if (index == paths.length) { if (hasLock()) { datas.remove(data.getQueryId()); } return true; } Node child = children == null ? null : children.get(paths[index]); if (child == null) { return true; // should not happen } if (child.unlock(paths, index + 1, data)) { if (!child.hasLock() && !child.hasChild()) { children.remove(paths[index]); } return true; } return false; } finally { lock.unlock(); } }
public boolean unlock(String[] paths, HiveLockObjectData data) { return unlock(paths, 0, data); }
public void unlock(HiveLock hiveLock, int numRetriesForUnLock, long sleepTime) throws LockException { String[] paths = hiveLock.getHiveLockObject().getPaths(); HiveLockObjectData data = hiveLock.getHiveLockObject().getData(); for (int i = 0; i <= numRetriesForUnLock; i++) { if (i > 0) { sleep(sleepTime); } if (root.unlock(paths, data)) { return; } } throw new LockException("Failed to release lock " + hiveLock); }
public boolean unlock(String[] paths, HiveLockObjectData data) { return unlock(paths, 0, data); }
public void unlock(HiveLock hiveLock, int numRetriesForUnLock, long sleepTime) throws LockException { String[] paths = hiveLock.getHiveLockObject().getPaths(); HiveLockObjectData data = hiveLock.getHiveLockObject().getData(); for (int i = 0; i <= numRetriesForUnLock; i++) { if (i > 0) { sleep(sleepTime); } if (root.unlock(paths, data)) { return; } } throw new LockException("Failed to release lock " + hiveLock); }
public void unlock(HiveLock hiveLock, int numRetriesForUnLock, long sleepTime) throws LockException { String[] paths = hiveLock.getHiveLockObject().getPaths(); HiveLockObjectData data = hiveLock.getHiveLockObject().getData(); for (int i = 0; i <= numRetriesForUnLock; i++) { if (i > 0) { sleep(sleepTime); } if (root.unlock(paths, data)) { return; } } throw new LockException("Failed to release lock " + hiveLock); }
public boolean unlock(String[] paths, HiveLockObjectData data) { return unlock(paths, 0, data); }