com.github.shyiko.mysql.binlog.BinaryLogClient.setKeepAlive()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(337)

本文整理了Java中com.github.shyiko.mysql.binlog.BinaryLogClient.setKeepAlive()方法的一些代码示例,展示了BinaryLogClient.setKeepAlive()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BinaryLogClient.setKeepAlive()方法的具体详情如下:
包路径:com.github.shyiko.mysql.binlog.BinaryLogClient
类名称:BinaryLogClient
方法名:setKeepAlive

BinaryLogClient.setKeepAlive介绍

暂无

代码示例

代码示例来源:origin: zendesk/maxwell

this.client.setKeepAlive(false);

代码示例来源:origin: debezium/debezium

client.setServerId(serverId);
client.setSSLMode(sslModeFor(connectionContext.sslMode()));
client.setKeepAlive(context.config().getBoolean(MySqlConnectorConfig.KEEP_ALIVE));
client.setKeepAliveInterval(context.config().getLong(MySqlConnectorConfig.KEEP_ALIVE_INTERVAL_MS));
client.registerEventListener(context.bufferSizeForBinlogReader() == 0

代码示例来源:origin: debezium/debezium

protected void startClient(Consumer<BinaryLogClient> preConnect) throws IOException, TimeoutException, SQLException {
  // Connect the bin log client ...
  counters = new EventQueue(DEFAULT_TIMEOUT, this::logConsumedEvent, this::logIgnoredEvent);
  client = new BinaryLogClient(config.getHostname(), config.getPort(), "replicator", "replpass");
  client.setServerId(client.getServerId() - 1); // avoid clashes between BinaryLogClient instances
  client.setKeepAlive(false);
  client.setSSLMode(SSLMode.DISABLED);
  client.registerEventListener(counters);
  client.registerEventListener(this::recordEvent);
  client.registerLifecycleListener(new TraceLifecycleListener());
  EventDeserializer eventDeserializer = new EventDeserializer();
  eventDeserializer.setEventDataDeserializer(EventType.STOP, new StopEventDataDeserializer());
  client.setEventDeserializer(eventDeserializer);
  if (preConnect != null) preConnect.accept(client);
  client.connect(DEFAULT_TIMEOUT); // does not block
  // Set up the table as one transaction and wait to see the events ...
  conn.execute("DROP TABLE IF EXISTS person",
         "CREATE TABLE person (" +
             "  name VARCHAR(255) primary key," +
             "  age INTEGER NULL DEFAULT 10," +
             "  createdAt DATETIME NULL DEFAULT CURRENT_TIMESTAMP," +
             "  updatedAt DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" +
             ")");
  counters.consume(2, EventType.QUERY);
  counters.reset();
}

代码示例来源:origin: io.debezium/debezium-connector-mysql

protected void startClient(Consumer<BinaryLogClient> preConnect) throws IOException, TimeoutException, SQLException {
  // Connect the bin log client ...
  counters = new EventQueue(DEFAULT_TIMEOUT, this::logConsumedEvent, this::logIgnoredEvent);
  client = new BinaryLogClient(config.getHostname(), config.getPort(), "replicator", "replpass");
  client.setServerId(client.getServerId() - 1); // avoid clashes between BinaryLogClient instances
  client.setKeepAlive(false);
  client.setSSLMode(SSLMode.DISABLED);
  client.registerEventListener(counters);
  client.registerEventListener(this::recordEvent);
  client.registerLifecycleListener(new TraceLifecycleListener());
  EventDeserializer eventDeserializer = new EventDeserializer();
  eventDeserializer.setEventDataDeserializer(EventType.STOP, new StopEventDataDeserializer());
  client.setEventDeserializer(eventDeserializer);
  if (preConnect != null) preConnect.accept(client);
  client.connect(DEFAULT_TIMEOUT); // does not block
  // Set up the table as one transaction and wait to see the events ...
  conn.execute("DROP TABLE IF EXISTS person",
         "CREATE TABLE person (" +
             "  name VARCHAR(255) primary key," +
             "  age INTEGER NULL DEFAULT 10," +
             "  createdAt DATETIME NULL DEFAULT CURRENT_TIMESTAMP," +
             "  updatedAt DATETIME NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" +
             ")");
  counters.consume(2, EventType.QUERY);
  counters.reset();
}

相关文章