| | |
| | | import org.forgerock.opendj.ldap.schema.MatchingRule; |
| | | import org.forgerock.opendj.ldap.spi.IndexingOptions; |
| | | import org.opends.server.backends.VerifyConfig; |
| | | import org.opends.server.backends.pluggable.AttributeIndex.MatchingRuleIndex; |
| | | import org.opends.server.backends.pluggable.spi.Cursor; |
| | | import org.opends.server.backends.pluggable.spi.ReadOperation; |
| | | import org.opends.server.backends.pluggable.spi.ReadableTransaction; |
| | |
| | | * @param index The index database to be checked. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | */ |
| | | private void iterateAttrIndex(ReadableTransaction txn, Index index, IndexingOptions options) |
| | | private void iterateAttrIndex(ReadableTransaction txn, MatchingRuleIndex index, IndexingOptions options) |
| | | throws StorageRuntimeException |
| | | { |
| | | if (index == null) |
| | |
| | | { |
| | | try |
| | | { |
| | | ConditionResult cr = id2c.containsID(txn, parentID.toByteString(), entryID); |
| | | ConditionResult cr = indexContainsID(id2c, txn, parentID.toByteString(), entryID); |
| | | if (cr == ConditionResult.FALSE) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | |
| | | { |
| | | try |
| | | { |
| | | ConditionResult cr = id2s.containsID(txn, id.toByteString(), entryID); |
| | | ConditionResult cr = indexContainsID(id2s, txn, id.toByteString(), entryID); |
| | | if (cr == ConditionResult.FALSE) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | |
| | | |
| | | if (presenceIndex != null) |
| | | { |
| | | verifyAttributeInIndex(presenceIndex, txn, PresenceIndexer.presenceKey, entryID); |
| | | verifyAttributeInIndex(presenceIndex, txn, AttributeIndex.PRESENCE_KEY, entryID); |
| | | } |
| | | |
| | | for (Attribute attr : attrList) |
| | |
| | | { |
| | | try |
| | | { |
| | | ConditionResult cr = index.containsID(txn, key, entryID); |
| | | ConditionResult cr = indexContainsID(index, txn, key, entryID); |
| | | if (cr == ConditionResult.FALSE) |
| | | { |
| | | if (logger.isTraceEnabled()) |
| | |
| | | } |
| | | } |
| | | |
| | | private ConditionResult indexContainsID(Index index, ReadableTransaction txn, ByteString key, EntryID entryID) |
| | | { |
| | | EntryIDSet entryIDSet = index.get(txn, key); |
| | | if (entryIDSet.isDefined()) |
| | | { |
| | | return ConditionResult.valueOf(entryIDSet.contains(entryID)); |
| | | } |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | | private ByteString normalize(MatchingRule matchingRule, ByteString value) throws DirectoryException |
| | | { |
| | | try |