public abstract class AbstractVersionManager extends java.lang.Object implements LifecycleListener
Modifier and Type | Class and Description |
---|---|
static class |
AbstractVersionManager.Version<V> |
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,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 |
AbstractVersionManager(org.eclipse.jgit.lib.Config cfg,
SitePaths sitePaths,
java.util.Collection<IndexDefinition<?,?,?>> defs) |
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() |
protected <K,V,I extends Index<K,V>> |
initIndex(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 Index<K,V>> |
scanVersions(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,IndexDefinition<?,?,?>> defs
protected final java.util.Map<java.lang.String,OnlineReindexer<?,?,?>> reindexers
protected AbstractVersionManager(org.eclipse.jgit.lib.Config cfg, SitePaths sitePaths, java.util.Collection<IndexDefinition<?,?,?>> defs)
public void start()
LifecycleListener
start
in interface LifecycleListener
public void stop()
LifecycleListener
stop
in interface LifecycleListener
public boolean startReindexer(java.lang.String name, boolean force) throws ReindexerAlreadyRunningException
name
- index nameforce
- start re-indexReindexerAlreadyRunningException
public boolean activateLatestIndex(java.lang.String name) throws ReindexerAlreadyRunningException
name
- index nameReindexerAlreadyRunningException
public boolean isKnownIndex(java.lang.String name)
name
- index nameprotected <K,V,I extends Index<K,V>> void initIndex(IndexDefinition<K,V,I> def, GerritIndexStatus cfg)
protected GerritIndexStatus createIndexStatus()
protected abstract <K,V,I extends Index<K,V>> java.util.TreeMap<java.lang.Integer,AbstractVersionManager.Version<V>> scanVersions(IndexDefinition<K,V,I> def, GerritIndexStatus cfg)