Package com.google.gerrit.server.index
Class OnlineReindexer<K,V,I extends Index<K,V>>
java.lang.Object
com.google.gerrit.server.index.OnlineReindexer<K,V,I>
Background thread for running an index schema upgrade by reindexing all documents in an index
using the new version. Intended to be run while Gerrit is serving traffic to prepare for a
near-zero downtime upgrade.
-
Constructor Summary
ConstructorsConstructorDescriptionOnlineReindexer
(IndexDefinition<K, V, I> def, int oldVersion, int newVersion, PluginSetContext<OnlineUpgradeListener> listeners, boolean reuseExistingDocuments) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Switches the search index from the old version to the new version.int
Returns the index version that this indexer is creating documents for.boolean
Returnstrue
if the background indexer is currently running.void
start()
Starts the background process.
-
Constructor Details
-
OnlineReindexer
public OnlineReindexer(IndexDefinition<K, V, I> def, int oldVersion, int newVersion, PluginSetContext<OnlineUpgradeListener> listeners, boolean reuseExistingDocuments)
-
-
Method Details
-
start
public void start()Starts the background process. -
isRunning
public boolean isRunning()Returnstrue
if the background indexer is currently running. -
getVersion
public int getVersion()Returns the index version that this indexer is creating documents for. -
activateIndex
public void activateIndex()Switches the search index from the old version to the new version. This method should be called when the new version is fully ready.
-