| | |
| | | |
| | | import org.opends.server.types.*; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugError; |
| | | import static org.opends.server.messages.JebMessages. |
| | | MSGID_JEB_MISSING_DN2ID_RECORD; |
| | | import static org.opends.server.messages.JebMessages. |
| | |
| | | MSGID_JEB_REBUILD_INSERT_ENTRY_FAILED; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString; |
| | | |
| | | |
| | |
| | | public class IndexRebuildThread extends DirectoryThread |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | /** |
| | | * The entry container. |
| | | */ |
| | | EntryContainer ec = null; |
| | |
| | | //TODO: throw error |
| | | if(debugEnabled()) |
| | | { |
| | | debugError("No index type specified. Rebuild process terminated."); |
| | | TRACER.debugError("No index type specified. Rebuild process " + |
| | | "terminated."); |
| | | } |
| | | |
| | | return; |
| | |
| | | //TODO: throw error |
| | | if(debugEnabled()) |
| | | { |
| | | debugError("No attribute index specified. Rebuild process terminated."); |
| | | TRACER.debugError("No attribute index specified. Rebuild process " + |
| | | "terminated."); |
| | | } |
| | | |
| | | return; |
| | |
| | | //TODO: throw error |
| | | if(debugEnabled()) |
| | | { |
| | | debugError("No index specified. Rebuild process terminated."); |
| | | TRACER.debugError("No index specified. Rebuild process terminated."); |
| | | } |
| | | |
| | | return; |
| | |
| | | totalEntries = getTotalEntries(); |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Initiating rebuild of the %s indexType/database", indexName); |
| | | debugVerbose("%d entries will be rebuilt", totalEntries); |
| | | TRACER.debugInfo("Initiating rebuild of the %s indexType/database", |
| | | indexName); |
| | | TRACER.debugVerbose("%d entries will be rebuilt", totalEntries); |
| | | } |
| | | |
| | | switch(indexType) |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugVerbose("Rebuilt %d entries", rebuiltEntries); |
| | | TRACER.debugVerbose("Rebuilt %d entries", rebuiltEntries); |
| | | } |
| | | } |
| | | catch(Exception e) |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | |
| | | duplicatedEntries++; |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | "into the DN2ID database because it already exists.", |
| | | entry.getDN().toString(), entryID.longValue()); |
| | | } |
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | duplicatedEntries++; |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | "into the DN2URI database because it already exists.", |
| | | entry.getDN().toString(), entryID.longValue()); |
| | | } |
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(debugEnabled()) |
| | | { |
| | | duplicatedEntries++; |
| | | debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | "into the DN2Subtree database because it already " + |
| | | TRACER.debugInfo("Unable to insert entry with DN %s and " + |
| | | "ID %d into the DN2Subtree database because it already " + |
| | | "exists.", |
| | | entry.getDN().toString(), entryID.longValue()); |
| | | } |
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(debugEnabled()) |
| | | { |
| | | duplicatedEntries++; |
| | | debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | "into the DN2Subtree database because it already " + |
| | | "exists.", |
| | | entry.getDN().toString(), entryID.longValue()); |
| | | TRACER.debugInfo("Unable to insert entry with DN %s and ID " + |
| | | "%d into the DN2Subtree database because it already " + |
| | | "exists.", entry.getDN().toString(), entryID.longValue()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(debugEnabled()) |
| | | { |
| | | duplicatedEntries++; |
| | | debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | "into the DN2Subtree database because it already " + |
| | | "exists.", |
| | | entry.getDN().toString(), entryID.longValue()); |
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | if(debugEnabled()) |
| | | { |
| | | duplicatedEntries++; |
| | | debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | TRACER.debugInfo("Unable to insert entry with DN %s and ID %d " + |
| | | "into the DN2Subtree database because it already " + |
| | | "exists.", |
| | | entry.getDN().toString(), entryID.longValue()); |
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |