public abstract class VersionManager extends java.lang.Object implements LifecycleListener
| Modifier and Type | Class and Description |
|---|---|
static class |
VersionManager.Version<V> |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,com.google.gerrit.index.IndexDefinition<?,?,?>> |
defs |
protected boolean |
onlineUpgrade |
protected java.util.Map<java.lang.String,OnlineReindexer<?,?,?>> |
reindexers |
protected java.lang.String |
runReindexMsg |
protected SitePaths |
sitePaths |
| Modifier | Constructor and Description |
|---|---|
protected |
VersionManager(SitePaths sitePaths,
DynamicSet<OnlineUpgradeListener> listeners,
java.util.Collection<com.google.gerrit.index.IndexDefinition<?,?,?>> defs,
boolean onlineUpgrade) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
activateLatestIndex(java.lang.String name)
Activate the latest index if the current index is not already the latest.
|
protected GerritIndexStatus |
createIndexStatus() |
static boolean |
getOnlineUpgrade(org.eclipse.jgit.lib.Config cfg) |
protected <K,V,I extends com.google.gerrit.index.Index<K,V>> |
initIndex(com.google.gerrit.index.IndexDefinition<K,V,I> def,
GerritIndexStatus cfg) |
boolean |
isKnownIndex(java.lang.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>> |
scanVersions(com.google.gerrit.index.IndexDefinition<K,V,I> def,
GerritIndexStatus cfg) |
void |
start()
Invoked when the server is starting.
|
boolean |
startReindexer(java.lang.String name,
boolean force)
Start the online reindexer if the current index is not already the latest.
|
void |
stop()
Invoked when the server is stopping.
|
protected final boolean onlineUpgrade
protected final java.lang.String runReindexMsg
protected final SitePaths sitePaths
protected final java.util.Map<java.lang.String,com.google.gerrit.index.IndexDefinition<?,?,?>> defs
protected final java.util.Map<java.lang.String,OnlineReindexer<?,?,?>> reindexers
protected VersionManager(SitePaths sitePaths, DynamicSet<OnlineUpgradeListener> listeners, java.util.Collection<com.google.gerrit.index.IndexDefinition<?,?,?>> defs, boolean onlineUpgrade)
public static boolean getOnlineUpgrade(org.eclipse.jgit.lib.Config cfg)
public void start()
LifecycleListenerstart in interface LifecycleListenerpublic void stop()
LifecycleListenerstop in interface LifecycleListenerpublic boolean startReindexer(java.lang.String name,
boolean force)
throws ReindexerAlreadyRunningException
name - index nameforce - start re-indexReindexerAlreadyRunningExceptionpublic boolean activateLatestIndex(java.lang.String name)
throws ReindexerAlreadyRunningException
name - index nameReindexerAlreadyRunningExceptionpublic boolean isKnownIndex(java.lang.String name)
name - index nameprotected <K,V,I extends com.google.gerrit.index.Index<K,V>> void initIndex(com.google.gerrit.index.IndexDefinition<K,V,I> def,
GerritIndexStatus cfg)
protected GerritIndexStatus createIndexStatus()
protected abstract <K,V,I extends com.google.gerrit.index.Index<K,V>> java.util.TreeMap<java.lang.Integer,VersionManager.Version<V>> scanVersions(com.google.gerrit.index.IndexDefinition<K,V,I> def, GerritIndexStatus cfg)