| | |
| | | |
| | | package org.opends.server.backends.persistit; |
| | | |
| | | |
| | | |
| | | import static org.opends.server.util.StaticUtils.getFileForPath; |
| | | |
| | | import java.io.File; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.admin.std.server.LocalDBBackendCfg; |
| | | import org.opends.server.admin.std.server.PersistitBackendCfg; |
| | | import org.opends.server.backends.pluggable.spi.Cursor; |
| | | import org.opends.server.backends.pluggable.spi.Importer; |
| | | import org.opends.server.backends.pluggable.spi.ReadOperation; |
| | |
| | | throw new StorageRuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void update(TreeName treeName, ByteSequence key, UpdateFunction f) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private final File backendDirectory; |
| | | private final LocalDBBackendCfg config; |
| | | |
| | | |
| | | private File backendDirectory; |
| | | private PersistitBackendCfg config; |
| | | private Persistit db; |
| | | private final ConcurrentMap<TreeName, Volume> volumes = new ConcurrentHashMap<TreeName, Volume>(); |
| | | private Properties properties; |
| | | |
| | | public PersistItStorage(File backendDirectory, LocalDBBackendCfg config) { |
| | | this.backendDirectory = backendDirectory; |
| | | this.config = config; |
| | | } |
| | | |
| | | private Volume getVolume(TreeName treeName) { |
| | | return volumes.get(treeName.getSuffix()); |
| | | } |
| | | |
| | | @Override |
| | | public void initialize(Map<String, String> options) { |
| | | public void initialize(PersistitBackendCfg cfg) |
| | | { |
| | | this.config = cfg; |
| | | this.backendDirectory = new File(getFileForPath(config.getDBDirectory()), |
| | | config.getBackendId()); |
| | | |
| | | properties = new Properties(); |
| | | properties.setProperty("datapath", backendDirectory.toString()); |
| | | properties.setProperty("logpath", backendDirectory.toString()); |
| | |
| | | + ",extensionSize:1M" |
| | | + ",maximumSize:10G"); |
| | | } |
| | | |
| | | if (options != null) { |
| | | for (Entry<String, String> entry : options.entrySet()) { |
| | | properties.setProperty(entry.getKey(), entry.getValue()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |