Package com.alibaba.otter.node.etl.load.loader

Examples of com.alibaba.otter.node.etl.load.loader.LoadContext


        if (index < futures.size()) {// 小于代表有错误,需要对未完成的记录进行cancel操作,对已完成的结果进行收集,做重复录入过滤记录
            for (int errorIndex = 0; errorIndex < futures.size(); errorIndex++) {
                Future future = futures.get(errorIndex);
                if (future.isDone()) {
                    try {
                        LoadContext loadContext = (LoadContext) future.get();

                        if (loadContext instanceof DbLoadContext) {
                            dbInterceptor.error((DbLoadContext) loadContext);// 做一下出错处理,记录到store中
                        }
                    } catch (InterruptedException e) {
                        // ignore
                    } catch (ExecutionException e) {
                        // ignore
                    } catch (Exception e) {
                        logger.error("interceptor process error failed", e);
                    }

                } else {
                    future.cancel(true); // 对未完成的进行取消
                }
            }
        } else {
            for (int i = 0; i < futures.size(); i++) {// 收集一下正确处理完成的结果
                Future future = futures.get(i);
                try {
                    LoadContext loadContext = (LoadContext) future.get();

                    if (loadContext instanceof DbLoadContext) {
                        processedContexts.add((DbLoadContext) loadContext);
                    }
                } catch (InterruptedException e) {
View Full Code Here

TOP

Related Classes of com.alibaba.otter.node.etl.load.loader.LoadContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.