AssignmentCreator.java 文件源码

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

项目:dremio-oss 作者:
/**
 * Does the work of creating the mappings for this AssignmentCreator
 * @return the minor fragment id to work units mapping
 */
private ListMultimap<Integer, T> getMappings() {
  Stopwatch watch = Stopwatch.createStarted();
  maxWork = (int) Math.ceil(units.size() / ((float) incomingEndpoints.size()));
  LinkedList<WorkEndpointListPair<T>> workList = getWorkList();
  LinkedList<WorkEndpointListPair<T>> unassignedWorkList;
  Map<NodeEndpoint,FragIteratorWrapper> endpointIterators = getEndpointIterators();

  unassignedWorkList = assign(workList, endpointIterators, true);

  assignLeftovers(unassignedWorkList, endpointIterators, true);
  assignLeftovers(unassignedWorkList, endpointIterators, false);

  if (!unassignedWorkList.isEmpty()) {
    throw new IllegalStateException("There are still unassigned work units");
  }

  logger.debug("Took {} ms to assign {} work units to {} fragments", watch.elapsed(TimeUnit.MILLISECONDS), units.size(), incomingEndpoints.size());
  return mappings;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号