From 20fdcbef0d17440c367d2943f9c5799bddfe661f Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Tue, 07 Apr 2015 10:45:33 +0000
Subject: [PATCH] OPENDJ-1628 - Simplify Index hierarchy and remove Indexer classes
---
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
index be7fc27..b97484c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
@@ -54,6 +54,7 @@
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;
@@ -922,7 +923,7 @@
* @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)
@@ -1183,7 +1184,7 @@
{
try
{
- ConditionResult cr = id2c.containsID(txn, parentID.toByteString(), entryID);
+ ConditionResult cr = indexContainsID(id2c, txn, parentID.toByteString(), entryID);
if (cr == ConditionResult.FALSE)
{
if (logger.isTraceEnabled())
@@ -1247,7 +1248,7 @@
{
try
{
- ConditionResult cr = id2s.containsID(txn, id.toByteString(), entryID);
+ ConditionResult cr = indexContainsID(id2s, txn, id.toByteString(), entryID);
if (cr == ConditionResult.FALSE)
{
if (logger.isTraceEnabled())
@@ -1389,7 +1390,7 @@
if (presenceIndex != null)
{
- verifyAttributeInIndex(presenceIndex, txn, PresenceIndexer.presenceKey, entryID);
+ verifyAttributeInIndex(presenceIndex, txn, AttributeIndex.PRESENCE_KEY, entryID);
}
for (Attribute attr : attrList)
@@ -1433,7 +1434,7 @@
{
try
{
- ConditionResult cr = index.containsID(txn, key, entryID);
+ ConditionResult cr = indexContainsID(index, txn, key, entryID);
if (cr == ConditionResult.FALSE)
{
if (logger.isTraceEnabled())
@@ -1459,6 +1460,16 @@
}
}
+ 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
--
Gitblit v1.10.0