jihoonson commented on a change in pull request #10428:
URL: https://github.com/apache/druid/pull/10428#discussion_r536489478
##########
File path:
server/src/main/java/org/apache/druid/client/selector/ServerSelector.java
##########
@@ -159,15 +160,13 @@ public boolean isEmpty()
return servers;
}
- @Nullable
- @Override
- public QueryableDruidServer pick()
+ public <T> QueryableDruidServer pick(@Nullable Query<T> query)
Review comment:
It seems that this can still return null?
##########
File path:
server/src/main/java/org/apache/druid/client/CachingClusteredClient.java
##########
@@ -812,7 +812,7 @@ String computeResultLevelCachingEtag(
Hasher hasher = Hashing.sha1().newHasher();
boolean hasOnlyHistoricalSegments = true;
for (SegmentServerSelector p : segments) {
- if (!p.getServer().pick().getServer().isSegmentReplicationTarget()) {
+ if
(!p.getServer().pick(null).getServer().isSegmentReplicationTarget()) {
Review comment:
It sounds good to me. For the null check, do you mean a null check on
the query? If so, it doesn't seem ncessary because query cannot be null in
`CachingClusteredClient`.
##########
File path:
server/src/main/java/org/apache/druid/client/selector/TierSelectorStrategy.java
##########
@@ -47,6 +49,22 @@
List<QueryableDruidServer> pick(
Int2ObjectRBTreeMap<Set<QueryableDruidServer>> prioritizedServers,
DataSegment segment,
- int numServersToPick
- );
+ int numServersToPick);
+
+ @Nullable
+ default <T> QueryableDruidServer pick(Query<T> query,
+ Int2ObjectRBTreeMap<Set<QueryableDruidServer>> prioritizedServers,
+ DataSegment segment)
+ {
+ return pick(prioritizedServers, segment);
Review comment:
I don't have strong opinion here. The current one looks good to me.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]