| | |
| | | */ |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import java.io.Closeable; |
| | | import java.util.*; |
| | | |
| | |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | /** |
| | | * Class representing an attribute index. |
| | | * We have a separate database for each type of indexing, which makes it easy |
| | |
| | | * |
| | | * @param indexConfig The attribute index configuration. |
| | | * @param entryContainer The entryContainer of this attribute index. |
| | | * @param txn The database transaction |
| | | * @throws ConfigException if a configuration related error occurs. |
| | | */ |
| | | public AttributeIndex(BackendIndexCfg indexConfig, EntryContainer entryContainer, WriteableStorage txn) throws ConfigException |
| | | public AttributeIndex(BackendIndexCfg indexConfig, EntryContainer entryContainer, WriteableStorage txn) |
| | | throws ConfigException |
| | | { |
| | | this.entryContainer = entryContainer; |
| | | this.indexConfig = indexConfig; |
| | |
| | | /** |
| | | * Open the attribute index. |
| | | * |
| | | * @param txn The database transaction |
| | | * @throws StorageRuntimeException if a JE database error occurs while |
| | | * opening the index. |
| | | */ |
| | |
| | | final ConfigChangeResult ccr = new ConfigChangeResult(); |
| | | try |
| | | { |
| | | entryContainer.getStorage().write(new WriteOperation() |
| | | entryContainer.getRootContainer().getStorage().write(new WriteOperation() |
| | | { |
| | | @Override |
| | | public void run(WriteableStorage txn) throws Exception |
| | |
| | | return rules; |
| | | } |
| | | |
| | | private void applyChangeToIndex(WriteableStorage txn, IndexType indexType, BackendIndexCfg cfg, ConfigChangeResult ccr) |
| | | private void applyChangeToIndex(final WriteableStorage txn, final IndexType indexType, final BackendIndexCfg cfg, |
| | | final ConfigChangeResult ccr) |
| | | { |
| | | String indexId = indexType.toString(); |
| | | Index index = nameToIndexes.get(indexId); |