@Override public long getBinlogPosition() { return this.client.getBinlogPosition(); }
private void logReaderState(Level severity) { final Object position = client == null ? "N/A" : client.getBinlogFilename() + "/" + client.getBinlogPosition(); final String message = "Error during binlog processing. Last offset stored = {}, binlog reader near position = {}"; switch (severity) { case WARN: logger.warn(message, lastOffset, position); break; case DEBUG: logger.debug(message, lastOffset, position); break; default: logger.error(message, lastOffset, position); } }
public BinlogPosition getCurrentBinlogPosition() { return new BinlogPosition(client.getBinlogFilename(), client.getBinlogPosition()); } }
private void ensureReplicatorThread() throws Exception { checkCommErrors(); if ( !client.isConnected() && !stopOnEOF ) { if (this.gtidPositioning) { // When using gtid positioning, reconnecting should take us to the top // of the gtid event. We throw away any binlog position we have // (other than GTID) and bail out of getTransactionRows() LOGGER.warn("replicator stopped at position: {} -- restarting", client.getGtidSet()); client.setBinlogFilename(""); client.setBinlogPosition(4L); client.connect(5000); throw new ClientReconnectedException(); } else { // standard binlog positioning is a lot easier; we can really reconnect anywhere // we like, so we don't have to bail out of the middle of an event. LOGGER.warn("replicator stopped at position: {} -- restarting", client.getBinlogFilename() + ":" + client.getBinlogPosition()); client.connect(5000); } } }