| | |
| | | new DatabaseEntry("+".getBytes()); |
| | | |
| | | /** |
| | | * The container in which this attribute index resides. |
| | | * The entryContainer in which this attribute index resides. |
| | | */ |
| | | Container container; |
| | | EntryContainer entryContainer; |
| | | |
| | | /** |
| | | * The attribute index configuration. |
| | |
| | | |
| | | /** |
| | | * Create a new attribute index object. |
| | | * @param entryContainer The entryContainer of this attribute index. |
| | | * @param indexConfig The attribute index configuration. |
| | | * @param container The container of this attribute index. |
| | | */ |
| | | public AttributeIndex(IndexConfig indexConfig, Container container) |
| | | public AttributeIndex(EntryContainer entryContainer, IndexConfig indexConfig) |
| | | { |
| | | this.entryContainer = entryContainer; |
| | | this.indexConfig = indexConfig; |
| | | this.container = container; |
| | | |
| | | AttributeType attrType = indexConfig.getAttributeType(); |
| | | String name = attrType.getNameOrOID(); |
| | |
| | | if (indexConfig.isEqualityIndex()) |
| | | { |
| | | Indexer equalityIndexer = new EqualityIndexer(indexConfig); |
| | | this.equalityIndex = new Index(container, name + ".equality", |
| | | this.equalityIndex = new Index(this.entryContainer, name + ".equality", |
| | | equalityIndexer, |
| | | indexConfig.getEqualityEntryLimit(), |
| | | indexConfig.getCursorEntryLimit()); |
| | |
| | | if (indexConfig.isPresenceIndex()) |
| | | { |
| | | Indexer presenceIndexer = new PresenceIndexer(indexConfig); |
| | | this.presenceIndex = new Index(container, name + ".presence", |
| | | this.presenceIndex = new Index(this.entryContainer, name + ".presence", |
| | | presenceIndexer, |
| | | indexConfig.getPresenceEntryLimit(), |
| | | indexConfig.getCursorEntryLimit()); |
| | |
| | | if (indexConfig.isSubstringIndex()) |
| | | { |
| | | Indexer substringIndexer = new SubstringIndexer(indexConfig); |
| | | this.substringIndex = new Index(container, name + ".substring", |
| | | this.substringIndex = new Index(this.entryContainer, name + ".substring", |
| | | substringIndexer, |
| | | indexConfig.getSubstringEntryLimit(), |
| | | indexConfig.getCursorEntryLimit()); |
| | |
| | | if (indexConfig.isOrderingIndex()) |
| | | { |
| | | Indexer orderingIndexer = new OrderingIndexer(indexConfig); |
| | | this.orderingIndex = new Index(container, name + ".ordering", |
| | | this.orderingIndex = new Index(this.entryContainer, name + ".ordering", |
| | | orderingIndexer, |
| | | indexConfig.getEqualityEntryLimit(), |
| | | indexConfig.getCursorEntryLimit()); |
| | |
| | | */ |
| | | public void close() |
| | | { |
| | | // The container is responsible for closing the JE databases. |
| | | // The entryContainer is responsible for closing the JE databases. |
| | | } |
| | | |
| | | /** |
| | |
| | | String name = attrType.getNameOrOID(); |
| | | if (indexConfig.isEqualityIndex()) |
| | | { |
| | | container.removeDatabase(name + ".equality"); |
| | | entryContainer.removeDatabase(name + ".equality"); |
| | | } |
| | | if (indexConfig.isPresenceIndex()) |
| | | { |
| | | container.removeDatabase(name + ".presence"); |
| | | entryContainer.removeDatabase(name + ".presence"); |
| | | } |
| | | if (indexConfig.isSubstringIndex()) |
| | | { |
| | | container.removeDatabase(name + ".substring"); |
| | | entryContainer.removeDatabase(name + ".substring"); |
| | | } |
| | | if (indexConfig.isOrderingIndex()) |
| | | { |
| | | container.removeDatabase(name + ".ordering"); |
| | | entryContainer.removeDatabase(name + ".ordering"); |
| | | } |
| | | } |
| | | |