Class StoreUtils
java.lang.Object
org.apache.hadoop.hbase.regionserver.StoreUtils
Utility functions for region server storage layer.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hadoop.conf.Configuration
createStoreConfiguration
(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, ColumnFamilyDescriptor cfd) static int
getBytesPerChecksum
(org.apache.hadoop.conf.Configuration conf) Returns the configured bytesPerChecksum value.static ChecksumType
getChecksumType
(org.apache.hadoop.conf.Configuration conf) Returns the configured checksum algorithm.static OptionalInt
Creates a deterministic hash code for store file collection.(package private) static Optional<byte[]>
getFileSplitPoint
(HStoreFile file, CellComparator comparator) Gets the approximate mid-point of the given file that is optimal for use in splitting it.(package private) static Optional<HStoreFile>
getLargestFile
(Collection<HStoreFile> candidates) Gets the largest file (with reader) out of the list of files.static long
getLowestTimestamp
(Collection<HStoreFile> candidates) Gets lowest timestamp from candidate StoreFilesstatic OptionalLong
Return the largest memstoreTS found across all storefiles in the given list.static OptionalLong
Return the highest sequence ID found across all storefiles in the given list.(package private) static Optional<byte[]>
getSplitPoint
(Collection<HStoreFile> storefiles, CellComparator comparator) Gets the mid point of the largest file passed in as split point.static long
static long
getStorefilesSize
(Collection<HStoreFile> files, Predicate<HStoreFile> predicate) static long
getTotalUncompressedBytes
(List<HStoreFile> files) static boolean
hasReferences
(Collection<HStoreFile> files) Determines whether any files in the collection are references.static List<StoreFileInfo>
toStoreFileInfo
(Collection<HStoreFile> storefiles)
-
Field Details
-
LOG
-
-
Constructor Details
-
StoreUtils
private StoreUtils()
-
-
Method Details
-
getDeterministicRandomSeed
Creates a deterministic hash code for store file collection. -
hasReferences
Determines whether any files in the collection are references.- Parameters:
files
- The files.
-
getLowestTimestamp
Gets lowest timestamp from candidate StoreFiles- Throws:
IOException
-
getLargestFile
Gets the largest file (with reader) out of the list of files.- Parameters:
candidates
- The files to choose from.- Returns:
- The largest file; null if no file has a reader.
-
getMaxMemStoreTSInList
Return the largest memstoreTS found across all storefiles in the given list. Store files that were created by a mapreduce bulk load are ignored, as they do not correspond to any specific put operation, and thus do not have a memstoreTS associated with them. -
getMaxSequenceIdInList
Return the highest sequence ID found across all storefiles in the given list. -
getFileSplitPoint
static Optional<byte[]> getFileSplitPoint(HStoreFile file, CellComparator comparator) throws IOException Gets the approximate mid-point of the given file that is optimal for use in splitting it.- Parameters:
file
- the store filecomparator
- Comparator used to compare KVs.- Returns:
- The split point row, or null if splitting is not possible, or reader is null.
- Throws:
IOException
-
getSplitPoint
static Optional<byte[]> getSplitPoint(Collection<HStoreFile> storefiles, CellComparator comparator) throws IOException Gets the mid point of the largest file passed in as split point.- Throws:
IOException
-
getChecksumType
Returns the configured checksum algorithm.- Parameters:
conf
- The configuration- Returns:
- The checksum algorithm that is set in the configuration
-
getBytesPerChecksum
Returns the configured bytesPerChecksum value.- Parameters:
conf
- The configuration- Returns:
- The bytesPerChecksum that is set in the configuration
-
createStoreConfiguration
public static org.apache.hadoop.conf.Configuration createStoreConfiguration(org.apache.hadoop.conf.Configuration conf, TableDescriptor td, ColumnFamilyDescriptor cfd) -
toStoreFileInfo
-
getTotalUncompressedBytes
-
getStorefilesSize
-
getStorefileFieldSize
-