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 Modifier Constructor Description protected
IndexCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description I
addWriteIndex(I index)
I
getSearchIndex()
Returns the current search index version.I
getWriteIndex(int version)
Collection<I>
getWriteIndexes()
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.
-
-
-
Method Detail
-
getSearchIndex
public I getSearchIndex()
Returns the current search index version.
-
setSearchIndex
public void setSearchIndex(I index)
-
setSearchIndex
public void setSearchIndex(I index, boolean closeOld)
-
getWriteIndexes
public Collection<I> getWriteIndexes()
-
removeWriteIndex
public void removeWriteIndex(int version)
-
getWriteIndex
public I getWriteIndex(int version)
-
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
-
-