OldAssignmentCreator.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:QDrill 作者:
OldAssignmentCreator(List<DrillbitEndpoint> incomingEndpoints, List<T> units) {
  logger.debug("Assigning {} units to {} endpoints", units.size(), incomingEndpoints.size());
  Stopwatch watch = new Stopwatch();

  Preconditions.checkArgument(incomingEndpoints.size() <= units.size(), String.format("Incoming endpoints %d "
      + "is greater than number of row groups %d", incomingEndpoints.size(), units.size()));
  this.mappings = ArrayListMultimap.create();
  this.endpoints = Lists.newLinkedList(incomingEndpoints);

  ArrayList<T> rowGroupList = new ArrayList<>(units);
  for (double cutoff : ASSIGNMENT_CUTOFFS) {
    scanAndAssign(rowGroupList, cutoff, false, false);
  }
  scanAndAssign(rowGroupList, 0.0, true, false);
  scanAndAssign(rowGroupList, 0.0, true, true);

  logger.debug("Took {} ms to apply assignments", watch.elapsed(TimeUnit.MILLISECONDS));
  Preconditions.checkState(rowGroupList.isEmpty(), "All readEntries should be assigned by now, but some are still unassigned");
  Preconditions.checkState(!units.isEmpty());

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号