本文整理了Java中org.apache.flink.runtime.execution.Environment.getAccumulatorRegistry()
方法的一些代码示例,展示了Environment.getAccumulatorRegistry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.getAccumulatorRegistry()
方法的具体详情如下:
包路径:org.apache.flink.runtime.execution.Environment
类名称:Environment
方法名:getAccumulatorRegistry
[英]Return the registry for accumulators which are periodically sent to the job manager.
[中]返回定期发送到作业管理器的累加器的注册表。
代码示例来源:origin: apache/flink
/**
* Constructor for initialization, possibly with initial state (recovery / savepoint / etc).
*
* <p>This constructor accepts a special {@link ProcessingTimeService}. By default (and if
* null is passes for the time provider) a {@link SystemProcessingTimeService DefaultTimerService}
* will be used.
*
* @param environment The task environment for this task.
* @param timeProvider Optionally, a specific time provider to use.
*/
protected StreamTask(
Environment environment,
@Nullable ProcessingTimeService timeProvider) {
super(environment);
this.timerService = timeProvider;
this.configuration = new StreamConfig(getTaskConfiguration());
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.recordWriters = createRecordWriters(configuration, environment);
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategy.
*/
private void initOutputs(ClassLoader cl) throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
this.output = BatchTask.initOutputs(this, cl, this.config, this.chainedTasks, this.eventualOutputs,
getExecutionConfig(), getEnvironment().getAccumulatorRegistry());
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategies for each writer.
*/
protected void initOutputs() throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
this.accumulatorRegistry = getEnvironment().getAccumulatorRegistry();
this.output = initOutputs(this, userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs,
this.getExecutionConfig(), this.accumulatorRegistry);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategy.
*/
private void initOutputs(ClassLoader cl) throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
this.output = BatchTask.initOutputs(this, cl, this.config, this.chainedTasks, this.eventualOutputs,
getExecutionConfig(), getEnvironment().getAccumulatorRegistry().getUserMap());
}
代码示例来源:origin: org.apache.flink/flink-runtime
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategy.
*/
private void initOutputs(ClassLoader cl) throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
this.output = BatchTask.initOutputs(this, cl, this.config, this.chainedTasks, this.eventualOutputs,
getExecutionConfig(), getEnvironment().getAccumulatorRegistry().getUserMap());
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategy.
*/
private void initOutputs(ClassLoader cl) throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
this.output = BatchTask.initOutputs(this, cl, this.config, this.chainedTasks, this.eventualOutputs,
getExecutionConfig(), getEnvironment().getAccumulatorRegistry().getUserMap());
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategies for each writer.
*/
protected void initOutputs() throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.output = initOutputs(this, userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs,
this.getExecutionConfig(), this.accumulatorMap);
}
代码示例来源:origin: org.apache.flink/flink-runtime
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategies for each writer.
*/
protected void initOutputs() throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.output = initOutputs(this, userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs,
this.getExecutionConfig(), this.accumulatorMap);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
/**
* Creates a writer for each output. Creates an OutputCollector which forwards its input to all writers.
* The output collector applies the configured shipping strategies for each writer.
*/
protected void initOutputs() throws Exception {
this.chainedTasks = new ArrayList<ChainedDriver<?, ?>>();
this.eventualOutputs = new ArrayList<RecordWriter<?>>();
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.output = initOutputs(this, userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs,
this.getExecutionConfig(), this.accumulatorMap);
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
String sourceName = getEnvironment().getTaskInfo().getTaskName().split("->")[0].trim();
sourceName = sourceName.startsWith("CHAIN") ? sourceName.substring(6) : sourceName;
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry(),
getEnvironment().getMetricGroup().addOperator(sourceName));
}
}
代码示例来源:origin: org.apache.flink/flink-streaming-java_2.11
/**
* Constructor for initialization, possibly with initial state (recovery / savepoint / etc).
*
* <p>This constructor accepts a special {@link ProcessingTimeService}. By default (and if
* null is passes for the time provider) a {@link SystemProcessingTimeService DefaultTimerService}
* will be used.
*
* @param environment The task environment for this task.
* @param timeProvider Optionally, a specific time provider to use.
*/
protected StreamTask(
Environment environment,
@Nullable ProcessingTimeService timeProvider) {
super(environment);
this.timerService = timeProvider;
this.configuration = new StreamConfig(getTaskConfiguration());
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.streamRecordWriters = createStreamRecordWriters(configuration, environment);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
String sourceName = getEnvironment().getTaskInfo().getTaskName().split("->")[0].trim();
sourceName = sourceName.startsWith("CHAIN") ? sourceName.substring(6) : sourceName;
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry().getUserMap(),
getEnvironment().getMetricGroup().getOrAddOperator(sourceName));
}
}
代码示例来源:origin: org.apache.flink/flink-streaming-java
/**
* Constructor for initialization, possibly with initial state (recovery / savepoint / etc).
*
* <p>This constructor accepts a special {@link ProcessingTimeService}. By default (and if
* null is passes for the time provider) a {@link SystemProcessingTimeService DefaultTimerService}
* will be used.
*
* @param environment The task environment for this task.
* @param timeProvider Optionally, a specific time provider to use.
*/
protected StreamTask(
Environment environment,
@Nullable ProcessingTimeService timeProvider) {
super(environment);
this.timerService = timeProvider;
this.configuration = new StreamConfig(getTaskConfiguration());
this.accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
this.streamRecordWriters = createStreamRecordWriters(configuration, environment);
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
String sourceName = getEnvironment().getTaskInfo().getTaskName().split("->")[0].trim();
sourceName = sourceName.startsWith("CHAIN") ? sourceName.substring(6) : sourceName;
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry().getUserMap(),
getEnvironment().getMetricGroup().addOperator(sourceName));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
String sourceName = getEnvironment().getTaskInfo().getTaskName().split("->")[0].trim();
sourceName = sourceName.startsWith("CHAIN") ? sourceName.substring(6) : sourceName;
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry().getUserMap(),
getEnvironment().getMetricGroup().getOrAddOperator(sourceName));
}
}
代码示例来源:origin: com.alibaba.blink/flink-runtime
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry(),
getEnvironment().getMetricGroup().addOperator(getEnvironment().getTaskInfo().getTaskName()));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.11
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry().getUserMap(),
getEnvironment().getMetricGroup().getOrAddOperator(getEnvironment().getTaskInfo().getTaskName()));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry().getUserMap(),
getEnvironment().getMetricGroup().getOrAddOperator(getEnvironment().getTaskInfo().getTaskName()));
}
}
代码示例来源:origin: org.apache.flink/flink-runtime_2.10
public DistributedRuntimeUDFContext createRuntimeContext() {
Environment env = getEnvironment();
return new DistributedRuntimeUDFContext(env.getTaskInfo(), getUserCodeClassLoader(),
getExecutionConfig(), env.getDistributedCacheEntries(), env.getAccumulatorRegistry().getUserMap(),
getEnvironment().getMetricGroup().addOperator(getEnvironment().getTaskInfo().getTaskName()));
}
}
代码示例来源:origin: org.apache.flink/flink-streaming-java_2.10
accumulatorMap = getEnvironment().getAccumulatorRegistry().getUserMap();
内容来源于网络,如有侵权,请联系作者删除!