| | |
| | | import com.sleepycat.je.StatsConfig; |
| | | import com.sleepycat.je.EnvironmentStats; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import static org.opends.server.messages.JebMessages. |
| | | MSGID_JEB_ATTRIBUTE_INDEX_NOT_CONFIGURED; |
| | |
| | | public class RebuildJob |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | /** |
| | | * The rebuild configuraiton. |
| | | */ |
| | | private RebuildConfig rebuildConfig; |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugVerbose("Rebuild thread %s stats: total %d processed %d " + |
| | | "rebuilt %d duplicated %d skipped %d", |
| | | TRACER.debugVerbose("Rebuild thread %s stats: total %d " + |
| | | "processed %d rebuilt %d duplicated %d skipped %d", |
| | | thread.getTotalEntries(), thread.getProcessedEntries(), |
| | | thread.getRebuiltEntries(), |
| | | thread.getDuplicatedEntries(), |
| | |
| | | { |
| | | if(debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | |
| | | //TODO: Throw error and bail out. |
| | | if(debugEnabled()) |
| | | { |
| | | debugError("Conflit detected. This job config: %s, " + |
| | | TRACER.debugError("Conflit detected. This job config: %s, " + |
| | | "That job config: %s.", |
| | | job.rebuildConfig, otherJob.rebuildConfig); |
| | | } |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Created rebuild thread %s", rebuildThread.getName()); |
| | | TRACER.debugInfo("Created rebuild thread %s", |
| | | rebuildThread.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Detailed overall rebuild job stats: rebuilt %d, " + |
| | | TRACER.debugInfo("Detailed overall rebuild job stats: rebuilt %d, " + |
| | | "duplicated %d, skipped %d", |
| | | totalRebuilt, totalDuplicated, totalSkipped); |
| | | } |
| | |
| | | { |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Delaying the start of thread %s because " + |
| | | TRACER.debugInfo("Delaying the start of thread %s because " + |
| | | "the max number of rebuild threads has been reached."); |
| | | } |
| | | start = false; |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Delaying the start of thread %s because " + |
| | | TRACER.debugInfo("Delaying the start of thread %s because " + |
| | | "it depends on another index rebuilt to " + |
| | | "go first.", t.getName()); |
| | | } |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Delaying the start of thread %s because " + |
| | | TRACER.debugInfo("Delaying the start of thread %s because " + |
| | | "it depends on another index being rebuilt to " + |
| | | "finish.", t.getName()); |
| | | } |
| | |
| | | { |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Starting rebuild thread %s.", t.getName()); |
| | | TRACER.debugInfo("Starting rebuild thread %s.", t.getName()); |
| | | } |
| | | waitingThreads.remove(t); |
| | | activeThreads.add(t); |
| | |
| | | |
| | | if(debugEnabled()) |
| | | { |
| | | debugInfo("Rebuild thread %s finished.", t.getName()); |
| | | TRACER.debugInfo("Rebuild thread %s finished.", t.getName()); |
| | | } |
| | | activeThreads.remove(t); |
| | | completedThreads.add(t); |