Package org.apache.bookkeeper.util
Class LedgerDirUtil
- java.lang.Object
-
- org.apache.bookkeeper.util.LedgerDirUtil
-
public class LedgerDirUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
COMPACTED_FILE_PATTERN
static java.util.regex.Pattern
FILE_PATTERN
-
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)
-
-
-
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.
-
-