guihecheng commented on code in PR #3346:
URL: https://github.com/apache/ozone/pull/3346#discussion_r865540715
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -942,9 +941,14 @@ public Container importContainer(ContainerData
originalContainerData,
final InputStream rawContainerStream,
final TarContainerPacker packer)
throws IOException {
+ Preconditions.checkState(originalContainerData instanceof
+ KeyValueContainerData, "Should be KeyValueContainerData instance");
KeyValueContainerData containerData =
new KeyValueContainerData(originalContainerData);
+ // schemaVersion should be used to decide the container db path
+ containerData.setSchemaVersion(
+ ((KeyValueContainerData) originalContainerData).getSchemaVersion());
Review Comment:
Hmmm, I'll try to add schemaVersion to the constructor.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainer.java:
##########
@@ -356,22 +379,25 @@ public void close() throws StorageContainerException {
// Second sync should be a very light operation as sync has already
// been done outside the lock.
flushAndSyncDB();
- updateContainerData(containerData::closeContainer);
+ updateContainerData(closer);
clearPendingPutBlockCache();
} finally {
writeUnlock();
}
- LOG.info("Container {} is closed with bcsId {}.",
- containerData.getContainerID(),
- containerData.getBlockCommitSequenceId());
}
- @Override
- public void updateDataScanTimestamp(Instant time)
+ /**
+ * For db-per-volume schemas, we don't flush and sync the whole db
+ * on closing of a single container.
+ * @param closer
+ * @throws StorageContainerException
+ */
+ private void closeWithoutFlush(Runnable closer)
Review Comment:
Sure, that's a good idea.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]