/** * asyn getChildren * The retryCount and retryInterval will be ignored. */ // TODO: Change the behavior of getChildren when Helix starts migrating API. @Override public List<T> getChildren(String parentPath, List<Stat> stats, int options) { return getChildren(parentPath, stats, options, false); }
/** * asyn getChildren * The retryCount and retryInterval will be ignored. */ // TODO: Change the behavior of getChildren when Helix starts migrating API. @Override public List<T> getChildren(String parentPath, List<Stat> stats, int options) { return getChildren(parentPath, stats, options, false); }
@Override public List<T> getChildren(String parentPath, List<Stat> stats, int options, int retryCount, int retryInterval) throws HelixException { int readCount = retryCount + 1; while (readCount > 0) { try { readCount--; List<T> records = getChildren(parentPath, stats, options, true); return records; } catch (HelixMetaDataAccessException e) { if (readCount == 0) { throw new HelixMetaDataAccessException(String.format("Failed to get full list of %s", parentPath), e); } try { Thread.sleep(retryInterval); } catch (InterruptedException interruptedException) { throw new HelixMetaDataAccessException("Fail to interrupt the sleep", interruptedException); } } } // Impossible to reach end return null; }
@Override public List<T> getChildren(String parentPath, List<Stat> stats, int options, int retryCount, int retryInterval) throws HelixException { int readCount = retryCount + 1; while (readCount > 0) { try { readCount--; List<T> records = getChildren(parentPath, stats, options, true); return records; } catch (HelixMetaDataAccessException e) { if (readCount == 0) { throw new HelixMetaDataAccessException(String.format("Failed to get full list of %s", parentPath), e); } try { Thread.sleep(retryInterval); } catch (InterruptedException interruptedException) { throw new HelixMetaDataAccessException("Fail to interrupt the sleep", interruptedException); } } } // Impossible to reach end return null; }
records = accessor.getChildren(parentPath, null, 0); for (int i = 0; i < 10; i++) { String msgId = "msg_" + i;