Class LedgerDirUtil

java.lang.Object
org.apache.bookkeeper.util.LedgerDirUtil

public class LedgerDirUtil extends Object
  • Field Details

    • FILE_PATTERN

      public static final Pattern FILE_PATTERN
    • COMPACTED_FILE_PATTERN

      public static final Pattern COMPACTED_FILE_PATTERN
  • Constructor Details

    • LedgerDirUtil

      public LedgerDirUtil()
  • Method Details

    • logIdsInDirectory

      public static List<Integer> logIdsInDirectory(File directory)
    • compactedLogIdsInDirectory

      public static List<Integer> compactedLogIdsInDirectory(File directory)
    • findLargestGap

      public static org.apache.commons.lang3.tuple.Pair<Integer,Integer> findLargestGap(List<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.