Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ public class DatanodeConfiguration {
static final boolean CONTAINER_SCHEMA_V3_ENABLED_DEFAULT = false;
static final long ROCKSDB_LOG_MAX_FILE_SIZE_BYTES_DEFAULT = 32 * 1024 * 1024;
static final int ROCKSDB_LOG_MAX_FILE_NUM_DEFAULT = 64;
// one hour
static final long ROCKSDB_DELETE_OBSOLETE_FILES_PERIOD_MICRO_SECONDS_DEFAULT =
6 * 60 * 60 * 1000 * 1000;
1L * 60 * 60 * 1000 * 1000;
static final int ROCKSDB_MAX_OPEN_FILES_DEFAULT = 1024;
public static final String ROCKSDB_LOG_MAX_FILE_SIZE_BYTES_KEY =
"hdds.datanode.rocksdb.log.max-file-size";
public static final String ROCKSDB_LOG_MAX_FILE_NUM_KEY =
Expand Down Expand Up @@ -338,16 +340,24 @@ public void setWaitOnAllFollowers(boolean val) {
)
private int rocksdbMaxFileNum = ROCKSDB_LOG_MAX_FILE_NUM_DEFAULT;

@Config(key = "rocksdb.delete_obsolete_files_period",
defaultValue = "6h", timeUnit = MICROSECONDS,
@Config(key = "rocksdb.delete-obsolete-files-period",
Comment on lines -341 to +343
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we changing the config name? replacing _ with -, Even above ROCKSDB_DELETE_OBSOLETE_FILES_PERIOD_MICRO_SECONDS_KEY has _, I am not sure but changing config names must be an incompatible change right?

Copy link
Contributor Author

@ChenSammi ChenSammi Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main purpose of Replacing _ with - is to be consistent with other ozone property naming style. The property is recently added, should not introduce any compatibility issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChenSammi do we not need to change _ with - here in the value of this variable as well

      ROCKSDB_DELETE_OBSOLETE_FILES_PERIOD_MICRO_SECONDS_KEY =
      "hdds.datanode.rocksdb.delete_obsolete_files_period";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property is recently added, should not introduce any compatibility issue.

@ChenSammi, please cherry-pick this to the branch ozone-1.3 to avoid change of config property name between releases.

defaultValue = "1h", timeUnit = MICROSECONDS,
type = ConfigType.TIME,
tags = { DATANODE },
description = "Periodicity when obsolete files get deleted. " +
"Default is 6h."
"Default is 1h."
)
private long rocksdbDeleteObsoleteFilesPeriod =
ROCKSDB_DELETE_OBSOLETE_FILES_PERIOD_MICRO_SECONDS_DEFAULT;

@Config(key = "rocksdb.max-open-files",
defaultValue = "1024",
type = ConfigType.INT,
tags = { DATANODE },
description = "The total number of files that a RocksDB can open. "
)
private int rocksdbMaxOpenFiles = ROCKSDB_MAX_OPEN_FILES_DEFAULT;

@PostConstruct
public void validate() {
if (containerDeleteThreads < 1) {
Expand Down Expand Up @@ -562,4 +572,12 @@ public long getRocksdbDeleteObsoleteFilesPeriod() {
public void setRocksdbDeleteObsoleteFilesPeriod(long period) {
this.rocksdbDeleteObsoleteFilesPeriod = period;
}
}

public void setRocksdbMaxOpenFiles(int count) {
this.rocksdbMaxOpenFiles = count;
}

public int getRocksdbMaxOpenFiles() {
return this.rocksdbMaxOpenFiles;
}
}