public Map<Integer, StreamConfig> getTransitiveChainedTaskConfigsWithSelf(ClassLoader cl) { //TODO: could this logic be moved to the user of #setTransitiveChainedTaskConfigs() ? Map<Integer, StreamConfig> chainedTaskConfigs = getTransitiveChainedTaskConfigs(cl); chainedTaskConfigs.put(getVertexID(), this); return chainedTaskConfigs; }
public Map<Integer, StreamConfig> getTransitiveChainedTaskConfigsWithSelf(ClassLoader cl) { //TODO: could this logic be moved to the user of #setTransitiveChainedTaskConfigs() ? Map<Integer, StreamConfig> chainedTaskConfigs = getTransitiveChainedTaskConfigs(cl); chainedTaskConfigs.put(getVertexID(), this); return chainedTaskConfigs; }
public Map<Integer, StreamConfig> getTransitiveChainedTaskConfigsWithSelf(ClassLoader cl) { //TODO: could this logic be moved to the user of #setTransitiveChainedTaskConfigs() ? Map<Integer, StreamConfig> chainedTaskConfigs = getTransitiveChainedTaskConfigs(cl); chainedTaskConfigs.put(getVertexID(), this); return chainedTaskConfigs; }
public CheckpointStreamFactory createSavepointStreamFactory(StreamOperator<?> operator, String targetLocation) throws IOException { return stateBackend.createSavepointStreamFactory( getEnvironment().getJobID(), createOperatorIdentifier(operator, configuration.getVertexID()), targetLocation); }
/** * This is only visible because * {@link org.apache.flink.streaming.runtime.operators.GenericWriteAheadSink} uses the * checkpoint stream factory to write write-ahead logs. <b>This should not be used for * anything else.</b> */ public CheckpointStreamFactory createCheckpointStreamFactory(StreamOperator<?> operator) throws IOException { return stateBackend.createStreamFactory( getEnvironment().getJobID(), createOperatorIdentifier(operator, configuration.getVertexID())); }
chainedConfigs.put(configuration.getVertexID(), configuration);
public OperatorStateBackend createOperatorStateBackend( StreamOperator<?> op, Collection<OperatorStateHandle> restoreStateHandles) throws Exception { Environment env = getEnvironment(); String opId = createOperatorIdentifier(op, getConfiguration().getVertexID()); OperatorStateBackend operatorStateBackend = stateBackend.createOperatorStateBackend(env, opId); // let operator state backend participate in the operator lifecycle, i.e. make it responsive to cancelation cancelables.registerClosable(operatorStateBackend); // restore if we have some old state if (null != restoreStateHandles) { operatorStateBackend.restore(restoreStateHandles); } return operatorStateBackend; }
@Override public void close() throws Exception { if (isCollectMetricEnabled()) { LongCounter rowCountAcc = new LongCounter(counter.getCount()); String rowCountAccName = ACCUMULATOR_PREFIX + getOperatorConfig().getVertexID(); getRuntimeContext().addAccumulator(rowCountAccName, rowCountAcc); } super.close(); closed = true; }
public <K> AbstractKeyedStateBackend<K> createKeyedStateBackend( TypeSerializer<K> keySerializer, int numberOfKeyGroups, KeyGroupRange keyGroupRange) throws Exception { if (keyedStateBackend != null) { throw new RuntimeException("The keyed state backend can only be created once."); } String operatorIdentifier = createOperatorIdentifier( headOperator, configuration.getVertexID()); keyedStateBackend = stateBackend.createKeyedStateBackend( getEnvironment(), getEnvironment().getJobID(), operatorIdentifier, keySerializer, numberOfKeyGroups, keyGroupRange, getEnvironment().getTaskKvStateRegistry()); // let keyed state backend participate in the operator lifecycle, i.e. make it responsive to cancelation cancelables.registerClosable(keyedStateBackend); // restore if we have some old state Collection<KeyedStateHandle> restoreKeyedStateHandles = restoreStateHandles == null ? null : restoreStateHandles.getManagedKeyedState(); keyedStateBackend.restore(restoreKeyedStateHandles); @SuppressWarnings("unchecked") AbstractKeyedStateBackend<K> typedBackend = (AbstractKeyedStateBackend<K>) keyedStateBackend; return typedBackend; }
collector, getExecutionConfig().getLatencyTrackingInterval(), getOperatorConfig().getVertexID(), getRuntimeContext().getIndexOfThisSubtask());