Skip to content

Commit

Permalink
HDDS-11578. Unify constants for RATIS_SNAPSHOT_DIR (apache#7310)
Browse files Browse the repository at this point in the history
(cherry picked from commit f784a84)
  • Loading branch information
weimingdiit authored Oct 17, 2024
1 parent fe1ad24 commit 06de016
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import java.util.List;

import static org.apache.hadoop.hdds.HddsConfigKeys.OZONE_METADATA_DIRS;
import static org.apache.hadoop.ozone.OzoneConsts.SCM_RATIS_SNAPSHOT_DIR;
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_RATIS_SNAPSHOT_DIR;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_DEFAULT_SERVICE_ID;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SERVICE_IDS_KEY;

Expand Down Expand Up @@ -159,7 +159,7 @@ public static String getSCMRatisSnapshotDirectory(ConfigurationSource conf) {
OZONE_METADATA_DIRS);
File metaDirPath = ServerUtils.getOzoneMetaDirPath(conf);
snapshotDir =
Paths.get(metaDirPath.getPath(), SCM_RATIS_SNAPSHOT_DIR).toString();
Paths.get(metaDirPath.getPath(), OZONE_RATIS_SNAPSHOT_DIR).toString();
}
return snapshotDir;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,7 @@ private OzoneConsts() {
// should remain prepared even after a restart.
public static final String PREPARE_MARKER = "prepareMarker";

// TODO : rename this to OZONE_RATIS_SNAPSHOT_DIR and use it in both
// SCM and OM
public static final String OM_RATIS_SNAPSHOT_DIR = "snapshot";
public static final String SCM_RATIS_SNAPSHOT_DIR = "snapshot";
public static final String OZONE_RATIS_SNAPSHOT_DIR = "snapshot";

public static final long DEFAULT_OM_UPDATE_ID = -1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
import static org.apache.hadoop.ozone.OzoneConsts.OM_METRICS_TEMP_FILE;
import static org.apache.hadoop.ozone.OzoneConsts.OM_SNAPSHOT_DIR;
import static org.apache.hadoop.ozone.OzoneConsts.PREPARE_MARKER_KEY;
import static org.apache.hadoop.ozone.OzoneConsts.OM_RATIS_SNAPSHOT_DIR;
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_RATIS_SNAPSHOT_DIR;
import static org.apache.hadoop.ozone.OzoneConsts.RPC_PORT;
import static org.apache.hadoop.ozone.OzoneConsts.TRANSACTION_INFO_KEY;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_KEY_DELETING_LIMIT_PER_TASK;
Expand Down Expand Up @@ -1494,7 +1494,7 @@ private void initializeRatisDirs(OzoneConfiguration conf) throws IOException {
// snapshot directory in Ratis storage directory. if yes, move it to
// new snapshot directory.

File snapshotDir = new File(omRatisDirectory, OM_RATIS_SNAPSHOT_DIR);
File snapshotDir = new File(omRatisDirectory, OZONE_RATIS_SNAPSHOT_DIR);

if (snapshotDir.isDirectory()) {
FileUtils.moveDirectory(snapshotDir.toPath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
import org.slf4j.LoggerFactory;

import static org.apache.hadoop.hdds.HddsConfigKeys.OZONE_METADATA_DIRS;
import static org.apache.hadoop.ozone.OzoneConsts.OM_RATIS_SNAPSHOT_DIR;
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_RATIS_SNAPSHOT_DIR;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_RATIS_SNAPSHOT_DIR;
import static org.apache.hadoop.ozone.om.OzoneManagerUtils.getBucketLayout;

Expand Down Expand Up @@ -484,7 +484,7 @@ public static String getOMRatisSnapshotDirectory(ConfigurationSource conf) {
OZONE_OM_RATIS_SNAPSHOT_DIR, OZONE_METADATA_DIRS);
File metaDirPath = ServerUtils.getOzoneMetaDirPath(conf);
snapshotDir = Paths.get(metaDirPath.getPath(),
OM_RATIS_SNAPSHOT_DIR).toString();
OZONE_RATIS_SNAPSHOT_DIR).toString();
}
return snapshotDir;
}
Expand Down

0 comments on commit 06de016

Please sign in to comment.