| | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import java.io.Closeable; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | |
| | | * to its own key. |
| | | */ |
| | | class VLVIndex extends DatabaseContainer |
| | | implements ConfigurationChangeListener<BackendVLVIndexCfg> |
| | | implements ConfigurationChangeListener<BackendVLVIndexCfg>, Closeable |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | |
| | | private SearchFilter filter; |
| | | private SearchScope scope; |
| | | |
| | | /** The storage associated with this index. */ |
| | | private final Storage storage; |
| | | |
| | | /** |
| | | * Create a new VLV vlvIndex object. |
| | |
| | | VLVIndex(BackendVLVIndexCfg config, State state, Storage storage, EntryContainer entryContainer, WriteableStorage txn) |
| | | throws StorageRuntimeException, ConfigException |
| | | { |
| | | super(new TreeName(entryContainer.getDatabasePrefix(), "vlv." + config.getName()), storage); |
| | | super(new TreeName(entryContainer.getDatabasePrefix(), "vlv." + config.getName())); |
| | | |
| | | this.config = config; |
| | | this.baseDN = config.getBaseDN(); |
| | | this.scope = valueOf(config.getScope()); |
| | | this.sortedSetCapacity = config.getMaxBlockSize(); |
| | | this.storage = storage; |
| | | |
| | | try |
| | | { |
| | |
| | | return bytes.toInt(); |
| | | } |
| | | |
| | | /** |
| | | * Close the VLV index. |
| | | * |
| | | * @throws StorageRuntimeException if a JE database error occurs while |
| | | * closing the index. |
| | | */ |
| | | @Override |
| | | public void close() throws StorageRuntimeException |
| | | public void close() |
| | | { |
| | | super.close(); |
| | | this.config.removeChangeListener(this); |
| | | } |
| | | |