private boolean isBetterEndpoint(DbEndpoint first, DbEndpoint second) {
    if (first == null) {
      return false;
    }
    if (second == null) {
      return true;
    }
    return endpointComparator.compare(first, second) < 0;
  }
Close the active connection and clear the statement cache.
ambry-mysql/src/main/java/com/github/ambry/mysql/MySqlDataAccessor.java