ivanzlenko commented on code in PR #6964:
URL: https://github.com/apache/ignite-3/pull/6964#discussion_r2527033153
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/impl/TestMvPartitionStorage.java:
##########
@@ -631,9 +633,30 @@ public ReadResult next() {
}
@Override
- public @Nullable RowMeta closestRow(RowId lowerBound) throws
StorageException {
+ public List<RowMeta> rowsStartingWith(RowId lowerBound, int limit) throws
StorageException {
checkStorageClosedOrInProcessOfRebalance();
+ List<RowMeta> result = new ArrayList<>();
+ RowId currentLowerBound = lowerBound;
+ for (int i = 0; i < limit; i++) {
+ RowMeta row = closestRow(currentLowerBound);
+
+ if (row == null) {
+ break;
+ }
+
+ result.add(row);
+ currentLowerBound = row.rowId().increment();
+
+ if (currentLowerBound == null) {
+ break;
Review Comment:
```suggestion
return result;
```
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/impl/TestMvPartitionStorage.java:
##########
@@ -631,9 +633,30 @@ public ReadResult next() {
}
@Override
- public @Nullable RowMeta closestRow(RowId lowerBound) throws
StorageException {
+ public List<RowMeta> rowsStartingWith(RowId lowerBound, int limit) throws
StorageException {
checkStorageClosedOrInProcessOfRebalance();
+ List<RowMeta> result = new ArrayList<>();
+ RowId currentLowerBound = lowerBound;
+ for (int i = 0; i < limit; i++) {
+ RowMeta row = closestRow(currentLowerBound);
+
+ if (row == null) {
+ break;
Review Comment:
```suggestion
return result;
```
##########
modules/storage-api/src/main/java/org/apache/ignite/internal/storage/MvPartitionStorage.java:
##########
@@ -270,12 +271,13 @@ AddWriteCommittedResult addWriteCommitted(
@Nullable RowId closestRowId(RowId lowerBound) throws StorageException;
/**
- * Returns a row, existing in the storage, that's greater or equal than
the lower bound. {@code null} if not found.
+ * Returns a batch of rows with subsequent IDs which IDs are greater or
equal than the lower bound.
*
* @param lowerBound Lower bound.
Review Comment:
```suggestion
* @param lowerBound Lower bound (inclusive).
```
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvPartitionStorageTest.java:
##########
@@ -1501,7 +1502,7 @@ void testScanVersionsWithWriteIntent() {
}
@Test
- void testClosestRowId() {
+ void testRowsStartingWithId() {
Review Comment:
Why this test got renamed? We do not test mentioned method here.
--
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]