neils-dev commented on code in PR #3741:
URL: https://github.com/apache/ozone/pull/3741#discussion_r1122231707
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -350,6 +368,63 @@ public void createDbStore(MutableVolumeSet dbVolumeSet)
throws IOException {
}
}
+ /**
+ * Ensure that volume is initialized properly with
+ * cleanup path. Should disk be re-inserted into
+ * cluster, cleanup path should already be on
+ * disk. This method syncs the HddsVolume
+ * with the path on disk.
+ *
+ * @param id clusterId or scmId
+ */
+ public void checkTmpDirPaths(String id) {
+ Path tmpPath = createTmpPath(id);
+ deleteServiceDirPath = tmpPath.resolve(TMP_DELETE_SERVICE_DIR);
+ }
+
+ private Path createTmpPath(String id) {
+
+ // HddsVolume root directory path
+ String hddsRoot = getHddsRootDir().toString();
+
+ // HddsVolume path
+ String vol = HddsVolumeUtil.getHddsRoot(hddsRoot);
+
+ Path volPath = Paths.get(vol);
+ Path idPath = Paths.get(id);
Review Comment:
We should be able to use `chooseContainerPathID(StorageVolume volume, String
clusterID) `inside the original `checkTmpDirPaths` so one place sets the proper
location for the subdir of hdds. The `chooseContainerPathID `should resolve
the proper location of the hdds subdir independent of version. Inside
`checkTmpDirPaths`, just check if id is null, if so pass an emptyString for
`clusterID `to `chooseContainerPathId `and it should return the proper location
of the hdds subdir (scmid or clusterid). Let me know how it goes.
--
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]