Skip to content

Commit

Permalink
nfs4: add constructor that accepts db properties to BerkeleyDBClientS…
Browse files Browse the repository at this point in the history
…tore

Add a way to programmatically modify db configuration

Acked-by: Lea Morschel
Target: master
  • Loading branch information
kofemann committed Apr 22, 2020
1 parent 5a36149 commit 5adb2b6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion core/src/main/java/org/dcache/nfs/v4/BerkeleyDBClientStore.java
Expand Up @@ -35,6 +35,7 @@

import java.io.File;
import java.time.Instant;
import java.util.Properties;

import org.dcache.nfs.status.NoGraceException;
import org.dcache.nfs.status.ReclaimBadException;
Expand Down Expand Up @@ -84,9 +85,24 @@ public class BerkeleyDBClientStore implements ClientRecoveryStore {

private final Instant bootTime = Instant.now();

/**
* Create a BerkeleyDBClientStore with db file located in the given directory.
* @param dir the directory where berkeley DB files are stored.
*/
public BerkeleyDBClientStore(File dir) {
this(dir, new Properties());
}

/**
* Create a BerkeleyDBClientStore with db file located in the given directory and configuration is specified by the
* specified properties.
* @param dir the directory where berkeley DB files are stored.
* @param properties database configuration properties.
*/
public BerkeleyDBClientStore(File dir, Properties properties) {

EnvironmentConfig envConfig = new EnvironmentConfig(properties);

EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setTransactional(true);
envConfig.setAllowCreate(true);
envConfig.setReadOnly(false);
Expand Down

0 comments on commit 5adb2b6

Please sign in to comment.