Package com.alibaba.otter.canal.protocol.CanalEntry

Examples of com.alibaba.otter.canal.protocol.CanalEntry.Column


            return false;
        }
        if ((bfColumns.size() - 1) < index) {
            return false;
        }
        Column column = bfColumns.get(index);

        if (column.getIsNull()) {
            if (newValue != null) {
                return true;
            }
        } else {
            if (newValue == null) {
                return true;
            } else {
                if (!column.getValue().equals(newValue)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here


            return false;
        }
        if ((bfColumns.size() - 1) < index) {
            return false;
        }
        Column column = bfColumns.get(index);

        if (column.getIsNull()) {
            if (newValue != null) {
                return true;
            }
        } else {
            if (newValue == null) {
                return true;
            } else {
                if (!column.getValue().equals(newValue)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

            return false;
        }
        if ((bfColumns.size() - 1) < index) {
            return false;
        }
        Column column = bfColumns.get(index);

        if (column.getIsNull()) {
            if (newValue != null) {
                return true;
            }
        } else {
            if (newValue == null) {
                return true;
            } else {
                if (!column.getValue().equals(newValue)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

     * </pre>
     */
    private int checkLoopback(Pipeline pipeline, RowData rowData) {
        // 检查channel_info字段
        // 首先检查下after记录,从无变有的过程,一般出现在事务头
        Column infokColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), pipeline.getParameters()
            .getSystemMarkTableInfo());

        // 匹配对应的channelInfo,如果以_SYNC结尾,则认为需要忽略
        if (infokColumn != null && StringUtils.endsWithIgnoreCase(infokColumn.getValue(), RETL_CLIENT_FLAG)) {
            return 1;
        }

        // 匹配对应的channelInfo,如果相同,则认为需要忽略,并返回2,代表需要进行回环补救check机制,因为这个变更也是otter系统产生的
        if (infokColumn != null
            && StringUtils.equalsIgnoreCase(infokColumn.getValue(), pipeline.getParameters().getChannelInfo())) {
            return 2;
        }

        infokColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), pipeline.getParameters()
            .getSystemMarkTableInfo());
        // 匹配对应的channelInfo,如果以_SYNC结尾,则认为需要忽略
        if (infokColumn != null && StringUtils.endsWithIgnoreCase(infokColumn.getValue(), RETL_CLIENT_FLAG)) {
            return 1;
        }

        // 匹配对应的channelInfo,如果相同,则认为需要忽略,并返回2,代表需要进行回环补救check机制,因为这个变更也是otter系统产生的
        if (infokColumn != null
            && StringUtils.equalsIgnoreCase(infokColumn.getValue(), pipeline.getParameters().getChannelInfo())) {
            return 2;
        }

        // 检查channel_id字段
        Column markColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), pipeline.getParameters()
            .getSystemMarkTableColumn());
        // 匹配对应的channel id
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        markColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), pipeline.getParameters()
            .getSystemMarkTableColumn());
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        return 0;
    }
View Full Code Here

     * 检查otter3.0的兼容表处理,主要部分业务使用了3.0的功能,需要考虑兼容支持,后续可删除
     */
    private int checkCompatibleLoopback(Pipeline pipeline, RowData rowData) {
        // 检查_info字段
        // 首先检查下after记录,从无变有的过程,一般出现在事务头
        Column infokColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), compatibleMarkInfoColumn);
        // 匹配对应的channel id
        if (infokColumn != null && infokColumn.getValue().toUpperCase().endsWith(RETL_CLIENT_FLAG)) {
            return 1;
        }

        infokColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), compatibleMarkInfoColumn);
        if (infokColumn != null && infokColumn.getValue().toUpperCase().endsWith(RETL_CLIENT_FLAG)) {
            return 1;
        }

        // 检查_id字段
        Column markColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), compatibleMarkIdentifierColumn);
        // 匹配对应的channel id
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        markColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), compatibleMarkIdentifierColumn);
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        return 0;
    }
View Full Code Here

            return false;
        }
        if ((bfColumns.size() - 1) < index) {
            return false;
        }
        Column column = bfColumns.get(index);

        if (column.getIsNull()) {
            if (newValue != null) {
                return true;
            }
        } else {
            if (newValue == null) {
                return true;
            } else {
                if (!column.getValue().equals(newValue)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

     * </pre>
     */
    private int checkLoopback(Pipeline pipeline, RowData rowData) {
        // 检查channel_info字段
        // 首先检查下after记录,从无变有的过程,一般出现在事务头
        Column infokColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(),
                                                 pipeline.getParameters().getSystemMarkTableInfo());

        // 匹配对应的channelInfo,如果以_SYNC结尾,则认为需要忽略
        if (infokColumn != null && StringUtils.endsWithIgnoreCase(infokColumn.getValue(), RETL_CLIENT_FLAG)) {
            return 1;
        }

        // 匹配对应的channelInfo,如果相同,则认为需要忽略,并返回2,代表需要进行回环补救check机制,因为这个变更也是otter系统产生的
        if (infokColumn != null
            && StringUtils.equalsIgnoreCase(infokColumn.getValue(), pipeline.getParameters().getChannelInfo())) {
            return 2;
        }

        infokColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(),
                                          pipeline.getParameters().getSystemMarkTableInfo());
        // 匹配对应的channelInfo,如果以_SYNC结尾,则认为需要忽略
        if (infokColumn != null && StringUtils.endsWithIgnoreCase(infokColumn.getValue(), RETL_CLIENT_FLAG)) {
            return 1;
        }

        // 匹配对应的channelInfo,如果相同,则认为需要忽略,并返回2,代表需要进行回环补救check机制,因为这个变更也是otter系统产生的
        if (infokColumn != null
            && StringUtils.equalsIgnoreCase(infokColumn.getValue(), pipeline.getParameters().getChannelInfo())) {
            return 2;
        }

        // 检查channel_id字段
        Column markColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(),
                                                pipeline.getParameters().getSystemMarkTableColumn());
        // 匹配对应的channel id
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        markColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(),
                                         pipeline.getParameters().getSystemMarkTableColumn());
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        return 0;
    }
View Full Code Here

     * 检查otter3.0的兼容表处理,主要部分业务使用了3.0的功能,需要考虑兼容支持,后续可删除
     */
    private int checkCompatibleLoopback(Pipeline pipeline, RowData rowData) {
        // 检查_info字段
        // 首先检查下after记录,从无变有的过程,一般出现在事务头
        Column infokColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), compatibleMarkInfoColumn);
        // 匹配对应的channel id
        if (infokColumn != null && infokColumn.getValue().toUpperCase().endsWith(RETL_CLIENT_FLAG)) {
            return 1;
        }

        infokColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), compatibleMarkInfoColumn);
        if (infokColumn != null && infokColumn.getValue().toUpperCase().endsWith(RETL_CLIENT_FLAG)) {
            return 1;
        }

        // 检查_id字段
        Column markColumn = getColumnIgnoreCase(rowData.getAfterColumnsList(), compatibleMarkIdentifierColumn);
        // 匹配对应的channel id
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        markColumn = getColumnIgnoreCase(rowData.getBeforeColumnsList(), compatibleMarkIdentifierColumn);
        if (markColumn != null && pipeline.getChannelId().equals(Long.parseLong(markColumn.getValue()))) {
            return 2;
        }

        return 0;
    }
View Full Code Here

            return false;
        }
        if ((bfColumns.size() - 1) < index) {
            return false;
        }
        Column column = bfColumns.get(index);

        if (column.getIsNull()) {
            if (newValue != null) {
                return true;
            }
        } else {
            if (newValue == null) {
                return true;
            } else {
                if (!column.getValue().equals(newValue)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

            return false;
        }
        if ((bfColumns.size() - 1) < index) {
            return false;
        }
        Column column = bfColumns.get(index);

        if (column.getIsNull()) {
            if (newValue != null) {
                return true;
            }
        } else {
            if (newValue == null) {
                return true;
            } else {
                if (!column.getValue().equals(newValue)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

TOP

Related Classes of com.alibaba.otter.canal.protocol.CanalEntry.Column

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.