com.github.shyiko.mysql.binlog.event.EventHeaderV4 Java Examples
The following examples show how to use
com.github.shyiko.mysql.binlog.event.EventHeaderV4.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EventProcessor.java From openmessaging-connect-odar with Apache License 2.0 | 6 votes |
private void processXidEvent(Event event) { EventHeaderV4 header = event.getHeader(); XidEventData data = event.getData(); String binlogFilename = binaryLogClient.getBinlogFilename(); Long position = header.getNextPosition(); Long xid = data.getXid(); BinlogPosition binlogPosition = new BinlogPosition(binlogFilename, position); transaction.setNextBinlogPosition(binlogPosition); transaction.setXid(xid); replicator.commit(transaction, true); transaction = new Transaction(config); }
Example #2
Source File: BinaryLogConnectorSource.java From SpinalTap with Apache License 2.0 | 6 votes |
public void onEvent(Event event) { Preconditions.checkState(isStarted(), "Source is not started and should not process events"); final EventHeaderV4 header = event.getHeader(); final BinlogFilePos filePos = new BinlogFilePos( binlogClient.getBinlogFilename(), header.getPosition(), header.getNextPosition(), binlogClient.getGtidSet(), serverUUID); BinaryLogConnectorEventMapper.INSTANCE .map(event, filePos) .ifPresent(BinaryLogConnectorSource.super::processEvent); }
Example #3
Source File: DataId.java From syncer with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * <a href="https://github.com/shyiko/mysql-binlog-connector-java/issues/200">binlog table * map</a> */ static BinlogDataId fromEvent(Event[] event, String binlogFileName) { EventHeaderV4 tableMap = event[0].getHeader(); EventHeaderV4 second = event[1].getHeader(); // have to remember table map event for restart // have to add data event position for unique id: // because one table map event may follow multiple data event return new BinlogDataId(binlogFileName, tableMap.getPosition(), second.getPosition()); }
Example #4
Source File: BinaryLogConsumer.java From datacollector with Apache License 2.0 | 5 votes |
private SourceOffset createOffset(Event event) { if (isGtidEnabled()) { return new GtidSourceOffset(currentGtidSet) .withIncompleteTransaction(currentTxGtid, currentTxEventSeqNo); } else { return new BinLogPositionSourceOffset( currentBinLogFileName, ((EventHeaderV4) event.getHeader()).getNextPosition() ); } }
Example #5
Source File: BinaryLogConsumer.java From datacollector with Apache License 2.0 | 5 votes |
private SourceOffset createOffset(Event event) { if (isGtidEnabled()) { return new GtidSourceOffset(currentGtidSet) .withIncompleteTransaction(currentTxGtid, currentTxEventSeqNo); } else { return new BinLogPositionSourceOffset( currentBinLogFileName, ((EventHeaderV4) event.getHeader()).getNextPosition() ); } }