private void initOrRebuildOdps()

in src/main/java/com/aliyun/odps/kafka/connect/MaxComputeSinkTask.java [619:641]


  private void initOrRebuildOdps() {
    LOGGER.debug("Enter initOrRebuildOdps!");
    if (odps == null) {
      this.odps = OdpsUtils.getOdps(config);
    }

    // Exit fast
    if (!Account.AccountProvider.STS.name().equals(accountType)) {
      return;
    }

    long current = System.currentTimeMillis();
    if (current - odpsCreateLastTime > timeout) {
      LOGGER.info("STS AK timed out. Last: {}, current: {}", odpsCreateLastTime, current);
      this.odps = OdpsUtils.getOdps(config);
      LOGGER.info("Account refreshed. Creation time: {}", current);
      for (Map.Entry<TopicPartition, MaxComputeSinkWriter> eachWriter : writers.entrySet()) {
        eachWriter.getValue().refresh(odps);
      }
      LOGGER.info("Writers refreshed.");
      odpsCreateLastTime = current;
    }
  }