sumitagrawl commented on code in PR #8589:
URL: https://github.com/apache/ozone/pull/8589#discussion_r2162002073
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/WitnessedContainerDBDefinition.java:
##########
@@ -22,21 +22,20 @@
import org.apache.hadoop.hdds.scm.container.ContainerID;
import org.apache.hadoop.hdds.utils.db.DBColumnFamilyDefinition;
import org.apache.hadoop.hdds.utils.db.DBDefinition;
-import org.apache.hadoop.hdds.utils.db.StringCodec;
import org.apache.hadoop.ozone.OzoneConsts;
/**
* Class for defining the schema for master volume in a datanode.
*/
public final class WitnessedContainerDBDefinition extends DBDefinition.WithMap
{
- private static final String CONTAINER_IDS_TABLE_NAME = "containerIds";
+ private static final String CONTAINER_IDS_TABLE_NAME = "containerIdsTable";
Review Comment:
done
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/WitnessedContainerMetadataStoreImpl.java:
##########
@@ -64,13 +71,53 @@ private
WitnessedContainerMetadataStoreImpl(ConfigurationSource config, boolean
@Override
protected DBStore initDBStore(DBStoreBuilder dbStoreBuilder,
ManagedDBOptions options, ConfigurationSource config)
throws IOException {
+ previousVersionBasedTable = new PreviousVersionBasedTable();
+ previousVersionBasedTable.addTables(dbStoreBuilder);
final DBStore dbStore = dbStoreBuilder.build();
+ previousVersionBasedTable.init(dbStore);
this.containerIdsTable =
this.getDbDef().getContainerIdsTable().getTable(dbStore);
return dbStore;
}
@Override
- public Table<ContainerID, String> getContainerIdsTable() {
+ public Table<ContainerID, ContainerCreateInfo> getContainerIdsTable() {
+ if
(!VersionedDatanodeFeatures.isFinalized(HDDSLayoutFeature.WITNESSED_CONTAINER_DB_PROTO_VALUE))
{
+ return previousVersionBasedTable.getContainerIdsTable();
+ }
return containerIdsTable;
}
+
+ public PreviousVersionBasedTable getPreviousVersionBasedTable() {
+ return previousVersionBasedTable;
+ }
+
+ /**
+ * this will hold old version tables required during upgrade, and these are
initialized based on version only.
+ */
+ public static class PreviousVersionBasedTable {
Review Comment:
done
--
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]