com.atlassian.bamboo.index
Class AbstractIndexer

java.lang.Object
  extended by com.atlassian.bamboo.index.AbstractIndexer
All Implemented Interfaces:
Indexer
Direct Known Subclasses:
DefaultBuildResultsIndexer, EnvironmentIndexerImpl, QuickSearchIndexerImpl, VersionIndexerImpl

public abstract class AbstractIndexer
extends java.lang.Object
implements Indexer

Should be in bamboo-core but bamboo-deployments depends on this


Nested Class Summary
protected  class AbstractIndexer.FlushAndUnlockIndexerQueueCallback
          FutureCallback that will flush and unlock indexer queue after last task has been processed.
protected  class AbstractIndexer.IndexAllCallable
           
protected  class AbstractIndexer.UpdateApproximateIndexingTimePerResultCallback
          FutureCallback that will calculate total execution time and store it after last task has been processed Single instance of this callback should be created and added to all created ListenableFutureTasks
 
Field Summary
protected  IndexerService indexerService
           
protected  com.atlassian.bonnie.ILuceneConnection luceneConnection
           
 
Constructor Summary
protected AbstractIndexer(com.atlassian.bonnie.ILuceneConnection luceneConnection, com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.config.db.HibernateConfig hibernateConfig, IndexerService indexerService)
           
 
Method Summary
 void deleteIndex()
          Delete existing index.
protected  void flushAndUnlockIndexerQueue(IndexerContext indexerContext)
           
protected  long getApproximateIndexingTimePerResult()
          Retrieve approximate time per result stored in Bandana for a given indexer.
protected  int getConcurrentIndexers()
           
protected  IndexerContext getDefaultIndexerContext()
           
protected abstract  BambooBandanaContext getIndexerBandanaContext()
           
 int getNumberOfDocuments()
           
protected  IndexerContext lockIndexerQueue()
           
protected  void updateApproximateIndexingTimePerResult(long totalIndexingTime, int entityCount)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.index.Indexer
getEstimatedReindexTime, indexAll
 

Field Detail

luceneConnection

protected final com.atlassian.bonnie.ILuceneConnection luceneConnection

indexerService

protected final IndexerService indexerService
Constructor Detail

AbstractIndexer

protected AbstractIndexer(com.atlassian.bonnie.ILuceneConnection luceneConnection,
                          com.atlassian.bandana.BandanaManager bandanaManager,
                          com.atlassian.config.db.HibernateConfig hibernateConfig,
                          IndexerService indexerService)
Method Detail

deleteIndex

public void deleteIndex()
Description copied from interface: Indexer
Delete existing index.

Specified by:
deleteIndex in interface Indexer

getNumberOfDocuments

public int getNumberOfDocuments()
Specified by:
getNumberOfDocuments in interface Indexer
Returns:
number of documents in the index

getIndexerBandanaContext

protected abstract BambooBandanaContext getIndexerBandanaContext()

getApproximateIndexingTimePerResult

protected long getApproximateIndexingTimePerResult()
Retrieve approximate time per result stored in Bandana for a given indexer.

Returns:
approximate time of indexing a single result in milliseconds

updateApproximateIndexingTimePerResult

protected void updateApproximateIndexingTimePerResult(long totalIndexingTime,
                                                      int entityCount)

getConcurrentIndexers

protected int getConcurrentIndexers()

getDefaultIndexerContext

@NotNull
protected IndexerContext getDefaultIndexerContext()

lockIndexerQueue

@NotNull
protected IndexerContext lockIndexerQueue()

flushAndUnlockIndexerQueue

protected void flushAndUnlockIndexerQueue(@NotNull
                                          IndexerContext indexerContext)


Copyright © 2014 Atlassian Software Systems Pty Ltd. All Rights Reserved.