Interface IndexMonitor
-
- All Known Implementing Classes:
IndexInfo
public interface IndexMonitorAn interface that exposes information about a Lucene Index and that allows registration of a listener for event notifications.- Author:
- dward
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddApplicationListener(org.springframework.context.ApplicationListener listener)Registers a listener for events on this index.longgetActualSize()Gets the actual size of the index in bytes.intgetNumberOfDocuments()Gets the number of documents in the index.intgetNumberOfFields()Gets the number of fields known to the index.intgetNumberOfIndexedFields()Gets the number of indexed fields.java.lang.StringgetRelativePath()Gets the relative path of the index directory.java.util.Map<java.lang.String,java.lang.Integer>getStatusSnapshot()Gets a snapshot of the statuses of the individual entries in this index.longgetUsedSize()Gets the size used on disk by the index directory.
-
-
-
Method Detail
-
getRelativePath
java.lang.String getRelativePath()
Gets the relative path of the index directory.- Returns:
- the relative path
-
getStatusSnapshot
java.util.Map<java.lang.String,java.lang.Integer> getStatusSnapshot()
Gets a snapshot of the statuses of the individual entries in this index.- Returns:
- a map of entry status names to entry counts
-
getActualSize
long getActualSize() throws java.io.IOExceptionGets the actual size of the index in bytes.- Returns:
- the actual size in bytes
- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
getUsedSize
long getUsedSize() throws java.io.IOExceptionGets the size used on disk by the index directory. A large discrepancy from the value returned bygetActualSize()may indicate that there are unused data files.- Returns:
- the size on disk in bytes
- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
getNumberOfDocuments
int getNumberOfDocuments() throws java.io.IOExceptionGets the number of documents in the index.- Returns:
- the number of documents
- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
getNumberOfFields
int getNumberOfFields() throws java.io.IOExceptionGets the number of fields known to the index.- Returns:
- the number of fields
- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
getNumberOfIndexedFields
int getNumberOfIndexedFields() throws java.io.IOExceptionGets the number of indexed fields.- Returns:
- the number of indexed fields
- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
addApplicationListener
void addApplicationListener(org.springframework.context.ApplicationListener listener)
Registers a listener for events on this index.- Parameters:
listener- the listener
-
-