Permalink
Browse files

cosmetic change name refactoring.

  • Loading branch information...
1 parent 318394a commit 0b31cb5747628c199a805d12c75ac49b383c1470 @bbansal bbansal committed Feb 10, 2009
@@ -56,7 +56,7 @@
private int bdbBtreeFanout;
private long bdbCheckpointBytes;
private long bdbCheckpointMs;
- private boolean bdbFilePerStore;
+ private boolean bdbOneEnvPerStore;
private String mysqlUsername;
private String mysqlPassword;
@@ -127,7 +127,7 @@ public VoldemortConfig(Props props) {
this.bdbBtreeFanout = props.getInt("bdb.btree.fanout", 512);
this.bdbCheckpointBytes = props.getLong("bdb.checkpoint.interval.bytes", 20 * 1024 * 1024);
this.bdbCheckpointMs = props.getLong("bdb.checkpoint.interval.ms", 30 * Time.MS_PER_SECOND);
- this.bdbFilePerStore = props.getBoolean("bdb.use.file.per.store", false);
+ this.bdbOneEnvPerStore = props.getBoolean("bdb.one.env.per.store", true);
this.enableReadOnlyEngine = props.getBoolean("enable.readonly.engine", false);
this.readOnlyFileWaitTimeoutMs = props.getLong("readonly.file.wait.timeout.ms", 4000L);
@@ -340,12 +340,12 @@ public void setBdbBtreeFanout(int bdbBtreeFanout) {
* The bdb Environment setting. use an environment(file) per store (if true)
* or use a common environment (default: false)
*/
- public boolean getBdbFilePerStore() {
- return this.bdbFilePerStore;
+ public boolean getBdbOneEnvPerStore() {
+ return this.bdbOneEnvPerStore;
}
- public void setBdbFilePerStore(boolean bdbFilePerStore) {
- this.bdbFilePerStore = bdbFilePerStore;
+ public void setBdbOneEnvPerStore(boolean bdbOneEnvPerStore) {
+ this.bdbOneEnvPerStore = bdbOneEnvPerStore;
}
/**
@@ -55,7 +55,7 @@
private Map<String, BdbStorageEngine> stores = Maps.newHashMap();
private String bdbMasterDir;
private List<Environment> environmentList = new ArrayList<Environment>();
- private boolean useFilePerStore;
+ private boolean useOneEnvPerStore;
public BdbStorageConfiguration(VoldemortConfig config) {
environmentConfig = new EnvironmentConfig();
@@ -77,7 +77,6 @@ public BdbStorageConfiguration(VoldemortConfig config) {
Long.toString(config.getBdbCheckpointBytes()));
environmentConfig.setConfigParam(EnvironmentConfig.CHECKPOINTER_WAKEUP_INTERVAL,
Long.toString(config.getBdbCheckpointMs() * Time.US_PER_MS));
- environmentConfig.setSharedCache(true);
// set database config.
databaseConfig = new DatabaseConfig();
@@ -89,7 +88,7 @@ public BdbStorageConfiguration(VoldemortConfig config) {
bdbMasterDir = config.getBdbDataDirectory();
// set bdb file per store or Old common file setting
- useFilePerStore = config.getBdbFilePerStore();
+ useOneEnvPerStore = config.getBdbOneEnvPerStore();
isInitialized = true;
}
@@ -118,13 +117,14 @@ public StorageEngineType getType() {
}
private Environment getEnvironment(String storeName) throws DatabaseException {
- if(useFilePerStore) {
+ if(useOneEnvPerStore) {
File bdbDir = new File(bdbMasterDir + "/" + storeName);
if(!bdbDir.exists()) {
logger.info("Creating BDB data directory '" + bdbDir.getAbsolutePath()
+ "' for store'" + storeName + "'.");
bdbDir.mkdirs();
}
+ environmentConfig.setSharedCache(true);
Environment environment = new Environment(bdbDir, environmentConfig);
environmentList.add(environment);
return environment;

0 comments on commit 0b31cb5

Please sign in to comment.