((FinalizeOnMaster)format).finalizeGlobal(1);
((FinalizeOnMaster) outputFormat).finalizeGlobal(getParallelism());
public static void finalizeOutputFormatsOnMaster( JobVertex jobVertex, AbstractFormatStub<OperatorID, ?> stub, final Map<OperatorID, String> formatDescriptions) throws RuntimeException { // set user classloader before calling user code final ClassLoader original = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(stub.getClassLoader()); try { Iterator<? extends Pair<OperatorID, ?>> it = stub.getFormat(FormatType.OUTPUT); it.forEachRemaining( (pair) -> { OperatorID key = pair.getKey(); OutputFormat outputFormat = (OutputFormat) pair.getValue(); if (outputFormat instanceof FinalizeOnMaster) { try { outputFormat.configure(stub.getParameters(key)); ((FinalizeOnMaster) outputFormat).finalizeGlobal(jobVertex.getParallelism()); } catch (Throwable t) { throw new RuntimeException("Configuring the OutputFormat (" + "description: " + formatDescriptions.get(key) + ", stubKey: " + key + ") failed: " + t.getMessage(), t); } } } ); } finally { // restore previous classloader Thread.currentThread().setContextClassLoader(original); } }
((FinalizeOnMaster) outputFormat).finalizeGlobal(getParallelism());
((FinalizeOnMaster) outputFormat).finalizeGlobal(getParallelism());
((FinalizeOnMaster)format).finalizeGlobal(1);
((FinalizeOnMaster)format).finalizeGlobal(1);