code: public long getTimestamps(int range) throws IOException {
      long timestamp;
      try {
        timestamp = client.getTimestamps(range);
      } catch (TException e) {
        LOG.info("Can't get timestamp, try to connect the active chronos server");
        try {
          reconnectChronosServer();
          return client.getTimestamps(range);
        } catch (Exception e1) {
          LOG.info("Can't connect chronos server, try to connect ZooKeeper firstly");
          try {
            reconnectZooKeeper();
            reconnectChronosServer();
            return client.getTimestamps(range);
          } catch (Exception e2) {
            throw new IOException("Error to get timestamp after reconnecting ZooKeeper and chronos server", e2);
          }
        }
      }
      return timestamp;
    }
docs: Send RPC request to get timestamp from ChronosServer. Use lazy strategy to detect failure.
  If request fails, reconnect ChronosServer. If request fails again, reconnect ZooKeeper.
  
  @param range the number of timestamps
  @return the first timestamp to use
  @throws IOException when error to connect ChronosServer or ZooKeeper