本文整理汇总了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;
}
示例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;
}
示例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);
}
}