Class DefaultIndexPacker

  • All Implemented Interfaces:
    IndexPacker

    @Singleton
    @Named
    public class DefaultIndexPacker
    extends java.lang.Object
    implements IndexPacker
    A default IndexPacker implementation. Creates the properties, legacy index zip and new gz files.
    • Field Detail

      • logger

        private final org.slf4j.Logger logger
    • Constructor Detail

      • DefaultIndexPacker

        @Inject
        public DefaultIndexPacker​(IncrementalHandler incrementalHandler)
    • Method Detail

      • getLogger

        protected org.slf4j.Logger getLogger()
      • packIndex

        public void packIndex​(IndexPackingRequest request)
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException
        Description copied from interface: IndexPacker
        Pack a context into a target directory. If the directory does not exists, it will be created. If the directory exists, it should be writable.
        Specified by:
        packIndex in interface IndexPacker
        Parameters:
        request - the request to process.
        Throws:
        java.io.IOException - on lethal IO problem
        java.lang.IllegalArgumentException - when the targetDir already exists and is not a writable directory.
      • readIndexProperties

        private java.util.Properties readIndexProperties​(IndexPackingRequest request)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • writeIndexData

        void writeIndexData​(IndexPackingRequest request,
                            java.util.List<java.lang.Integer> docIndexes,
                            java.io.File targetArchive)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • writeIndexProperties

        void writeIndexProperties​(IndexPackingRequest request,
                                  java.util.Properties info)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • format

        private java.lang.String format​(java.util.Date d)