Skip to content
Merged
Show file tree
Hide file tree
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 @@ -98,7 +98,6 @@ public final class DBStoreBuilder {
private RocksDBConfiguration rocksDBConfiguration;
// Flag to indicate if the RocksDB should be opened readonly.
private boolean openReadOnly = false;
private int maxFSSnapshots = 0;
private final DBProfile defaultCfProfile;
private boolean enableCompactionDag;
private boolean createCheckpointDirs = true;
Expand Down Expand Up @@ -230,18 +229,14 @@ public DBStore build() throws IOException {
}

return new RDBStore(dbFile, rocksDBOption, statistics, writeOptions, tableConfigs,
registry.build(), openReadOnly, maxFSSnapshots, dbJmxBeanNameName,
enableCompactionDag, maxDbUpdatesSizeThreshold, createCheckpointDirs,
configuration, enableRocksDbMetrics);
registry.build(), openReadOnly, dbJmxBeanNameName, enableCompactionDag,
maxDbUpdatesSizeThreshold, createCheckpointDirs, configuration,
enableRocksDbMetrics);
} finally {
tableConfigs.forEach(TableConfig::close);
}
}

public DBStoreBuilder setMaxFSSnapshots(int maxFSSnapshots) {
this.maxFSSnapshots = maxFSSnapshots;
return this;
}
public DBStoreBuilder setName(String name) {
dbname = name;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class RDBStore implements DBStore {
@SuppressWarnings("parameternumber")
public RDBStore(File dbFile, ManagedDBOptions dbOptions, ManagedStatistics statistics,
ManagedWriteOptions writeOptions, Set<TableConfig> families,
CodecRegistry registry, boolean readOnly, int maxFSSnapshots,
CodecRegistry registry, boolean readOnly,
String dbJmxBeanName, boolean enableCompactionDag,
long maxDbUpdatesSizeThreshold,
boolean createCheckpointDirs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static RDBStore newRDBStore(File dbFile, ManagedDBOptions options,
long maxDbUpdatesSizeThreshold)
throws IOException {
return new RDBStore(dbFile, options, null, new ManagedWriteOptions(), families,
CodecRegistry.newBuilder().build(), false, 1000, null, false,
CodecRegistry.newBuilder().build(), false, null, false,
maxDbUpdatesSizeThreshold, true, null, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import static org.apache.hadoop.ozone.OzoneConsts.OM_SNAPSHOT_CHECKPOINT_DIR;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_DB_MAX_OPEN_FILES;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_DB_MAX_OPEN_FILES_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_FS_SNAPSHOT_MAX_LIMIT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_FS_SNAPSHOT_MAX_LIMIT_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_DB_MAX_OPEN_FILES;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_DB_MAX_OPEN_FILES_DEFAULT;
import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_SNAPSHOT_ROCKSDB_METRICS_ENABLED;
Expand Down Expand Up @@ -589,15 +587,12 @@ public static DBStore loadDB(OzoneConfiguration configuration, File metaDir,
boolean createCheckpointDirs,
boolean enableRocksDBMetrics)
throws IOException {
final int maxFSSnapshots = configuration.getInt(
OZONE_OM_FS_SNAPSHOT_MAX_LIMIT, OZONE_OM_FS_SNAPSHOT_MAX_LIMIT_DEFAULT);
RocksDBConfiguration rocksDBConfiguration =
configuration.getObject(RocksDBConfiguration.class);
DBStoreBuilder dbStoreBuilder = DBStoreBuilder.newBuilder(configuration,
rocksDBConfiguration).setName(dbName)
.setOpenReadOnly(readOnly)
.setPath(Paths.get(metaDir.getPath()))
.setMaxFSSnapshots(maxFSSnapshots)
.setEnableCompactionDag(enableCompactionDag)
.setCreateCheckpointDirs(createCheckpointDirs)
.setMaxNumberOfOpenFiles(maxOpenFiles)
Expand Down