@InterfaceAudience.Private public class WALSplitter extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WALSplitter.EntryBuffers
Class which accumulates edits and separates them into a buffer per region
while simultaneously accounting RAM usage.
|
static class |
WALSplitter.MutationReplay
A struct used by getMutationsFromWALEntry
|
static class |
WALSplitter.OutputSink
The following class is an abstraction class to provide a common interface to support
different ways of consuming recovered edits.
|
static class |
WALSplitter.PipelineController
Contains some methods to control WAL-entries producer / consumer interactions
|
static class |
WALSplitter.RegionEntryBuffer
A buffer of some number of edits for a given region.
|
static class |
WALSplitter.SinkWriter
Class wraps the actual writer which writes data out and related statistics
|
static class |
WALSplitter.WriterThread |
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.fs.FileSystem |
fs |
protected Map<String,Long> |
lastFlushedSequenceIds |
protected Map<String,Map<byte[],Long>> |
regionMaxSeqIdInStores |
protected org.apache.hadoop.fs.Path |
rootDir |
protected LastSequenceId |
sequenceIdChecker |
static boolean |
SPLIT_SKIP_ERRORS_DEFAULT
By default we retry errors in splitting, rather than skipping.
|
static String |
SPLIT_WRITER_CREATION_BOUNDED |
| Modifier and Type | Method and Description |
|---|---|
protected WALProvider.Writer |
createWriter(org.apache.hadoop.fs.Path logfile)
Create a new
WALProvider.Writer for writing log splits. |
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.fs.FileSystem fs,
org.apache.hadoop.fs.Path regionDir)
Get the max sequence id which is stored in the region directory.
|
static List<WALSplitter.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.
|
protected WAL.Reader |
getReader(org.apache.hadoop.fs.FileStatus file,
boolean skipErrors,
CancelableProgressable reporter)
Create a new
WAL.Reader for reading logs to split. |
protected WAL.Reader |
getReader(org.apache.hadoop.fs.Path curLogFile,
CancelableProgressable reporter)
Create a new
WAL.Reader for reading logs to split. |
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 fs,
org.apache.hadoop.fs.Path regiondir)
Returns sorted set of edit files made by splitter, excluding files
with '.temp' suffix.
|
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 List<org.apache.hadoop.fs.Path> |
split(org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.Path logDir,
org.apache.hadoop.fs.Path oldLogDir,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
WALFactory factory) |
static boolean |
splitLogFile(org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.FileStatus logfile,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
CancelableProgressable reporter,
LastSequenceId idChecker,
SplitLogWorkerCoordination splitLogWorkerCoordination,
WALFactory factory)
Splits a WAL file into region's recovered-edits directory.
|
static void |
writeRegionSequenceIdFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path regionDir,
long newMaxSeqId)
Create a file with name as region's max sequence id
|
public static final boolean SPLIT_SKIP_ERRORS_DEFAULT
protected final org.apache.hadoop.fs.Path rootDir
protected final org.apache.hadoop.fs.FileSystem fs
protected final org.apache.hadoop.conf.Configuration conf
protected final LastSequenceId sequenceIdChecker
public static final String SPLIT_WRITER_CREATION_BOUNDED
public static boolean splitLogFile(org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.FileStatus logfile,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
CancelableProgressable reporter,
LastSequenceId idChecker,
SplitLogWorkerCoordination splitLogWorkerCoordination,
WALFactory factory)
throws IOException
If the log file has N regions then N recovered.edits files will be produced.
IOExceptionpublic static List<org.apache.hadoop.fs.Path> split(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path logDir, org.apache.hadoop.fs.Path oldLogDir, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, WALFactory factory) throws IOException
IOExceptionpublic 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.
logfile - conf - IOExceptionpublic static org.apache.hadoop.fs.Path getRegionDirRecoveredEditsDir(org.apache.hadoop.fs.Path regiondir)
regiondir - This regions directory in the filesystem.regiondirpublic static NavigableSet<org.apache.hadoop.fs.Path> getSplitEditFilesSorted(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path regiondir) throws IOException
fs - regiondir - 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 - 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 fs,
org.apache.hadoop.fs.Path regionDir)
throws IOException
IOExceptionpublic static void writeRegionSequenceIdFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path regionDir,
long newMaxSeqId)
throws IOException
IOExceptionprotected WAL.Reader getReader(org.apache.hadoop.fs.FileStatus file, boolean skipErrors, CancelableProgressable reporter) throws IOException, org.apache.hadoop.hbase.wal.WALSplitter.CorruptedLogFileException
WAL.Reader for reading logs to split.file - IOExceptionCorruptedLogFileExceptionorg.apache.hadoop.hbase.wal.WALSplitter.CorruptedLogFileExceptionprotected WALProvider.Writer createWriter(org.apache.hadoop.fs.Path logfile) throws IOException
WALProvider.Writer for writing log splits.IOExceptionprotected WAL.Reader getReader(org.apache.hadoop.fs.Path curLogFile, CancelableProgressable reporter) throws IOException
WAL.Reader for reading logs to split.IOExceptionpublic static List<WALSplitter.MutationReplay> getMutationsFromWALEntry(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry entry, CellScanner cells, Pair<WALKey,WALEdit> logEntry, Durability durability) throws IOException
entry - cells - logEntry - pair of WALKey and WALEdit instance stores WALKey and WALEdit instances
extracted from the passed in WALEntry.IOExceptionCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.