Package com.alibaba.otter.node.etl.select.exceptions

Examples of com.alibaba.otter.node.etl.select.exceptions.SelectException


        if (dbColumn == null) {
            // 可能存在ddl,重新reload一下table
            tableHolder.reload();
            dbColumn = tableHolder.getTable().findColumn(column.getName(), false);
            if (dbColumn == null) {
                throw new SelectException(String.format("not found column[%s] in table[%s]",
                    column.getName(),
                    tableHolder.getTable().toVerboseString()));
            }
        }
View Full Code Here


     * 构建filter 表达式
     */
    private String makeFilterExpression(Pipeline pipeline) {
        List<DataMediaPair> dataMediaPairs = pipeline.getPairs();
        if (dataMediaPairs.isEmpty()) {
            throw new SelectException("ERROR ## the pair is empty,the pipeline id = " + pipeline.getId());
        }

        Set<String> mediaNames = new HashSet<String>();
        for (DataMediaPair dataMediaPair : dataMediaPairs) {
            ModeValue namespaceMode = dataMediaPair.getSource().getNamespaceMode();
View Full Code Here

     * 构建filter 表达式
     */
    private String makeFilterExpression(Pipeline pipeline) {
        List<DataMediaPair> dataMediaPairs = pipeline.getPairs();
        if (dataMediaPairs.isEmpty()) {
            throw new SelectException("ERROR ## the pair is empty,the pipeline id = " + pipeline.getId());
        }

        Set<String> mediaNames = new HashSet<String>();
        for (DataMediaPair dataMediaPair : dataMediaPairs) {
            ModeValue namespaceMode = dataMediaPair.getSource().getNamespaceMode();
View Full Code Here

        });
    }

    private boolean processTermin(boolean lastStatus, Long batchId, Long processId) throws InterruptedException {
        int retry = 0;
        SelectException exception = null;
        TerminEventData terminData = null;
        while (retry++ < 30) {
            // 因为存在网络因素,而且在Load进行termin处理时,因为是异步处理,有一定的概率会出现termin不按顺序过来
            terminData = arbitrateEventService.terminEvent().await(pipelineId);
            Long terminBatchId = terminData.getBatchId();
            Long terminProcessId = terminData.getProcessId();

            if (terminBatchId == null && processId != -1L && !processId.equals(terminProcessId)) {
                // 针对manager发起rollback,terminBatchId可能为null,需要特殊处理下
                exception = new SelectException("unmatched processId, SelectTask batchId = " + batchId
                                                + " processId = " + processId + " and Termin Event: "
                                                + terminData.toString());
                Thread.sleep(1000); // sleep 1秒,等新的数据包
            } else if (terminBatchId != null && batchId != -1L && !batchId.equals(terminBatchId)) {
                exception = new SelectException("unmatched terminId, SelectTask batchId = " + batchId + " processId = "
                                                + processId + " and Termin Event: " + terminData.toString());
                Thread.sleep(1000); // sleep 1秒,等新的数据包
            } else {
                exception = null; // batchId/processId对上了,退出
                break;
            }
        }

        if (exception != null) {
            throw exception;
        }

        if (needCheck) {
            checkContinueWork();
        }

        boolean status = terminData.getType().isNormal();
        if (lastStatus == false && status == true) {
            // 上一批失败,这一批成功,说明调度有问题
            throw new SelectException(String.format("last status is rollback , but now [batchId:%d , processId:%d] is ack",
                batchId,
                terminData.getProcessId()));
        }

        if (terminData.getType().isNormal()) {
View Full Code Here

                        eventDatas.add(eventData);
                    }
                }
            }
        } catch (Exception e) {
            throw new SelectException(e);
        }

        return eventDatas;
    }
View Full Code Here

    private List<EventData> internParse(Pipeline pipeline, Entry entry) {
        RowChange rowChange = null;
        try {
            rowChange = RowChange.parseFrom(entry.getStoreValue());
        } catch (Exception e) {
            throw new SelectException("parser of canal-event has an error , data:" + entry.toString(), e);
        }

        if (rowChange == null) {
            return null;
        }
View Full Code Here

            // } else {
            // // 针对无主键,等同为所有都是主键进行处理
            // eventData.setKeys(columns);
            // }
        } else {
            throw new SelectException("this rowdata has no pks , entry: " + entry.toString() + " and rowData: "
                                      + rowData);
        }

        return eventData;
    }
View Full Code Here

        if (dbColumn == null) {
            // 可能存在ddl,重新reload一下table
            tableHolder.reload();
            dbColumn = tableHolder.getTable().findColumn(column.getName(), false);
            if (dbColumn == null) {
                throw new SelectException(String.format("not found column[%s] in table[%s]",
                    column.getName(),
                    tableHolder.getTable().toVerboseString()));
            }
        }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.node.etl.select.exceptions.SelectException

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.