smengcl commented on code in PR #8937:
URL: https://github.com/apache/ozone/pull/8937#discussion_r2279642856
##########
hadoop-ozone/mini-cluster/src/main/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java:
##########
@@ -702,14 +710,65 @@ protected void configureSCM() {
conf.setInt(ScmConfigKeys.OZONE_SCM_RATIS_PORT_KEY, getFreePort());
conf.setInt(ScmConfigKeys.OZONE_SCM_GRPC_PORT_KEY, getFreePort());
conf.setIfUnset(ScmConfigKeys.OZONE_SCM_HA_RATIS_SERVER_RPC_FIRST_ELECTION_TIMEOUT,
"1s");
+
+ Path scmMetaDir = Paths.get(path, SCM_SUBDIR_NAME);
+ Files.createDirectories(scmMetaDir.resolve(DATA_SUBDIR_NAME));
+
+ // Extra configs for non-HA SCM
+ if (!isHA) {
+ // e.g. when path is /var/lib/hadoop-ozone
+ // ozone.scm.ha.ratis.storage.dir = /var/lib/hadoop-ozone/scm/ratis
+ conf.setIfUnset(ScmConfigKeys.OZONE_SCM_HA_RATIS_STORAGE_DIR,
+ scmMetaDir.resolve(RATIS_SUBDIR_NAME).toString());
+
+ // ozone.scm.ha.ratis.snapshot.dir =
/var/lib/hadoop-ozone/scm/ozone-metadata/snapshot
+ conf.setIfUnset(ScmConfigKeys.OZONE_SCM_HA_RATIS_SNAPSHOT_DIR,
+
scmMetaDir.resolve(OZONE_METADATA_SUBDIR_NAME).resolve(OZONE_RATIS_SNAPSHOT_DIR).toString());
+
+ // ozone.scm.db.dirs = /var/lib/hadoop-ozone/scm/data
+ conf.setIfUnset(ScmConfigKeys.OZONE_SCM_DB_DIRS,
+ scmMetaDir.resolve(DATA_SUBDIR_NAME).toString());
+
+ // ozone.http.basedir =
/var/lib/hadoop-ozone/scm/ozone-metadata/webserver
+ conf.setIfUnset(OzoneConfigKeys.OZONE_HTTP_BASEDIR,
+ scmMetaDir.resolve(OZONE_METADATA_SUBDIR_NAME) + SERVER_DIR);
Review Comment:
Note `SERVER_DIR` includes `/` at the beginning so what copilot suggested
won't work. I learnt that because I was using the exact same approach at the
beginning and it broke the tests.
--
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]