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

Jean-Noel Rouvignac
10.27.2015 d5d099fec6721bc2c18023e4e5e5f75db073ad1e
More code cleanup
1 files modified
29 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java 29 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
@@ -499,15 +499,8 @@
      {
        // Use a null index and ensure that future attempts to use the real
        // subordinate indexes will fail.
        id2children = new NullIndex(getIndexName(ID2CHILDREN_DATABASE_NAME),
            new ID2CIndexer(), state, storage, txn, this);
        state.putIndexTrustState(txn, id2children, false);
        id2children.open(txn); // No-op
        id2subtree = new NullIndex(getIndexName(ID2SUBTREE_DATABASE_NAME),
            new ID2SIndexer(), state, storage, txn, this);
        state.putIndexTrustState(txn, id2subtree, false);
        id2subtree.open(txn); // No-op
        id2children = openNewNullIndex(txn, ID2CHILDREN_DATABASE_NAME, new ID2CIndexer());
        id2subtree = openNewNullIndex(txn, ID2SUBTREE_DATABASE_NAME, new ID2SIndexer());
        logger.info(NOTE_JEB_SUBORDINATE_INDEXES_DISABLED, backend.getBackendID());
      }
@@ -551,6 +544,14 @@
    }
  }
  private NullIndex openNewNullIndex(WriteableStorage txn, String indexId, Indexer indexer)
  {
    final NullIndex index = new NullIndex(getIndexName(indexId), indexer, state, storage, txn, this);
    state.putIndexTrustState(txn, index, false);
    index.open(txn); // No-op
    return index;
  }
  /**
   * Closes the entry container.
   *
@@ -3016,16 +3017,10 @@
              // Disabling subordinate indexes. Use a null index and ensure that
              // future attempts to use the real indexes will fail.
              id2children.close();
              id2children = new NullIndex(getIndexName(ID2CHILDREN_DATABASE_NAME),
                  new ID2CIndexer(), state, storage, txn, EntryContainer.this);
              state.putIndexTrustState(txn, id2children, false);
              id2children.open(txn); // No-op
              id2children = openNewNullIndex(txn, ID2CHILDREN_DATABASE_NAME, new ID2CIndexer());
              id2subtree.close();
              id2subtree = new NullIndex(getIndexName(ID2SUBTREE_DATABASE_NAME),
                  new ID2SIndexer(), state, storage, txn, EntryContainer.this);
              state.putIndexTrustState(txn, id2subtree, false);
              id2subtree.open(txn); // No-op
              id2subtree = openNewNullIndex(txn, ID2SUBTREE_DATABASE_NAME, new ID2SIndexer());
              logger.info(NOTE_JEB_SUBORDINATE_INDEXES_DISABLED, cfg.getBackendId());
            }