当前位置: 首页>>代码示例>>Java>>正文


Java BinaryLogClient.setBinlogPosition方法代码示例

本文整理汇总了Java中com.github.shyiko.mysql.binlog.BinaryLogClient.setBinlogPosition方法的典型用法代码示例。如果您正苦于以下问题:Java BinaryLogClient.setBinlogPosition方法的具体用法?Java BinaryLogClient.setBinlogPosition怎么用?Java BinaryLogClient.setBinlogPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.shyiko.mysql.binlog.BinaryLogClient的用法示例。


在下文中一共展示了BinaryLogClient.setBinlogPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import com.github.shyiko.mysql.binlog.BinaryLogClient; //导入方法依赖的package包/类
@Override
public void run() {
	client = new BinaryLogClient(host, port, user, password);
	// TODO: GTID support
	client.setBinlogFilename(position.getFilename());
	client.setBinlogPosition(position.getOffset());
	client.registerEventListener(this);
	try {
		client.connect();
	} catch (IOException e) {
		e.printStackTrace();
		System.exit(1);
	}
}
 
开发者ID:frew,项目名称:chute,代码行数:15,代码来源:MySqlIterativeImporter.java

示例2: getBinlogEventParserProvider

import com.github.shyiko.mysql.binlog.BinaryLogClient; //导入方法依赖的package包/类
public static Object getBinlogEventParserProvider(
        int serverId,
        int BINLOG_EVENT_PARSER_PROVIDER_CODE,
        Configuration configuration,
        PipelinePosition pipelinePosition) throws Exception {

    if (BINLOG_EVENT_PARSER_PROVIDER_CODE == BinlogEventParserProviderCode.OR ) {

        OpenReplicator openReplicator = new OpenReplicator();

        // config
        openReplicator.setUser(configuration.getReplicantDBUserName());
        openReplicator.setPassword(configuration.getReplicantDBPassword());
        openReplicator.setPort(configuration.getReplicantPort());

        // host pool
        openReplicator.setHost(pipelinePosition.getCurrentReplicantHostName());
        openReplicator.setServerId(serverId);

        // position
        openReplicator.setBinlogPosition(pipelinePosition.getCurrentPosition().getBinlogPosition());
        openReplicator.setBinlogFileName(pipelinePosition.getCurrentPosition().getBinlogFilename());

        // disable lv2 buffer
        openReplicator.setLevel2BufferSize(-1);

       return  openReplicator;
    }
    else if (BINLOG_EVENT_PARSER_PROVIDER_CODE == BinlogEventParserProviderCode.SHYIKO) {

        BinaryLogClient client = new BinaryLogClient(
            pipelinePosition.getCurrentReplicantHostName(),
            configuration.getReplicantPort(),
            configuration.getReplicantDBUserName(),
            configuration.getReplicantDBPassword()
        );

        client.setServerId(serverId);

        client.setBinlogPosition(pipelinePosition.getCurrentPosition().getBinlogPosition());

        client.setBinlogFilename(pipelinePosition.getCurrentPosition().getBinlogFilename());

        return client;
    }
    else {

        throw new Exception("Unsupported parser exception");

    }
}
 
开发者ID:mysql-time-machine,项目名称:replicator,代码行数:52,代码来源:BinlogEventParserProviderFactory.java

示例3: BinlogClientImpl

import com.github.shyiko.mysql.binlog.BinaryLogClient; //导入方法依赖的package包/类
public BinlogClientImpl(Vertx vertx, BinlogClientOptions options) {
  this.vertx = vertx;
  this.context = vertx.getOrCreateContext();
  this.host = options.getHost();
  this.port = options.getPort();
  this.connectTimeout = options.getConnectTimeout();
  this.sqlClient = MySQLClient.createNonShared(vertx,
    new JsonObject()
      .put("host", options.getHost())
      .put("port", options.getPort())
      .put("database", "information_schema")
      .put("maxPoolSize", 1)
      .put("username", options.getUsername())
      .put("password",
          "".equals(options.getPassword()) ?
            null : options.getPassword())
  );
  dispatcher = new EventDispatcher(vertx,
    new SchemaResolver(sqlClient));
  client = new BinaryLogClient(
    host, port,
    options.getUsername(),
    Optional.ofNullable(
      options.getPassword()
    ).orElse("")
  );
  if (options.getFilename() != null) {
    client.setBinlogFilename(options.getFilename());
  }
  if (options.getPosition() != -1) {
    client.setBinlogPosition(options.getPosition());
  }
  client.setHeartbeatInterval(options.getHeartbeatInterval());
  client.setKeepAlive(options.isKeepAlive());
  client.setKeepAliveInterval(options.getKeepAliveInterval());
  client.registerEventListener(this::handle);
}
 
开发者ID:guoyu511,项目名称:vertx-mysql-binlog-client,代码行数:38,代码来源:BinlogClientImpl.java

示例4: positionClient

import com.github.shyiko.mysql.binlog.BinaryLogClient; //导入方法依赖的package包/类
@Override
public void positionClient(BinaryLogClient client) {
  client.setBinlogFilename(filename);
  client.setBinlogPosition(position);
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:6,代码来源:BinLogPositionSourceOffset.java


注:本文中的com.github.shyiko.mysql.binlog.BinaryLogClient.setBinlogPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。