Skip to content

Commit 06de016

Browse files
authored
HDDS-11578. Unify constants for RATIS_SNAPSHOT_DIR (apache#7310)
(cherry picked from commit f784a84)
1 parent fe1ad24 commit 06de016

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import java.util.List;
5555

5656
import static org.apache.hadoop.hdds.HddsConfigKeys.OZONE_METADATA_DIRS;
57-
import static org.apache.hadoop.ozone.OzoneConsts.SCM_RATIS_SNAPSHOT_DIR;
57+
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_RATIS_SNAPSHOT_DIR;
5858
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_DEFAULT_SERVICE_ID;
5959
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SERVICE_IDS_KEY;
6060

@@ -159,7 +159,7 @@ public static String getSCMRatisSnapshotDirectory(ConfigurationSource conf) {
159159
OZONE_METADATA_DIRS);
160160
File metaDirPath = ServerUtils.getOzoneMetaDirPath(conf);
161161
snapshotDir =
162-
Paths.get(metaDirPath.getPath(), SCM_RATIS_SNAPSHOT_DIR).toString();
162+
Paths.get(metaDirPath.getPath(), OZONE_RATIS_SNAPSHOT_DIR).toString();
163163
}
164164
return snapshotDir;
165165
}

hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,7 @@ private OzoneConsts() {
387387
// should remain prepared even after a restart.
388388
public static final String PREPARE_MARKER = "prepareMarker";
389389

390-
// TODO : rename this to OZONE_RATIS_SNAPSHOT_DIR and use it in both
391-
// SCM and OM
392-
public static final String OM_RATIS_SNAPSHOT_DIR = "snapshot";
393-
public static final String SCM_RATIS_SNAPSHOT_DIR = "snapshot";
390+
public static final String OZONE_RATIS_SNAPSHOT_DIR = "snapshot";
394391

395392
public static final long DEFAULT_OM_UPDATE_ID = -1L;
396393

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
import static org.apache.hadoop.ozone.OzoneConsts.OM_METRICS_TEMP_FILE;
275275
import static org.apache.hadoop.ozone.OzoneConsts.OM_SNAPSHOT_DIR;
276276
import static org.apache.hadoop.ozone.OzoneConsts.PREPARE_MARKER_KEY;
277-
import static org.apache.hadoop.ozone.OzoneConsts.OM_RATIS_SNAPSHOT_DIR;
277+
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_RATIS_SNAPSHOT_DIR;
278278
import static org.apache.hadoop.ozone.OzoneConsts.RPC_PORT;
279279
import static org.apache.hadoop.ozone.OzoneConsts.TRANSACTION_INFO_KEY;
280280
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_KEY_DELETING_LIMIT_PER_TASK;
@@ -1494,7 +1494,7 @@ private void initializeRatisDirs(OzoneConfiguration conf) throws IOException {
14941494
// snapshot directory in Ratis storage directory. if yes, move it to
14951495
// new snapshot directory.
14961496

1497-
File snapshotDir = new File(omRatisDirectory, OM_RATIS_SNAPSHOT_DIR);
1497+
File snapshotDir = new File(omRatisDirectory, OZONE_RATIS_SNAPSHOT_DIR);
14981498

14991499
if (snapshotDir.isDirectory()) {
15001500
FileUtils.moveDirectory(snapshotDir.toPath(),

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
import org.slf4j.LoggerFactory;
111111

112112
import static org.apache.hadoop.hdds.HddsConfigKeys.OZONE_METADATA_DIRS;
113-
import static org.apache.hadoop.ozone.OzoneConsts.OM_RATIS_SNAPSHOT_DIR;
113+
import static org.apache.hadoop.ozone.OzoneConsts.OZONE_RATIS_SNAPSHOT_DIR;
114114
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_RATIS_SNAPSHOT_DIR;
115115
import static org.apache.hadoop.ozone.om.OzoneManagerUtils.getBucketLayout;
116116

@@ -484,7 +484,7 @@ public static String getOMRatisSnapshotDirectory(ConfigurationSource conf) {
484484
OZONE_OM_RATIS_SNAPSHOT_DIR, OZONE_METADATA_DIRS);
485485
File metaDirPath = ServerUtils.getOzoneMetaDirPath(conf);
486486
snapshotDir = Paths.get(metaDirPath.getPath(),
487-
OM_RATIS_SNAPSHOT_DIR).toString();
487+
OZONE_RATIS_SNAPSHOT_DIR).toString();
488488
}
489489
return snapshotDir;
490490
}

0 commit comments

Comments
 (0)