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,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<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 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 VersionManager(SitePaths sitePaths, DynamicSet<OnlineUpgradeListener> listeners, java.util.Collection<IndexDefinition<?,?,?>> defs, boolean onlineUpgrade)
public static boolean getOnlineUpgrade(org.eclipse.jgit.lib.Config cfg)
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,VersionManager.Version<V>> scanVersions(IndexDefinition<K,V,I> def, GerritIndexStatus cfg)