AMashenkov commented on code in PR #1191:
URL: https://github.com/apache/ignite-3/pull/1191#discussion_r1000354733
##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbTableStorage.java:
##########
@@ -452,6 +452,19 @@ public HashIndexStorage getOrCreateHashIndex(int
partitionId, UUID indexId) {
return storages.getOrCreateStorage(partitionStorage);
}
+ @Override
+ public HashIndexStorage getOrCreateHashIndex(int partitionId,
HashIndexDescriptor descriptor) {
+ HashIndex storages = hashIndices.computeIfAbsent(descriptor.id(), id
-> new HashIndex(hashIndexCf, descriptor));
+
+ RocksDbMvPartitionStorage partitionStorage =
getMvPartition(partitionId);
+
+ if (partitionStorage == null) {
+ throw new StorageException(String.format("Partition ID %d does not
exist", partitionId));
+ }
+
+ return storages.getOrCreateStorage(partitionStorage);
+ }
+
Review Comment:
```suggestion
@Override
public HashIndexStorage getOrCreateHashIndex(int partitionId,
HashIndexDescriptor descriptor) {
HashIndex hashIndex = hashIndices.computeIfAbsent(descriptor.id(),
id -> new HashIndex(hashIndexCf, descriptor));
RocksDbMvPartitionStorage partitionStorage =
getMvPartition(partitionId);
if (partitionStorage == null) {
throw new StorageException(String.format("Partition ID %d does
not exist", partitionId));
}
return hashIndex.getOrCreateStorage(partitionStorage);
}
```
--
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]