本文整理了Java中com.github.shyiko.mysql.binlog.BinaryLogClient.isConnected()
方法的一些代码示例,展示了BinaryLogClient.isConnected()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BinaryLogClient.isConnected()
方法的具体详情如下:
包路径:com.github.shyiko.mysql.binlog.BinaryLogClient
类名称:BinaryLogClient
方法名:isConnected
暂无
代码示例来源:origin: debezium/debezium
@Override
public boolean isConnected() {
return this.client.isConnected();
}
代码示例来源:origin: debezium/debezium
@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);
}
}
代码示例来源:origin: apache/rocketmq-externals
private void checkConnection() throws Exception {
if (!binaryLogClient.isConnected()) {
BinlogPosition binlogPosition = replicator.getNextBinlogPosition();
if (binlogPosition != null) {
binaryLogClient.setBinlogFilename(binlogPosition.getBinlogFilename());
binaryLogClient.setBinlogPosition(binlogPosition.getPosition());
}
binaryLogClient.connect(3000);
}
}
代码示例来源:origin: apache/nifi
if (!binlogClient.isConnected()) {
binlogClient.disconnect();
binlogClient = null;
代码示例来源:origin: zendesk/maxwell
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);
}
}
}
代码示例来源:origin: shyiko/mysql-binlog-connector-java
throw e;
if (isConnected()) {
for (LifecycleListener lifecycleListener : lifecycleListeners) {
lifecycleListener.onEventDeserializationFailure(this, e);
if (isConnected()) {
eventLastSeen = System.currentTimeMillis();
updateGtidSet(event);
if (isConnected()) {
for (LifecycleListener lifecycleListener : lifecycleListeners) {
lifecycleListener.onCommunicationFailure(this, e);
if (isConnected()) {
if (completeShutdown) {
代码示例来源:origin: apache/nifi
if (!binlogClient.isConnected()) {
Exception e = lifecycleListener.getException();
代码示例来源:origin: zendesk/maxwell
if ( client.isConnected() )
continue;
else
代码示例来源:origin: mysql-time-machine/replicator
@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);
}
}
}
代码示例来源:origin: org.apache.nifi/nifi-cdc-mysql-processors
if (!binlogClient.isConnected()) {
binlogClient.disconnect();
binlogClient = null;
代码示例来源:origin: mysql-time-machine/replicator
@Override
public void connect(Checkpoint checkpoint) {
if (this.client == null || !this.client.isConnected()) {
this.executor.submit(() -> {
for (String hostname : this.hostname) {
代码示例来源:origin: org.apache.nifi/nifi-cdc-mysql-processors
if (!binlogClient.isConnected()) {
Exception e = lifecycleListener.getException();
内容来源于网络,如有侵权,请联系作者删除!