Class LedgerDirUtil

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

      Constructor Description
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.Integer> compactedLogIdsInDirectory​( 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​( directory)  
      • Methods inherited from class java.lang.Object

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


        public static final java.util.regex.Pattern 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​( directory)
      • compactedLogIdsInDirectory

        public static java.util.List<java.lang.Integer> compactedLogIdsInDirectory​( 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.