richardstartin commented on code in PR #8491: URL: https://github.com/apache/pinot/pull/8491#discussion_r847761220
########## pinot-core/src/main/java/org/apache/pinot/core/transport/ServerRoutingInstance.java: ########## @@ -87,17 +100,20 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { + if (!(o instanceof ServerRoutingInstance)) { return false; } ServerRoutingInstance that = (ServerRoutingInstance) o; - return _tlsEnabled == that._tlsEnabled && _port == that._port && _hostname.equals(that._hostname) - && _tableType == that._tableType; + // NOTE: Only check hostname, port and tableType for performance concern because they can identify a routing + // instance within the same query + return _hostname.equals(that._hostname) && _port == that._port && _tableType == that._tableType; } @Override public int hashCode() { - return Objects.hash(_tlsEnabled, _hostname, _port, _tableType); + // NOTE: Only check hostname, port and tableType for performance concern because they can identify a routing + // instance within the same query + return Objects.hash(_hostname, _port, _tableType); Review Comment: If you care about performance here, don’t use Objects.hash - it boxes its parameters. Instead calculate the polynomial manually. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org