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

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


                rowChage = RowChange.parseFrom(entry.getStoreValue());
            } catch (Exception e) {
                throw new RuntimeException("parse event has an error , data:" + entry.toString(), e);
            }

            EventType eventType = rowChage.getEventType();
            long executeTime = entry.getHeader().getExecuteTime();
            long delayTime = new Date().getTime() - executeTime;
            logger.info(row_format, new Object[] { entry.getHeader().getLogfileName(),
                    String.valueOf(entry.getHeader().getLogfileOffset()), entry.getHeader().getSchemaName(),
                    entry.getHeader().getTableName(), eventType, String.valueOf(entry.getHeader().getExecuteTime()),
View Full Code Here


            if (nameFilter != null && !nameFilter.filter(fullname)) { // check
                                                                      // name
                                                                      // filter
                return null;
            }
            EventType eventType = null;
            int type = event.getHeader().getType();
            if (LogEvent.WRITE_ROWS_EVENT_V1 == type || LogEvent.WRITE_ROWS_EVENT == type) {
                eventType = EventType.INSERT;
            } else if (LogEvent.UPDATE_ROWS_EVENT_V1 == type || LogEvent.UPDATE_ROWS_EVENT == type) {
                eventType = EventType.UPDATE;
View Full Code Here

            String fullname = getSchemaNameAndTableName(table);
            if (nameFilter != null && !nameFilter.filter(fullname)) { // check name filter
                return null;
            }
            EventType eventType = null;
            int type = event.getHeader().getType();
            if (LogEvent.WRITE_ROWS_EVENT_V1 == type || LogEvent.WRITE_ROWS_EVENT == type) {
                eventType = EventType.INSERT;
            } else if (LogEvent.UPDATE_ROWS_EVENT_V1 == type || LogEvent.UPDATE_ROWS_EVENT == type) {
                eventType = EventType.UPDATE;
View Full Code Here

            Header header = createHeader(binlogFileName, event.getHeader(), table.getDbName(), table.getTableName());
            RowChange.Builder rowChangeBuider = RowChange.newBuilder();
            rowChangeBuider.setTableId(event.getTableId());
            rowChangeBuider.setIsDdl(false);
            EventType eventType = null;
            if (LogEvent.WRITE_ROWS_EVENT == event.getHeader().getType()) {
                eventType = EventType.INSERT;
            } else if (LogEvent.UPDATE_ROWS_EVENT == event.getHeader().getType()) {
                eventType = EventType.UPDATE;
            } else if (LogEvent.DELETE_ROWS_EVENT == event.getHeader().getType()) {
View Full Code Here

                    rowChage = RowChange.parseFrom(entry.getStoreValue());
                } catch (Exception e) {
                    throw new RuntimeException("parse event has an error , data:" + entry.toString(), e);
                }

                EventType eventType = rowChage.getEventType();

                logger.info(row_format,
                    new Object[] { entry.getHeader().getLogfileName(),
                            String.valueOf(entry.getHeader().getLogfileOffset()), entry.getHeader().getSchemaName(),
                            entry.getHeader().getTableName(), eventType,
View Full Code Here

                rowChage = RowChange.parseFrom(entry.getStoreValue());
            } catch (Exception e) {
                throw new RuntimeException("parse event has an error , data:" + entry.toString(), e);
            }

            EventType eventType = rowChage.getEventType();

            logger.info(row_format,
                new Object[] { entry.getHeader().getLogfileName(),
                        String.valueOf(entry.getHeader().getLogfileOffset()), entry.getHeader().getSchemaName(),
                        entry.getHeader().getTableName(), eventType,
View Full Code Here

            Header header = createHeader(binlogFileName, event.getHeader(), table.getDbName(), table.getTableName());
            RowChange.Builder rowChangeBuider = RowChange.newBuilder();
            rowChangeBuider.setTableId(event.getTableId());
            rowChangeBuider.setIsDdl(false);
            EventType eventType = null;
            if (LogEvent.WRITE_ROWS_EVENT == event.getHeader().getType()) {
                eventType = EventType.INSERT;
            } else if (LogEvent.UPDATE_ROWS_EVENT == event.getHeader().getType()) {
                eventType = EventType.UPDATE;
            } else if (LogEvent.DELETE_ROWS_EVENT == event.getHeader().getType()) {
View Full Code Here

                rowChage = RowChange.parseFrom(entry.getStoreValue());
            } catch (Exception e) {
                throw new RuntimeException("parse event has an error , data:" + entry.toString(), e);
            }

            EventType eventType = rowChage.getEventType();
            long executeTime = entry.getHeader().getExecuteTime();
            long delayTime = new Date().getTime() - executeTime;
            logger.info(row_format, new Object[] { entry.getHeader().getLogfileName(),
                    String.valueOf(entry.getHeader().getLogfileOffset()), entry.getHeader().getSchemaName(),
                    entry.getHeader().getTableName(), eventType, String.valueOf(entry.getHeader().getExecuteTime()),
View Full Code Here

                    // 如果无法解析正确的表信息,则根据schema进行清除
                    tableMetaCache.clearTableMetaWithSchemaName(schemaName);
                }
            }

            EventType type = EventType.QUERY;
            // fixed issue https://github.com/alibaba/canal/issues/58
            if (result.getType() == EventType.ALTER || result.getType() == EventType.ERASE
                || result.getType() == EventType.CREATE) { //针对DDL类型
                type = result.getType();
                if (StringUtils.isNotEmpty(tableName)) {
View Full Code Here

            String fullname = getSchemaNameAndTableName(table);
            // check name filter
            if (nameFilter != null && !nameFilter.filter(fullname)) {
                return null;
            }
            EventType eventType = null;
            int type = event.getHeader().getType();
            if (LogEvent.WRITE_ROWS_EVENT_V1 == type || LogEvent.WRITE_ROWS_EVENT == type) {
                eventType = EventType.INSERT;
            } else if (LogEvent.UPDATE_ROWS_EVENT_V1 == type || LogEvent.UPDATE_ROWS_EVENT == type) {
                eventType = EventType.UPDATE;
View Full Code Here

TOP

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

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.