本文整理汇总了Java中org.apache.flink.runtime.operators.chaining.ChainedDriver类的典型用法代码示例。如果您正苦于以下问题:Java ChainedDriver类的具体用法?Java ChainedDriver怎么用?Java ChainedDriver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChainedDriver类属于org.apache.flink.runtime.operators.chaining包,在下文中一共展示了ChainedDriver类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initOutputs
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* 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);
}
示例2: openChainedTasks
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* Opens all chained tasks, in the order as they are stored in the array. The opening process
* creates a standardized log info message.
*
* @param tasks The tasks to be opened.
* @param parent The parent task, used to obtain parameters to include in the log message.
* @throws Exception Thrown, if the opening encounters an exception.
*/
public static void openChainedTasks(List<ChainedDriver<?, ?>> tasks, AbstractInvokable parent) throws Exception {
// start all chained tasks
for (int i = 0; i < tasks.size(); i++) {
final ChainedDriver<?, ?> task = tasks.get(i);
if (LOG.isDebugEnabled()) {
LOG.debug(constructLogString("Start task code", task.getTaskName(), parent));
}
task.openTask();
}
}
示例3: closeChainedTasks
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* Closes all chained tasks, in the order as they are stored in the array. The closing process
* creates a standardized log info message.
*
* @param tasks The tasks to be closed.
* @param parent The parent task, used to obtain parameters to include in the log message.
* @throws Exception Thrown, if the closing encounters an exception.
*/
public static void closeChainedTasks(List<ChainedDriver<?, ?>> tasks, AbstractInvokable parent) throws Exception {
for (int i = 0; i < tasks.size(); i++) {
final ChainedDriver<?, ?> task = tasks.get(i);
task.closeTask();
if (LOG.isDebugEnabled()) {
LOG.debug(constructLogString("Finished task code", task.getTaskName(), parent));
}
}
}
示例4: cancelChainedTasks
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* Cancels all tasks via their {@link ChainedDriver#cancelTask()} method. Any occurring exception
* and error is suppressed, such that the canceling method of every task is invoked in all cases.
*
* @param tasks The tasks to be canceled.
*/
public static void cancelChainedTasks(List<ChainedDriver<?, ?>> tasks) {
for (int i = 0; i < tasks.size(); i++) {
try {
tasks.get(i).cancelTask();
} catch (Throwable t) {
// do nothing
}
}
}
示例5: addChainedTask
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
public void addChainedTask(@SuppressWarnings("rawtypes") Class<? extends ChainedDriver> chainedTaskClass, TaskConfig conf, String taskName)
{
int numChainedYet = this.config.getInteger(CHAINING_NUM_STUBS, 0);
this.config.setString(CHAINING_TASK_PREFIX + numChainedYet, chainedTaskClass.getName());
this.config.addAll(conf.config, CHAINING_TASKCONFIG_PREFIX + numChainedYet + SEPARATOR);
this.config.setString(CHAINING_TASKNAME_PREFIX + numChainedYet, taskName);
this.config.setInteger(CHAINING_NUM_STUBS, ++numChainedYet);
}
示例6: getChainedTask
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
public Class<? extends ChainedDriver<?, ?>> getChainedTask(int chainPos) {
final String className = this.config.getString(CHAINING_TASK_PREFIX + chainPos, null);
if (className == null) {
throw new IllegalStateException("Chained Task Class missing");
}
@SuppressWarnings("unchecked")
final Class<ChainedDriver<?, ?>> clazz = (Class<ChainedDriver<?, ?>>) (Class<?>) ChainedDriver.class;
try {
return Class.forName(className).asSubclass(clazz);
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
示例7: initOutputs
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* 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());
}
示例8: TaskInChain
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
TaskInChain(PlanNode planNode, Class<? extends ChainedDriver<?, ?>> chainedTask,
TaskConfig taskConfig, String taskName) {
this.planNode = planNode;
this.chainedTask = chainedTask;
this.taskConfig = taskConfig;
this.taskName = taskName;
}
示例9: initOutputs
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* 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<BufferWriter>();
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
this.output = initOutputs(this, userCodeClassLoader, this.config, this.chainedTasks, this.eventualOutputs);
}
示例10: cancelChainedTasks
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* Cancels all tasks via their {@link ChainedDriver#cancelTask()} method. Any occurring exception
* and error is suppressed, such that the canceling method of every task is invoked in all cases.
*
* @param tasks The tasks to be canceled.
*/
public static void cancelChainedTasks(List<ChainedDriver<?, ?>> tasks) {
for (int i = 0; i < tasks.size(); i++) {
try {
tasks.get(i).cancelTask();
} catch (Throwable t) {}
}
}
示例11: getChainedTask
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
public Class<? extends ChainedDriver<?, ?>> getChainedTask() {
return this.chainedTask;
}
示例12: TaskInChain
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
TaskInChain(Class<? extends ChainedDriver<?, ?>> chainedTask, TaskConfig taskConfig,
String taskName) {
this.chainedTask = chainedTask;
this.taskConfig = taskConfig;
this.taskName = taskName;
}
示例13: initOutputs
import org.apache.flink.runtime.operators.chaining.ChainedDriver; //导入依赖的package包/类
/**
* 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<BufferWriter>();
this.output = RegularPactTask.initOutputs(this, cl, this.config, this.chainedTasks, this.eventualOutputs);
}