Skip to content

Commit 42ae0f3

Browse files
authored
CNDB-15608 simplify ceiling row id from primary key (#2142)
PartitionAwarePrimaryKeyMap implements overcomplicated `ceiling` method calling `exactRowIdOrInvertedCeiling`. This commit Simplifies PartitionAwarePrimaryKeyMap.ceiling to use the corresponding correct method from the reader directly. This can be seen as a follow up to https://github.com/datastax/cassandra/pull/1096/files#diff-c5011580ab9b0d99d9e504570c4cccb152221d3dbe62c8a956e83fce9070b380
1 parent 48b55fb commit 42ae0f3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/java/org/apache/cassandra/index/sai/disk/v1/PartitionAwarePrimaryKeyMap.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,7 @@ public long exactRowIdOrInvertedCeiling(PrimaryKey key)
170170
@Override
171171
public long ceiling(PrimaryKey key)
172172
{
173-
var rowId = exactRowIdOrInvertedCeiling(key);
174-
if (rowId >= 0)
175-
return rowId;
176-
if (rowId == Long.MIN_VALUE)
177-
return -1;
178-
else
179-
return -rowId - 1;
173+
return rowIdToToken.ceilingRowId(key.token().getLongValue());
180174
}
181175

182176
@Override

0 commit comments

Comments
 (0)