public void closeAllWriters() { final Queue<BlockOutputWriter> allWriters = new ConcurrentLinkedQueue<>(); for (Queue<BlockOutputWriter> blockOutputWriters : freeWriters.values()) { allWriters.addAll(blockOutputWriters); } if (allWriters.isEmpty()) { return; } // Closing writers can take time - use multiple threads and call progress CallableFactory<Void> callableFactory = new CallableFactory<Void>() { @Override public Callable<Void> newCallable(int callableId) { return new Callable<Void>() { @Override public Void call() throws Exception { BlockOutputWriter writer = allWriters.poll(); while (writer != null) { writer.close(); writer = allWriters.poll(); } return null; } }; } }; ProgressableUtils.getResultsWithNCallables(callableFactory, Math.min(GiraphConstants.NUM_OUTPUT_THREADS.get(conf), allWriters.size()), "close-writers-%d", progressable); } }
ProgressableUtils.getResultsWithNCallables(callableFactory, Math.min(configuration.getNumOutputThreads(), availableVertexWriters.size()), "close-writers-%d", context);
ProgressableUtils.getResultsWithNCallables(callableFactory, numThreads, "move-edges-%d", progressable);
ProgressableUtils.getResultsWithNCallables(callableFactory, numThreads, "load-vertices-%d", getContext());
ProgressableUtils.getResultsWithNCallables(callableFactory, numThreads, "checkpoint-vertices-%d", getContext());
ProgressableUtils.getResultsWithNCallables(inputSplitsCallableFactory, numThreads, "load-%d", getContext()); for (VertexEdgeCount result : results) {
ProgressableUtils.getResultsWithNCallables(callableFactory, numThreads, "compute-%d", context);
ProgressableUtils.getResultsWithNCallables(callableFactory, numThreads, "save-vertices-%d", getContext());
ProgressableUtils.getResultsWithNCallables(callableFactory, numThreads, "save-vertices-%d", getContext());