@Override protected void beforeStop() throws Exception { this.binlogEventListener.stop(); this.client.disconnect(); }
if (isConnected()) { if (completeShutdown) { disconnect(); // initiate complete shutdown sequence (which includes keep alive thread) } else { disconnectChannel();
@Override public void onCommunicationFailure(BinaryLogClient client, Exception ex) { logger.debug("A communication failure event arrived", ex); logReaderState(); try { // Stop BinaryLogClient background threads client.disconnect(); } catch (final Exception e) { logger.debug("Exception while closing client", e); } BinlogReader.this.failed(ex); }
@Override protected void doStop() { try { if (client.isConnected()) { logger.debug("Stopping binlog reader '{}', last recorded offset: {}", this.name(), lastOffset); client.disconnect(); } cleanupResources(); } catch (IOException e) { logger.error("Unexpected error when disconnecting from the MySQL binary log reader '{}'", this.name(), e); } }
protected void stop(StateManager stateManager) throws CDCException { try { if (binlogClient != null) { binlogClient.disconnect(); } if (eventListener != null) { eventListener.stop(); if (binlogClient != null) { binlogClient.unregisterEventListener(eventListener); } } doStop.set(true); if (hasRun.getAndSet(false)) { updateState(stateManager, currentBinlogFile, currentBinlogPosition, currentSequenceId.get()); } currentBinlogPosition = -1; } catch (IOException e) { throw new CDCException("Error closing CDC connection", e); } finally { binlogClient = null; if (jdbcConnectionHolder != null) { jdbcConnectionHolder.close(); } } }
protected void rewindBinaryLogClient(BinlogPosition position) { try { if (isRunning()) { logger.debug("Rewinding binlog to position {}", position); client.disconnect(); client.setBinlogFilename(position.getFilename()); client.setBinlogPosition(position.getPosition()); client.connect(); } } catch (IOException e) { logger.error("Unexpected error when re-connecting to the MySQL binary log reader", e); } }
@After public void afterEach() throws IOException, SQLException { events.clear(); try { if (client != null) client.disconnect(); } finally { client = null; try { if (conn != null) conn.close(); } finally { conn = null; } } }
binlogClient.disconnect(); binlogClient = null; throw new IOException("Could not connect binlog client to any of the specified hosts due to: " + lastConnectException.getMessage(), lastConnectException); binlogClient.disconnect(); binlogClient = null; throw new IOException("Error creating binlog enrichment JDBC connection to any of the specified hosts", e);
if ( stopOnEOF && event.getPosition().getOffset() > 0 ) { this.binlogEventListener.mustStop.set(true); this.client.disconnect(); this.hitEOF = true; return null;
public void stop() { try { client.disconnect(); } catch (IOException e) { logger.error("Cannot stop the MySqlBinaryLogClient", e); } }
public void stop() { try { if (client!=null) { client.disconnect(); } } catch (IOException e) { logger.error("Cannot stop the MySqlBinaryLogClient", e); } }
public void stop() { if (running.compareAndSet(true, false)) { try { client.disconnect(); } catch (IOException error) { LOGGER.warn("Can't disconnect from MySQL as a slave!", error); } } } }
public void stop() { if (running.compareAndSet(true, false)) { try { client.disconnect(); } catch (IOException error) { LOGGER.warn("Can't disconnect from MySQL as a slave!", error); } } } }
@Override public void disconnect() { if (this.client != null && this.client.isConnected()) { try { this.client.disconnect(); this.client = null; } catch (IOException exception) { BinaryLogSupplier.LOG.log(Level.SEVERE, "error disconnecting", exception); } } }
protected void stop(StateManager stateManager) throws CDCException { try { if (binlogClient != null) { binlogClient.disconnect(); } if (eventListener != null) { eventListener.stop(); if (binlogClient != null) { binlogClient.unregisterEventListener(eventListener); } } doStop.set(true); if (hasRun.getAndSet(false)) { updateState(stateManager, currentBinlogFile, currentBinlogPosition, currentSequenceId.get()); } currentBinlogPosition = -1; } catch (IOException e) { throw new CDCException("Error closing CDC connection", e); } finally { binlogClient = null; } }
@After public void afterEach() throws IOException, SQLException { events.clear(); try { if (client != null) client.disconnect(); } finally { client = null; try { if (conn != null) conn.close(); } finally { conn = null; } } }
binlogClient.disconnect(); binlogClient = null; throw new IOException("Could not connect binlog client to any of the specified hosts due to: " + lastConnectException.getMessage(), lastConnectException); jdbcConnection = getJdbcConnection(driverLocation, driverName, connectedHost, username, password, null); } catch (InitializationException | SQLException e) { binlogClient.disconnect(); binlogClient = null; throw new IOException("Error creating binlog enrichment JDBC connection to any of the specified hosts", e);