@Override
  public void close() {
    for (SelectionKey key : this.nioSelector.keys()) {
      close(key);
    }
    try {
      this.nioSelector.close();
    } catch (IOException e) {
      metrics.selectorNioCloseErrorCount.inc();
      logger.error("Exception closing nioSelector:", e);
    }
    if (executorPool != null) {
      executorPool.shutdown();
    }
  }
Close this selector and all associated connections
ambry-network/src/main/java/com/github/ambry/network/Selector.java