Exemplo n.º 1
0
  public void start() throws CanalParseException {
    if (runningInfo == null) { // 第一次链接主库
      runningInfo = masterInfo;
    }

    super.start();
  }
Exemplo n.º 2
0
  @Override
  public void stop() {
    if (metaConnection != null) {
      try {
        metaConnection.disconnect();
      } catch (IOException e) {
        logger.error(
            "ERROR # disconnect meta connection for address:{}",
            metaConnection.getConnector().getAddress(),
            e);
      }
    }

    if (tableMetaCache != null) {
      tableMetaCache.clearTableMeta();
    }

    super.stop();
  }
Exemplo n.º 3
0
  public void stop() throws CanalParseException {
    if (metaConnection != null) {
      try {
        metaConnection.disconnect();
      } catch (IOException e) {
        logger.error(
            "ERROR # disconnect meta connection for address:{}",
            metaConnection.getConnector().getAddress(),
            e);
      }
    }

    if (tableMetaCache != null) {
      tableMetaCache.clearTableMeta();
    }

    stopHeartbeat();
    super.stop();
  }
Exemplo n.º 4
0
  protected void afterDump(ErosaConnection connection) {
    super.afterDump(connection);

    if (!(connection instanceof MysqlConnection)) {
      throw new CanalParseException(
          "Unsupported connection type : " + connection.getClass().getSimpleName());
    }

    if (metaConnection != null) {
      try {
        metaConnection.disconnect();
      } catch (IOException e) {
        logger.error(
            "ERROR # disconnect meta connection for address:{}",
            metaConnection.getConnector().getAddress(),
            e);
      }
    }
  }