Closed derkd closed 5 months ago
In my test I'm having a list of 3 RowCells with the same family but a different qualifier. I'm calling the getCells from the Row.java
I would expect that when I call getCells("pfeed", "pfeed") I would get the third one but instead if gives no results.
The problem is in this piece of code in Row , when high=3 it will never compares the third cell
high=3
private int getFirst(@Nonnull String family, @Nullable ByteString qualifier) { int low = 0; int high = getCells().size(); int index = -1; while (low < high) { int mid = (high + low) / 2; RowCell midCell = getCells().get(mid); int c = midCell.getFamily().compareTo(family); if (c == 0 && qualifier != null) { c = ByteStringComparator.INSTANCE.compare(midCell.getQualifier(), qualifier); } if (c < 0) { low = mid + 1; } else if (c == 0) { index = mid; high = mid; } else { high = mid; } } return index; }
I created the row myself in a unit test and there this logic won't stand but it does work in an integration test so I guess this is a non issue.
Environment details
Steps to reproduce
In my test I'm having a list of 3 RowCells with the same family but a different qualifier. I'm calling the getCells from the Row.java
I would expect that when I call getCells("pfeed", "pfeed") I would get the third one but instead if gives no results.
Code example
The problem is in this piece of code in Row , when
high=3
it will never compares the third cell