code: protected void close() {
          this.authenticating = false;
  
          // cancel pending futures
          for (Future future : pendingFutures) {
              future.cancel(false);
              CancellableRunnable runnable = cancellables.get(future);
              if (runnable != null) {
                  runnable.cancel();
                  cancellables.remove(future);
              }
          }
  
          // shutdown ScheduledExecutorService. Without shutdown, cause thread leak
          if (remoteRequestExecutor != null && !remoteRequestExecutor.isShutdown()) {
              // Note: Time to wait is set 60 sec because RemoteRequest's socket timeout is set 60 seconds.
              Utils.shutdownAndAwaitTermination(remoteRequestExecutor,
                      Replication.DEFAULT_MAX_TIMEOUT_FOR_SHUTDOWN,
                      Replication.DEFAULT_MAX_TIMEOUT_FOR_SHUTDOWN);
          }
  
          // Close and remove all idle connections in the pool,
          clientFactory.evictAllConnectionsInPool();
      }
docs: Close all resources associated with this replicator.