| | |
| | | timer.scheduleAtFixedRate(progressTask, progressInterval, |
| | | progressInterval); |
| | | |
| | | entryContainer.exclusiveLock.lock(); |
| | | try |
| | | { |
| | | for(IndexRebuildThread thread : waitingThreads) |
| | | { |
| | | thread.clearDatabase(); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | if(!rebuildConfig.includesSystemIndex()) |
| | | { |
| | | entryContainer.exclusiveLock.unlock(); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(!rebuildConfig.includesSystemIndex()) |
| | | { |
| | | entryContainer.sharedLock.lock(); |
| | | } |
| | | try |
| | | { |
| | | while(!waitingThreads.isEmpty()) |
| | |
| | | finally |
| | | { |
| | | timer.cancel(); |
| | | if(rebuildConfig.includesSystemIndex()) |
| | | { |
| | | entryContainer.exclusiveLock.unlock(); |
| | | } |
| | | else |
| | | { |
| | | entryContainer.sharedLock.unlock(); |
| | | } |
| | | } |
| | | |
| | | long totalProcessed = 0; |
| | |
| | | /** |
| | | * Dispatch a set of threads based on their dependency and ordering. |
| | | */ |
| | | private void dispatchThreads() |
| | | private void dispatchThreads() throws DatabaseException |
| | | { |
| | | for(IndexRebuildThread t : waitingThreads) |
| | | { |