Interface IndexMonitor

  • All Known Implementing Classes:
    IndexInfo

    public interface IndexMonitor
    An interface that exposes information about a Lucene Index and that allows registration of a listener for event notifications.
    Author:
    dward
    • 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.IOException
        Gets 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.IOException
        Gets the size used on disk by the index directory. A large discrepancy from the value returned by getActualSize() 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.IOException
        Gets 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.IOException
        Gets 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.IOException
        Gets 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