tkalkirill commented on code in PR #1506:
URL: https://github.com/apache/ignite-3/pull/1506#discussion_r1072225481
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/AbstractPageMemoryTableStorage.java:
##########
@@ -268,12 +377,52 @@ private void checkPartitionId(int partitionId) {
int partitions = mvPartitions.length();
if (partitionId < 0 || partitionId >= partitions) {
- throw new IllegalArgumentException(S.toString(
- "Unable to access partition with id outside of configured
range",
- "table", tableCfg.value().name(), false,
- "partitionId", partitionId, false,
- "partitions", partitions, false
+ throw new IllegalArgumentException(IgniteStringFormatter.format(
+ "Unable to access partition with id outside of configured
range: [table={}, partitionId={}, partitions={}]",
+ getTableName(),
+ partitionId,
+ partitions
));
}
}
+
+ /**
+ * Returns multi-versioned partition storage without using {@link
#busyLock}.
+ *
+ * @param partitionId Partition ID.
+ * @return {@code Null} if there is no storage.
+ */
+ @Nullable
+ AbstractPageMemoryMvPartitionStorage
getMvPartitionStorageWithoutBusyLock(int partitionId) {
+ checkPartitionId(partitionId);
+
+ return mvPartitions.get(partitionId);
+ }
+
+ /**
+ * Returns multi-versioned partition storage, if it doesn't exist it will
throw an exception from the
+ * {@code missingStorageExceptionFunction}, without using {@link
#busyLock}.
+ *
+ * @param partitionId Partition ID.
+ * @param missingStorageExceptionFunction Function to create an exception
if the store is missing.
+ */
+ AbstractPageMemoryMvPartitionStorage getMvPartitionStorageWithoutBusyLock(
Review Comment:
Replaced with `null` check.
--
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]