ibessonov commented on a change in pull request #402:
URL: https://github.com/apache/ignite-3/pull/402#discussion_r731798437



##########
File path: 
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbTableStorage.java
##########
@@ -219,18 +232,65 @@ else if (handleName.startsWith(CF_PARTITION_PREFIX)) {
             try {
                 ColumnFamilyHandle cfHandle = 
db.createColumnFamily(cfDescriptor);
 
-                partitionCf = new ColumnFamily(db, cfHandle, handleName, 
cfDescriptor.getOptions(), null);
+                ColumnFamily cf = new ColumnFamily(db, cfHandle, handleName, 
cfDescriptor.getOptions(), null);
+
+                partition = new RocksDbPartitionStorage(db, cf);
             }
             catch (RocksDBException e) {
                 cfDescriptor.getOptions().close();
 
                 throw new StorageException("Failed to create new RocksDB 
column family " + handleName, e);
             }
 
-            partitionCfs.set(partId, partitionCf);
+            partitions.set(partId, partition);
+        }
+
+        return partition;
+    }
+
+    /** {@inheritDoc} */
+    @Override public PartitionStorage getPartition(int partId) {
+        checkPartitionId(partId);
+
+        return partitions.get(partId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void dropPartition(int partId) throws StorageException {
+        checkPartitionId(partId);
+
+        RocksDbPartitionStorage partition = partitions.get(partId);
+
+        if (partition != null) {
+            partitions.set(partId, null);
+
+            ColumnFamily cf = partition.columnFamily();
+
+            ColumnFamilyHandle cfHandle = cf.handle();
+
+            try {
+                db.dropColumnFamily(cfHandle);

Review comment:
       Yes, I think we should




-- 
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]


Reply via email to