@Override public void run() { Map<KeyExtent,Long> estimatedSizes = null; try { estimatedSizes = FileUtil.estimateSizes(context, entry.getKey(), mapFileSizes.get(entry.getKey()), extentsOf(entry.getValue())); } catch (IOException e) { log.warn("Failed to estimate map file sizes {}", e.getMessage()); } if (estimatedSizes == null) { // estimation failed, do a simple estimation estimatedSizes = new TreeMap<>(); long estSize = (long) (mapFileSizes.get(entry.getKey()) / (double) entry.getValue().size()); for (TabletLocation tl : entry.getValue()) estimatedSizes.put(tl.tablet_extent, estSize); } List<AssignmentInfo> assignmentInfoList = new ArrayList<>(estimatedSizes.size()); for (Entry<KeyExtent,Long> entry2 : estimatedSizes.entrySet()) assignmentInfoList.add(new AssignmentInfo(entry2.getKey(), entry2.getValue())); ais.put(entry.getKey(), assignmentInfoList); } };
new AssignmentInfo(tabletLocation.tablet_extent, mapFileSizes.get(entry.getKey())))); continue; assignmentInfoList.add(new AssignmentInfo(entry2.getKey(), entry2.getValue()));
@Override public void run() { Map<KeyExtent,Long> estimatedSizes = null; try { estimatedSizes = FileUtil.estimateSizes(acuConf, entry.getKey(), mapFileSizes.get(entry.getKey()), extentsOf(entry.getValue()), conf, fs); } catch (IOException e) { log.warn("Failed to estimate map file sizes " + e.getMessage()); } if (estimatedSizes == null) { // estimation failed, do a simple estimation estimatedSizes = new TreeMap<KeyExtent,Long>(); long estSize = (long) (mapFileSizes.get(entry.getKey()) / (double) entry.getValue().size()); for (TabletLocation tl : entry.getValue()) estimatedSizes.put(tl.tablet_extent, estSize); } List<AssignmentInfo> assignmentInfoList = new ArrayList<AssignmentInfo>(estimatedSizes.size()); for (Entry<KeyExtent,Long> entry2 : estimatedSizes.entrySet()) assignmentInfoList.add(new AssignmentInfo(entry2.getKey(), entry2.getValue())); ais.put(entry.getKey(), assignmentInfoList); } };
new AssignmentInfo(tabletLocation.tablet_extent, mapFileSizes.get(entry.getKey())))); continue; assignmentInfoList.add(new AssignmentInfo(entry2.getKey(), entry2.getValue()));
ais.put(entry.getKey(), Collections.singletonList(new AssignmentInfo(tabletLocation.tablet_extent, mapFileSizes.get(entry.getKey())))); continue; assignmentInfoList.add(new AssignmentInfo(entry2.getKey(), entry2.getValue()));
@Override public void run() { Map<KeyExtent,Long> estimatedSizes = null; try { estimatedSizes = FileUtil.estimateSizes(acuConf, entry.getKey(), mapFileSizes.get(entry.getKey()), extentsOf(entry.getValue()), conf, vm); } catch (IOException e) { log.warn("Failed to estimate map file sizes {}", e.getMessage()); } if (estimatedSizes == null) { // estimation failed, do a simple estimation estimatedSizes = new TreeMap<>(); long estSize = (long) (mapFileSizes.get(entry.getKey()) / (double) entry.getValue().size()); for (TabletLocation tl : entry.getValue()) estimatedSizes.put(tl.tablet_extent, estSize); } List<AssignmentInfo> assignmentInfoList = new ArrayList<>(estimatedSizes.size()); for (Entry<KeyExtent,Long> entry2 : estimatedSizes.entrySet()) assignmentInfoList.add(new AssignmentInfo(entry2.getKey(), entry2.getValue())); ais.put(entry.getKey(), assignmentInfoList); } };