private List<HiveLock> getLocks(boolean verify, boolean fetchData, HiveConf conf) throws LockException { if (!root.hasChild()) { return Collections.emptyList(); } List<HiveLock> locks = new ArrayList<HiveLock>(); getLocks(new Stack<String>(), verify, fetchData, locks, conf); return locks; }
private List<HiveLock> getLocks(boolean verify, boolean fetchData, HiveConf conf) throws LockException { if (!root.hasChild()) { return Collections.emptyList(); } List<HiveLock> locks = new ArrayList<HiveLock>(); getLocks(new Stack<String>(), verify, fetchData, locks, conf); return locks; }
private List<HiveLock> getLocks(String[] paths, boolean verify, boolean fetchData, HiveConf conf) throws LockException { if (!root.hasChild()) { return Collections.emptyList(); } List<HiveLock> locks = new ArrayList<HiveLock>(); getLocks(paths, 0, verify, fetchData, locks, conf); return locks; }
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 List<HiveLock> getLocks(boolean verify, boolean fetchData, HiveConf conf) throws LockException { if (!root.hasChild()) { return Collections.emptyList(); } List<HiveLock> locks = new ArrayList<HiveLock>(); getLocks(new Stack<String>(), verify, fetchData, locks, conf); return locks; }
private List<HiveLock> getLocks(String[] paths, boolean verify, boolean fetchData, HiveConf conf) throws LockException { if (!root.hasChild()) { return Collections.emptyList(); } List<HiveLock> locks = new ArrayList<HiveLock>(); getLocks(paths, 0, verify, fetchData, locks, conf); return locks; }
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 List<HiveLock> getLocks(String[] paths, boolean verify, boolean fetchData, HiveConf conf) throws LockException { if (!root.hasChild()) { return Collections.emptyList(); } List<HiveLock> locks = new ArrayList<HiveLock>(); getLocks(paths, 0, verify, fetchData, locks, conf); return locks; }