Interface MCollection

    • Method Detail

      • getCollectionName

        String getCollectionName()
        The name of the collection
        Returns:
        name of the collection
      • getRoot

        String getRoot()
        Get common root directory of all MFiles in the collection - may be null
        Returns:
        root directory name, or null.
      • extractDate

        CalendarDate extractDate​(MFile mfile)
        Use the date extractor to extract the date from the filename. Only call if hasDateExtractor() == true.
        Parameters:
        mfile - extract from here
        Returns:
        Date, or null if none
      • hasDateExtractor

        boolean hasDateExtractor()
        Does this CollectionManager have the ability to extract a date from the MFile ?
        Returns:
        true if CollectionManager has a DateExtractor
      • getPartitionDate

        CalendarDate getPartitionDate()
        The date to partition on, usually the starting date of the collection.
        Returns:
        partition date of the collection, or null if unknown
      • close

        void close()
        Close and release any resources. Do not make further calls on this object.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
      • getProtoIndex

        int getProtoIndex​(int n)
        Choose Proto dataset as index from [0..n-1], based on configuration.
        Parameters:
        n - size to choose from
        Returns:
        index within range [0..n-1]
      • getLastModified

        long getLastModified()
        last time this collection was modified
        Returns:
        msess since epoch
      • getIndexFilename

        String getIndexFilename​(String suffix)
      • getFilesSorted

        Iterable<MFile> getFilesSorted()
                                throws IOException
        Get the current collection of MFile. if hasDateExtractor() == true, these will be sorted by Date, otherwise by path.
        Returns:
        current collection of MFile as an Iterable.
        Throws:
        IOException
      • getLatestFile

        MFile getLatestFile()
                     throws IOException
        The latest file in the collection. Only call if hasDateExtractor() == true.
        Returns:
        latest file in the collection
        Throws:
        IOException
      • getFileIterator

        CloseableIterator<MFile> getFileIterator()
                                          throws IOException
        Get the current collection of MFile, no guaranteed order. May be faster than getFilesSorted() for large collections, use when order is not important.
         try (CloseableIterator iter = getFileIterator()) {
           while (iter.hasNext()) {
             MFile file = iter.next();
           }
         }
         
        Returns:
        current collection of MFile as an CloseableIterator.
        Throws:
        IOException
      • putAuxInfo

        void putAuxInfo​(String key,
                        Object value)