@InterfaceAudience.Private public class HLogSplitter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HLogSplitter.MutationReplay
A struct used by getMutationsFromWALEntry
|
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected boolean |
distributedLogReplay |
protected String |
failedServerName |
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 |
protected AtomicReference<Throwable> |
thrown |
Modifier and Type | Method and Description |
---|---|
protected HLog.Writer |
createWriter(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logfile,
org.apache.hadoop.conf.Configuration conf)
Create a new
HLog.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 List<HLogSplitter.MutationReplay> |
getMutationsFromWALEntry(AdminProtos.WALEntry entry,
CellScanner cells,
Pair<HLogKey,WALEdit> logEntry,
boolean addLogReplayTag)
This function is used to construct mutations from a WALEntry.
|
protected HLog.Reader |
getReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus file,
org.apache.hadoop.conf.Configuration conf,
boolean skipErrors,
CancelableProgressable reporter)
Create a new
HLog.Reader for reading logs to split. |
protected HLog.Reader |
getReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path curLogFile,
org.apache.hadoop.conf.Configuration conf,
CancelableProgressable reporter)
Create a new
HLog.Reader for reading logs to split. |
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) |
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,
ZooKeeperWatcher zkw,
ZooKeeperProtos.SplitLogTask.RecoveryMode mode)
Splits a HLog file into region's recovered-edits directory.
|
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 AtomicReference<Throwable> thrown
protected final LastSequenceId sequenceIdChecker
protected boolean distributedLogReplay
protected String failedServerName
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, ZooKeeperWatcher zkw, ZooKeeperProtos.SplitLogTask.RecoveryMode mode) throws IOException
If the log file has N regions then N recovered.edits files will be produced.
rootDir
- logfile
- fs
- conf
- reporter
- idChecker
- zkw
- ZooKeeperWatcher if it's null, we will back to the old-style log splitting where we
dump out recoved.edits files for regions to replay on.IOException
public 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) throws IOException
IOException
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.
logfile
- conf
- IOException
protected HLog.Reader getReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus file, org.apache.hadoop.conf.Configuration conf, boolean skipErrors, CancelableProgressable reporter) throws IOException, org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.CorruptedLogFileException
HLog.Reader
for reading logs to split.fs
- file
- conf
- IOException
CorruptedLogFileException
org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.CorruptedLogFileException
protected HLog.Writer createWriter(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path logfile, org.apache.hadoop.conf.Configuration conf) throws IOException
HLog.Writer
for writing log splits.IOException
protected HLog.Reader getReader(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path curLogFile, org.apache.hadoop.conf.Configuration conf, CancelableProgressable reporter) throws IOException
HLog.Reader
for reading logs to split.IOException
public static List<HLogSplitter.MutationReplay> getMutationsFromWALEntry(AdminProtos.WALEntry entry, CellScanner cells, Pair<HLogKey,WALEdit> logEntry, boolean addLogReplayTag) throws IOException
entry
- cells
- logEntry
- pair of HLogKey and WALEdit instance stores HLogKey and WALEdit instances
extracted from the passed in WALEntry.addLogReplayTag
- IOException
Copyright © 2014 The Apache Software Foundation. All rights reserved.