This is an automated email from the ASF dual-hosted git repository.

domgarguilo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/main by this push:
     new bef5c7d076 Minor improvement to Range and RowRange docs/testgst (#5950)
bef5c7d076 is described below

commit bef5c7d0764b2196976a647af1323a8cc39e7ef6
Author: Dom G. <[email protected]>
AuthorDate: Tue Oct 14 16:33:06 2025 -0400

    Minor improvement to Range and RowRange docs/testgst (#5950)
---
 core/src/main/java/org/apache/accumulo/core/data/Range.java      | 3 ++-
 core/src/main/java/org/apache/accumulo/core/data/RowRange.java   | 9 +++++----
 .../test/java/org/apache/accumulo/core/data/RowRangeTest.java    | 8 ++++++++
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/data/Range.java 
b/core/src/main/java/org/apache/accumulo/core/data/Range.java
index 3be2e70b07..f4f00e3cec 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/Range.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/Range.java
@@ -337,7 +337,8 @@ public class Range implements WritableComparable<Range> {
   /**
    * Compares this range to another range. Compares in order: start key, 
inclusiveness of start key,
    * end key, inclusiveness of end key. Infinite keys sort first, and 
non-infinite keys are compared
-   * with {@link Key#compareTo(Key)}. Inclusive sorts before non-inclusive.
+   * with {@link Key#compareTo(Key)}. When bounds are equal, inclusive start 
keys sort before
+   * exclusive ones, while inclusive end keys sort after exclusive ones.
    *
    * @param o range to compare
    * @return comparison result
diff --git a/core/src/main/java/org/apache/accumulo/core/data/RowRange.java 
b/core/src/main/java/org/apache/accumulo/core/data/RowRange.java
index 56553a7c7e..ed7d1fe511 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/RowRange.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/RowRange.java
@@ -354,7 +354,7 @@ public class RowRange implements Comparable<RowRange> {
 
   /**
    * @param that row to check
-   * @return true if this row range's lower bound is greater than the given 
row, otherwise false
+   * @return true if every row in this row range is greater than the given 
row, otherwise false
    */
   public boolean isAfter(Text that) {
     return isAfterImpl(that);
@@ -362,7 +362,7 @@ public class RowRange implements Comparable<RowRange> {
 
   /**
    * @param that row to check
-   * @return true if this row range's upper bound is less than the given row, 
otherwise false
+   * @return true if every row in this row range is less than the given row, 
otherwise false
    */
   public boolean isBefore(Text that) {
     if (infiniteUpperBound) {
@@ -428,8 +428,9 @@ public class RowRange implements Comparable<RowRange> {
   /**
    * Compares this row range to another row range. Compares in order: lower 
bound, inclusiveness of
    * lower bound, upper bound, inclusiveness of upper bound. Infinite rows 
sort last, and
-   * non-infinite rows are compared with {@link 
Text#compareTo(BinaryComparable)}. Inclusive sorts
-   * before non-inclusive.
+   * non-infinite rows are compared with {@link 
Text#compareTo(BinaryComparable)}. When bounds are
+   * equal, inclusive lower bounds sort before exclusive ones, while inclusive 
upper bounds sort
+   * after exclusive ones.
    *
    * @param other row range to compare
    * @return comparison result
diff --git a/core/src/test/java/org/apache/accumulo/core/data/RowRangeTest.java 
b/core/src/test/java/org/apache/accumulo/core/data/RowRangeTest.java
index 4a980a3b4e..4afe08ad3f 100644
--- a/core/src/test/java/org/apache/accumulo/core/data/RowRangeTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/RowRangeTest.java
@@ -115,6 +115,14 @@ public class RowRangeTest {
       assertFalse(rowRangeR1.isAfter(new Text("r2")));
     }
 
+    @Test
+    void testExclusiveLowerBoundEqualityIsAfter() {
+      RowRange range = RowRange.open("a", "c");
+
+      assertTrue(range.isAfter(new Text("a")));
+      assertFalse(range.isAfter(new Text("b")));
+    }
+
     @Test
     public void testAfterupperBoundWithupperBoundInclusive() {
       RowRange range = RowRange.closed(new Text("a"), new Text("c"));

Reply via email to