Class IndexReplicationHandler

    • Constructor Detail

      • IndexReplicationHandler

        public IndexReplicationHandler​(Directory indexDir,
                                       Callable<Boolean> callback)
                                throws IOException
        Deprecated.
        Constructor with the given index directory and callback to notify when the indexes were updated.
        Throws:
        IOException
    • Method Detail

      • getSegmentsFile

        public static String getSegmentsFile​(List<String> files,
                                             boolean allowEmpty)
        Deprecated.
        Verifies that the last file is segments_N and fails otherwise. It also removes and returns the file from the list, because it needs to be handled last, after all files. This is important in order to guarantee that if a reader sees the new segments_N, all other segment files are already on stable storage.

        The reason why the code fails instead of putting segments_N file last is that this indicates an error in the Revision implementation.

      • cleanupFilesOnFailure

        public static void cleanupFilesOnFailure​(Directory dir,
                                                 List<String> files)
        Deprecated.
        Cleanup the index directory by deleting all given files. Called when file copy or sync failed.
      • cleanupOldIndexFiles

        public static void cleanupOldIndexFiles​(Directory dir,
                                                String segmentsFile,
                                                InfoStream infoStream)
        Deprecated.
        Cleans up the index directory from old index files. This method uses the last commit found by getLastCommit(Directory). If it matches the expected segmentsFile, then all files not referenced by this commit point are deleted.

        NOTE: this method does a best effort attempt to clean the index directory. It suppresses any exceptions that occur, as this can be retried the next time.

      • setInfoStream

        public void setInfoStream​(InfoStream infoStream)
        Deprecated.
        Sets the InfoStream to use for logging messages.