AmatyaAvadhanula commented on code in PR #15685:
URL: https://github.com/apache/druid/pull/15685#discussion_r1452926782


##########
processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:
##########
@@ -418,9 +418,12 @@ private Iterator<Entry<RootPartitionRange, 
Short2ObjectSortedMap<AtomicUpdateGro
       TreeMap<RootPartitionRange, Short2ObjectSortedMap<AtomicUpdateGroup<T>>> 
stateMap
   )
   {
-    final RootPartitionRange lowFench = new RootPartitionRange(partitionId, 
partitionId);
+    final RootPartitionRange lowFence = new RootPartitionRange(partitionId, 
partitionId);
     final RootPartitionRange highFence = new 
RootPartitionRange(Short.MAX_VALUE, Short.MAX_VALUE);
-    return stateMap.subMap(lowFench, false, highFence, 
false).entrySet().iterator();
+    if (lowFence.compareTo(highFence) > 0) {
+      throw new ISE("PartitionId[%d] must be in the range [0, 32767].", 
Short.toUnsignedInt(partitionId));

Review Comment:
   Done



##########
processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:
##########
@@ -418,9 +418,12 @@ private Iterator<Entry<RootPartitionRange, 
Short2ObjectSortedMap<AtomicUpdateGro
       TreeMap<RootPartitionRange, Short2ObjectSortedMap<AtomicUpdateGroup<T>>> 
stateMap
   )
   {
-    final RootPartitionRange lowFench = new RootPartitionRange(partitionId, 
partitionId);
+    final RootPartitionRange lowFence = new RootPartitionRange(partitionId, 
partitionId);
     final RootPartitionRange highFence = new 
RootPartitionRange(Short.MAX_VALUE, Short.MAX_VALUE);
-    return stateMap.subMap(lowFench, false, highFence, 
false).entrySet().iterator();
+    if (lowFence.compareTo(highFence) > 0) {
+      throw new ISE("PartitionId[%d] must be in the range [0, 32767].", 
Short.toUnsignedInt(partitionId));
+    }
+    return stateMap.subMap(lowFence, false, highFence, 
false).entrySet().iterator();

Review Comment:
   Done



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to