Package com.google.gerrit.server.index
Class VersionManager
- java.lang.Object
- 
- com.google.gerrit.server.index.VersionManager
 
- 
- All Implemented Interfaces:
- LifecycleListener,- EventListener
 
 public abstract class VersionManager extends Object implements LifecycleListener 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classVersionManager.Version<V>
 - 
Field SummaryFields Modifier and Type Field Description protected Map<String,com.google.gerrit.index.IndexDefinition<?,?,?>>defsprotected booleanonlineUpgradeprotected Map<String,OnlineReindexer<?,?,?>>reindexersprotected StringrunReindexMsgprotected SitePathssitePaths
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedVersionManager(SitePaths sitePaths, DynamicSet<OnlineUpgradeListener> listeners, Collection<com.google.gerrit.index.IndexDefinition<?,?,?>> defs, boolean onlineUpgrade)
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanactivateLatestIndex(String name)Activate the latest index if the current index is not already the latest.protected GerritIndexStatuscreateIndexStatus()static booleangetOnlineUpgrade(org.eclipse.jgit.lib.Config cfg)protected <K,V,I extends com.google.gerrit.index.Index<K,V>>
 voidinitIndex(com.google.gerrit.index.IndexDefinition<K,V,I> def, GerritIndexStatus cfg)booleanisKnownIndex(String name)Tells if an index with this name is currently known or not.protected abstract <K,V,I extends com.google.gerrit.index.Index<K,V>>
 TreeMap<Integer,VersionManager.Version<V>>scanVersions(com.google.gerrit.index.IndexDefinition<K,V,I> def, GerritIndexStatus cfg)voidstart()Invoked when the server is starting.booleanstartReindexer(String name, boolean force)Start the online reindexer if the current index is not already the latest.voidstop()Invoked when the server is stopping.
 
- 
- 
- 
Field Detail- 
onlineUpgradeprotected final boolean onlineUpgrade 
 - 
runReindexMsgprotected final String runReindexMsg 
 - 
sitePathsprotected final SitePaths sitePaths 
 - 
reindexersprotected final Map<String,OnlineReindexer<?,?,?>> reindexers 
 
- 
 - 
Constructor Detail- 
VersionManagerprotected VersionManager(SitePaths sitePaths, DynamicSet<OnlineUpgradeListener> listeners, Collection<com.google.gerrit.index.IndexDefinition<?,?,?>> defs, boolean onlineUpgrade) 
 
- 
 - 
Method Detail- 
getOnlineUpgradepublic static boolean getOnlineUpgrade(org.eclipse.jgit.lib.Config cfg) 
 - 
startpublic void start() Description copied from interface:LifecycleListenerInvoked when the server is starting.- Specified by:
- startin interface- LifecycleListener
 
 - 
stoppublic void stop() Description copied from interface:LifecycleListenerInvoked when the server is stopping.- Specified by:
- stopin interface- LifecycleListener
 
 - 
startReindexerpublic boolean startReindexer(String name, boolean force) throws ReindexerAlreadyRunningException Start the online reindexer if the current index is not already the latest.- Parameters:
- name- index name
- force- start re-index
- Returns:
- true if started, otherwise false.
- Throws:
- ReindexerAlreadyRunningException
 
 - 
activateLatestIndexpublic boolean activateLatestIndex(String name) throws ReindexerAlreadyRunningException Activate the latest index if the current index is not already the latest.- Parameters:
- name- index name
- Returns:
- true if index was activated, otherwise false.
- Throws:
- ReindexerAlreadyRunningException
 
 - 
isKnownIndexpublic boolean isKnownIndex(String name) Tells if an index with this name is currently known or not.- Parameters:
- name- index name
- Returns:
- true if index is known and can be used, otherwise false.
 
 - 
initIndexprotected <K,V,I extends com.google.gerrit.index.Index<K,V>> void initIndex(com.google.gerrit.index.IndexDefinition<K,V,I> def, GerritIndexStatus cfg)
 - 
createIndexStatusprotected GerritIndexStatus createIndexStatus() 
 - 
scanVersionsprotected abstract <K,V,I extends com.google.gerrit.index.Index<K,V>> TreeMap<Integer,VersionManager.Version<V>> scanVersions(com.google.gerrit.index.IndexDefinition<K,V,I> def, GerritIndexStatus cfg) 
 
- 
 
-