Package com.google.gerrit.index
Class IndexCollection<K,V,I extends Index<K,V>>
java.lang.Object
com.google.gerrit.index.IndexCollection<K,V,I>
- All Implemented Interfaces:
LifecycleListener
,EventListener
- Direct Known Subclasses:
AccountIndexCollection
,ChangeIndexCollection
,GroupIndexCollection
public abstract class IndexCollection<K,V,I extends Index<K,V>>
extends Object
implements LifecycleListener
Dynamic pointers to the index versions used for searching and writing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddWriteIndex
(I index) Returns the current search index version.getWriteIndex
(int version) void
removeWriteIndex
(int version) void
setSearchIndex
(I index) void
setSearchIndex
(I index, boolean closeOld) void
start()
Invoked when the server is starting.void
stop()
Invoked when the server is stopping.
-
Constructor Details
-
IndexCollection
protected IndexCollection()
-
-
Method Details
-
getSearchIndex
Returns the current search index version. -
setSearchIndex
-
setSearchIndex
-
getWriteIndexes
-
addWriteIndex
-
removeWriteIndex
public void removeWriteIndex(int version) -
getWriteIndex
-
start
public void start()Description copied from interface:LifecycleListener
Invoked when the server is starting.- Specified by:
start
in interfaceLifecycleListener
-
stop
public void stop()Description copied from interface:LifecycleListener
Invoked when the server is stopping.- Specified by:
stop
in interfaceLifecycleListener
-