当前位置: 首页>>代码示例>>Java>>正文


Java ExceptionInChainedStubException类代码示例

本文整理汇总了Java中org.apache.flink.runtime.operators.chaining.ExceptionInChainedStubException的典型用法代码示例。如果您正苦于以下问题:Java ExceptionInChainedStubException类的具体用法?Java ExceptionInChainedStubException怎么用?Java ExceptionInChainedStubException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExceptionInChainedStubException类属于org.apache.flink.runtime.operators.chaining包,在下文中一共展示了ExceptionInChainedStubException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: logAndThrowException

import org.apache.flink.runtime.operators.chaining.ExceptionInChainedStubException; //导入依赖的package包/类
/**
 * Prints an error message and throws the given exception. If the exception is of the type
 * {@link ExceptionInChainedStubException} then the chain of contained exceptions is followed
 * until an exception of a different type is found.
 *
 * @param ex The exception to be thrown.
 * @param parent The parent task, whose information is included in the log message.
 * @throws Exception Always thrown.
 */
public static void logAndThrowException(Exception ex, AbstractInvokable parent) throws Exception {
	String taskName;
	if (ex instanceof ExceptionInChainedStubException) {
		do {
			ExceptionInChainedStubException cex = (ExceptionInChainedStubException) ex;
			taskName = cex.getTaskName();
			ex = cex.getWrappedException();
		} while (ex instanceof ExceptionInChainedStubException);
	} else {
		taskName = parent.getEnvironment().getTaskInfo().getTaskName();
	}

	if (LOG.isErrorEnabled()) {
		LOG.error(constructLogString("Error in task code", taskName, parent), ex);
	}

	throw ex;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:28,代码来源:BatchTask.java

示例2: logAndThrowException

import org.apache.flink.runtime.operators.chaining.ExceptionInChainedStubException; //导入依赖的package包/类
/**
 * Prints an error message and throws the given exception. If the exception is of the type
 * {@link ExceptionInChainedStubException} then the chain of contained exceptions is followed
 * until an exception of a different type is found.
 *
 * @param ex The exception to be thrown.
 * @param parent The parent task, whose information is included in the log message.
 * @throws Exception Always thrown.
 */
public static void logAndThrowException(Exception ex, AbstractInvokable parent) throws Exception {
	String taskName;
	if (ex instanceof ExceptionInChainedStubException) {
		do {
			ExceptionInChainedStubException cex = (ExceptionInChainedStubException) ex;
			taskName = cex.getTaskName();
			ex = cex.getWrappedException();
		} while (ex instanceof ExceptionInChainedStubException);
	} else {
		taskName = parent.getEnvironment().getTaskName();
	}

	if (LOG.isErrorEnabled()) {
		LOG.error(constructLogString("Error in task code", taskName, parent), ex);
	}

	throw ex;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:28,代码来源:RegularPactTask.java

示例3: collect

import org.apache.flink.runtime.operators.chaining.ExceptionInChainedStubException; //导入依赖的package包/类
@Override
public void collect(IT record) {
	try {
		this.numRecordsIn.inc();
		this.outputCollector.collect(record);
	} catch (Exception ex) {
		throw new ExceptionInChainedStubException(this.taskName, ex);
	}
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:10,代码来源:NoOpChainedDriver.java


注:本文中的org.apache.flink.runtime.operators.chaining.ExceptionInChainedStubException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。