Class LedgerDirUtil


  • public class LedgerDirUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LedgerDirUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.Integer> compactedLogIdsInDirectory​(java.io.File directory)  
      static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,​java.lang.Integer> findLargestGap​(java.util.List<java.lang.Integer> currentIds)
      O(nlogn) algorithm to find largest contiguous gap between integers in a passed list.
      static java.util.List<java.lang.Integer> logIdsInDirectory​(java.io.File directory)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FILE_PATTERN

        public static final java.util.regex.Pattern FILE_PATTERN
      • COMPACTED_FILE_PATTERN

        public static final java.util.regex.Pattern COMPACTED_FILE_PATTERN
    • Constructor Detail

      • LedgerDirUtil

        public LedgerDirUtil()
    • Method Detail

      • logIdsInDirectory

        public static java.util.List<java.lang.Integer> logIdsInDirectory​(java.io.File directory)
      • compactedLogIdsInDirectory

        public static java.util.List<java.lang.Integer> compactedLogIdsInDirectory​(java.io.File directory)
      • findLargestGap

        public static org.apache.commons.lang3.tuple.Pair<java.lang.Integer,​java.lang.Integer> findLargestGap​(java.util.List<java.lang.Integer> currentIds)
        O(nlogn) algorithm to find largest contiguous gap between integers in a passed list. n should be relatively small. Entry logs should be about 1GB in size, so even if the node stores a PB, there should be only 1000000 entry logs.