@InterfaceAudience.Private public final class WALSplitUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WALSplitUtil.MutationReplay
A struct used by getMutationsFromWALEntry
|
| Modifier and Type | Method and Description |
|---|---|
static void |
finishSplitLogFile(String logfile,
org.apache.hadoop.conf.Configuration conf)
Completes the work done by splitLogFile by archiving logs
|
static long |
getMaxRegionSequenceId(org.apache.hadoop.conf.Configuration conf,
RegionInfo region,
ConcurrentMapUtils.IOExceptionSupplier<org.apache.hadoop.fs.FileSystem> rootFsSupplier,
ConcurrentMapUtils.IOExceptionSupplier<org.apache.hadoop.fs.FileSystem> walFsSupplier)
Deprecated.
Only for compatibility, will be removed in 4.0.0.
|
static long |
getMaxRegionSequenceId(org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.fs.Path regionDir)
Get the max sequence id which is stored in the region directory.
|
static List<WALSplitUtil.MutationReplay> |
getMutationsFromWALEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry entry,
CellScanner cells,
Pair<WALKey,WALEdit> logEntry,
Durability durability)
This function is used to construct mutations from a WALEntry.
|
static org.apache.hadoop.fs.FileStatus[] |
getRecoveredHFiles(org.apache.hadoop.fs.FileSystem rootFS,
org.apache.hadoop.fs.Path regionDir,
String familyName) |
static org.apache.hadoop.fs.Path |
getRegionDirRecoveredEditsDir(org.apache.hadoop.fs.Path regionDir) |
static NavigableSet<org.apache.hadoop.fs.Path> |
getSplitEditFilesSorted(org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.fs.Path regionDir)
Returns sorted set of edit files made by splitter, excluding files with '.temp' suffix.
|
static boolean |
hasRecoveredEdits(org.apache.hadoop.conf.Configuration conf,
RegionInfo regionInfo)
Check whether there is recovered.edits in the region dir
|
static boolean |
isSequenceIdFile(org.apache.hadoop.fs.Path file)
Is the given file a region open sequence id file.
|
static org.apache.hadoop.fs.Path |
moveAsideBadEditsFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path edits)
Move aside a bad edits file.
|
static void |
moveWAL(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.Path targetDir)
Move WAL.
|
static void |
writeRegionSequenceIdFile(org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.fs.Path regionDir,
long newMaxSeqId)
Create a file with name as region's max sequence id
|
public static void finishSplitLogFile(String logfile, org.apache.hadoop.conf.Configuration conf) throws IOException
It is invoked by SplitLogManager once it knows that one of the SplitLogWorkers have completed the splitLogFile() part. If the master crashes then this function might get called multiple times.
IOExceptionpublic static void moveWAL(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path p,
org.apache.hadoop.fs.Path targetDir)
throws IOException
IOExceptionpublic static org.apache.hadoop.fs.Path getRegionDirRecoveredEditsDir(org.apache.hadoop.fs.Path regionDir)
regionDir - This regions directory in the filesystem.regionDirpublic static boolean hasRecoveredEdits(org.apache.hadoop.conf.Configuration conf,
RegionInfo regionInfo)
throws IOException
conf - confregionInfo - the region to checkIOException@Deprecated public static long getMaxRegionSequenceId(org.apache.hadoop.conf.Configuration conf, RegionInfo region, ConcurrentMapUtils.IOExceptionSupplier<org.apache.hadoop.fs.FileSystem> rootFsSupplier, ConcurrentMapUtils.IOExceptionSupplier<org.apache.hadoop.fs.FileSystem> walFsSupplier) throws IOException
getMaxRegionSequenceId(FileSystem, Path) until 4.0.0 release.IOExceptionpublic static NavigableSet<org.apache.hadoop.fs.Path> getSplitEditFilesSorted(org.apache.hadoop.fs.FileSystem walFS, org.apache.hadoop.fs.Path regionDir) throws IOException
walFS - WAL FileSystem used to retrieving split edits files.regionDir - WAL region dir to look for recovered edits files under.regionDir as a sorted set.IOExceptionpublic static org.apache.hadoop.fs.Path moveAsideBadEditsFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path edits)
throws IOException
fs - the file system used to rename bad edits file.edits - Edits file to move aside.IOExceptionpublic static boolean isSequenceIdFile(org.apache.hadoop.fs.Path file)
public static long getMaxRegionSequenceId(org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.fs.Path regionDir)
throws IOException
IOExceptionpublic static void writeRegionSequenceIdFile(org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.fs.Path regionDir,
long newMaxSeqId)
throws IOException
IOExceptionpublic static List<WALSplitUtil.MutationReplay> getMutationsFromWALEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry entry, CellScanner cells, Pair<WALKey,WALEdit> logEntry, Durability durability) throws IOException
logEntry - pair of WALKey and WALEdit instance stores WALKey and WALEdit instances
extracted from the passed in WALEntry.IOExceptionpublic static org.apache.hadoop.fs.FileStatus[] getRecoveredHFiles(org.apache.hadoop.fs.FileSystem rootFS,
org.apache.hadoop.fs.Path regionDir,
String familyName)
throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.