mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
29.53.2015 caa38c1354824a2da50a8fbc8fc85ba1b0dfc7fe
opendj-server-legacy/src/main/java/org/opends/server/backends/pdb/PDBStorage.java
@@ -111,11 +111,8 @@
  private static final int IMPORT_DB_CACHE_SIZE = 4 * MB;
  private static final double MAX_SLEEP_ON_RETRY_MS = 50.0;
  private static final String VOLUME_NAME = "dj";
  private static final String JOURNAL_NAME = VOLUME_NAME + "_journal";
  /** The buffer / page size used by the PersistIt storage. */
  private static final int BUFFER_SIZE = 16 * 1024;
@@ -139,7 +136,8 @@
    }
    @Override
    public boolean isDefined() {
    public boolean isDefined()
    {
      return exchange.getValue().isDefined();
    }
@@ -255,8 +253,10 @@
      currentValue = null;
    }
    private void throwIfUndefined() {
      if (!isDefined()) {
    private void throwIfUndefined()
    {
      if (!isDefined())
      {
        throw new NoSuchElementException();
      }
    }
@@ -413,8 +413,8 @@
  /** PersistIt implementation of the {@link WriteableTransaction} interface. */
  private final class WriteableStorageImpl implements StorageImpl
  {
    private static final String DUMMY_RECORD = "_DUMMY_RECORD_";
    private final Map<TreeName, Exchange> exchanges = new HashMap<>();
    private final String DUMMY_RECORD = "_DUMMY_RECORD_";
    @Override
    public void put(final TreeName treeName, final ByteSequence key, final ByteSequence value)
@@ -713,7 +713,7 @@
  private Volume volume;
  private PDBBackendCfg config;
  private DiskSpaceMonitor diskMonitor;
  private PDBMonitor pdbMonitor;
  private PDBMonitor monitor;
  private MemoryQuota memQuota;
  private StorageStatus storageStatus = StorageStatus.working();
@@ -780,8 +780,8 @@
  {
    if (db != null)
    {
      DirectoryServer.deregisterMonitorProvider(pdbMonitor);
      pdbMonitor = null;
      DirectoryServer.deregisterMonitorProvider(monitor);
      monitor = null;
      try
      {
        db.close();
@@ -834,8 +834,8 @@
      db.initialize();
      volume = db.loadVolume(VOLUME_NAME);
      pdbMonitor = new PDBMonitor(config.getBackendId() + " PDB Database", db);
      DirectoryServer.registerMonitorProvider(pdbMonitor);
      monitor = new PDBMonitor(config.getBackendId() + " PDB Database", db);
      DirectoryServer.registerMonitorProvider(monitor);
    }
    catch(final InUseException e) {
      throw new StorageInUseException(e);