public abstract class AbstractVersionManager extends Object implements LifecycleListener
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractVersionManager.Version<V> |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,IndexDefinition<?,?,?>> |
defs |
protected boolean |
onlineUpgrade |
protected Map<String,OnlineReindexer<?,?,?>> |
reindexers |
protected String |
runReindexMsg |
protected SitePaths |
sitePaths |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractVersionManager(org.eclipse.jgit.lib.Config cfg,
SitePaths sitePaths,
Collection<IndexDefinition<?,?,?>> defs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
activateLatestIndex(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) |
protected abstract <V> boolean |
isDirty(Collection<AbstractVersionManager.Version<V>> inUse,
AbstractVersionManager.Version<V> v) |
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(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 String runReindexMsg
protected final SitePaths sitePaths
protected final Map<String,IndexDefinition<?,?,?>> defs
protected final Map<String,OnlineReindexer<?,?,?>> reindexers
protected AbstractVersionManager(org.eclipse.jgit.lib.Config cfg,
SitePaths sitePaths,
Collection<IndexDefinition<?,?,?>> defs)
public void start()
LifecycleListenerstart in interface LifecycleListenerpublic void stop()
LifecycleListenerstop in interface LifecycleListenerpublic boolean startReindexer(String name, boolean force) throws ReindexerAlreadyRunningException
name - index nameforce - start re-indexReindexerAlreadyRunningExceptionpublic boolean activateLatestIndex(String name) throws ReindexerAlreadyRunningException
name - index nameReindexerAlreadyRunningExceptionprotected <K,V,I extends Index<K,V>> void initIndex(IndexDefinition<K,V,I> def, GerritIndexStatus cfg)
protected GerritIndexStatus createIndexStatus()
protected abstract <V> boolean isDirty(Collection<AbstractVersionManager.Version<V>> inUse, AbstractVersionManager.Version<V> v)
protected abstract <K,V,I extends Index<K,V>> TreeMap<Integer,AbstractVersionManager.Version<V>> scanVersions(IndexDefinition<K,V,I> def, GerritIndexStatus cfg)