@Override public void open(Configuration parameters) throws Exception { RuntimeContext context = getRuntimeContext(); format.configure(parameters); int indexInSubtaskGroup = context.getIndexOfThisSubtask(); int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks(); format.open(indexInSubtaskGroup, currentNumberOfSubtasks); }
((InitializeOnMaster)format).initializeGlobal(1); format.configure(this.parameters);
this.format.configure(this.config.getStubParameters());
this.format.configure(this.config.getStubParameters());
this.format.configure(this.config.getStubParameters());
public static void initializeOutputFormatsOnMaster( 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 InitializeOnMaster) { try { outputFormat.configure(stub.getParameters(key)); ((InitializeOnMaster) outputFormat).initializeGlobal(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); } }
this.format.configure(this.config.getStubParameters());
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); } }
outputFormat.configure(cfg.getStubParameters()); } catch (Throwable t) { throw new Exception("Configuring the OutputFormat (" + formatDescription + ") failed: " + t.getMessage(), t);
outputFormat.configure(cfg.getStubParameters()); } catch (Throwable t) { throw new Exception("Configuring the OutputFormat (" + formatDescription + ") failed: " + t.getMessage(), t);
outputFormat.configure(cfg.getStubParameters()); } catch (Throwable t) { throw new Exception("Configuring the OutputFormat (" + formatDescription + ") failed: " + t.getMessage(), t);
outputFormat.configure(cfg.getStubParameters()); } catch (Throwable t) { throw new Exception("Configuring the OutputFormat (" + formatDescription + ") failed: " + t.getMessage(), t);
outputFormat.configure(cfg.getStubParameters());
outputFormat.configure(cfg.getStubParameters());
@Override public void open(Configuration parameters) throws Exception { RuntimeContext context = getRuntimeContext(); format.configure(parameters); int indexInSubtaskGroup = context.getIndexOfThisSubtask(); int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks(); format.open(indexInSubtaskGroup, currentNumberOfSubtasks); }
@Override public void open(Configuration parameters) throws Exception { RuntimeContext context = getRuntimeContext(); format.configure(parameters); int indexInSubtaskGroup = context.getIndexOfThisSubtask(); int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks(); format.open(indexInSubtaskGroup, currentNumberOfSubtasks); }
@Override public void open(Configuration parameters) throws Exception { RuntimeContext context = getRuntimeContext(); format.configure(parameters); int indexInSubtaskGroup = context.getIndexOfThisSubtask(); int currentNumberOfSubtasks = context.getNumberOfParallelSubtasks(); format.open(indexInSubtaskGroup, currentNumberOfSubtasks); }
((InitializeOnMaster)format).initializeGlobal(1); format.configure(this.parameters);
((InitializeOnMaster)format).initializeGlobal(1); format.configure(this.parameters);