| | |
| | | import org.opends.server.api.VirtualAttributeProvider; |
| | | import org.opends.server.api.plugin.PluginResult.SubordinateDelete; |
| | | import org.opends.server.api.plugin.PluginResult.SubordinateModifyDN; |
| | | import org.opends.server.backends.pluggable.spi.AccessMode; |
| | | import org.opends.server.backends.pluggable.spi.Cursor; |
| | | import org.opends.server.backends.pluggable.spi.ReadOperation; |
| | | import org.opends.server.backends.pluggable.spi.ReadableTransaction; |
| | |
| | | @Override |
| | | public void run(WriteableTransaction txn) throws Exception |
| | | { |
| | | index.open(txn); |
| | | index.open(txn, true); |
| | | if (!index.isTrusted()) |
| | | { |
| | | ccr.setAdminActionRequired(true); |
| | |
| | | public void run(WriteableTransaction txn) throws Exception |
| | | { |
| | | VLVIndex vlvIndex = new VLVIndex(cfg, state, storage, EntryContainer.this, txn); |
| | | vlvIndex.open(txn); |
| | | vlvIndex.open(txn, true); |
| | | if(!vlvIndex.isTrusted()) |
| | | { |
| | | ccr.setAdminActionRequired(true); |
| | |
| | | * Opens the entryContainer for reading and writing. |
| | | * |
| | | * @param txn a non null transaction |
| | | * @param accessMode specifies how the container has to be opened (read-write or read-only) |
| | | * @throws StorageRuntimeException If an error occurs in the storage. |
| | | * @throws ConfigException if a configuration related error occurs. |
| | | */ |
| | | void open(WriteableTransaction txn) throws StorageRuntimeException, ConfigException |
| | | void open(WriteableTransaction txn, AccessMode accessMode) throws StorageRuntimeException, ConfigException |
| | | { |
| | | boolean shouldCreate = accessMode.isWriteable(); |
| | | try |
| | | { |
| | | DataConfig entryDataConfig = |
| | |
| | | rootContainer.getCompressedSchema()); |
| | | |
| | | id2entry = new ID2Entry(getIndexName(ID2ENTRY_TREE_NAME), entryDataConfig); |
| | | id2entry.open(txn); |
| | | id2childrenCount.open(txn); |
| | | dn2id.open(txn); |
| | | state.open(txn); |
| | | dn2uri.open(txn); |
| | | id2entry.open(txn, shouldCreate); |
| | | id2childrenCount.open(txn, shouldCreate); |
| | | dn2id.open(txn, shouldCreate); |
| | | state.open(txn, shouldCreate); |
| | | dn2uri.open(txn, shouldCreate); |
| | | |
| | | for (String idx : config.listBackendIndexes()) |
| | | { |
| | | BackendIndexCfg indexCfg = config.getBackendIndex(idx); |
| | | |
| | | final AttributeIndex index = new AttributeIndex(indexCfg, state, this); |
| | | index.open(txn); |
| | | index.open(txn, shouldCreate); |
| | | if(!index.isTrusted()) |
| | | { |
| | | logger.info(NOTE_INDEX_ADD_REQUIRES_REBUILD, index.getName()); |
| | |
| | | BackendVLVIndexCfg vlvIndexCfg = config.getBackendVLVIndex(idx); |
| | | |
| | | VLVIndex vlvIndex = new VLVIndex(vlvIndexCfg, state, storage, this, txn); |
| | | vlvIndex.open(txn); |
| | | |
| | | vlvIndex.open(txn, shouldCreate); |
| | | if(!vlvIndex.isTrusted()) |
| | | { |
| | | logger.info(NOTE_INDEX_ADD_REQUIRES_REBUILD, vlvIndex.getName()); |
| | |
| | | { |
| | | for(Tree tree : allTrees) |
| | | { |
| | | tree.open(txn); |
| | | tree.open(txn, false); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | for(Tree tree : allTrees) |
| | | { |
| | | tree.open(txn); |
| | | tree.open(txn, true); |
| | | } |
| | | |
| | | for (Tree tree : allTrees) |
| | |
| | | } |
| | | finally |
| | | { |
| | | tree.open(txn); |
| | | tree.open(txn, true); |
| | | } |
| | | if(logger.isTraceEnabled()) |
| | | { |