@InterfaceAudience.Private public class WALSplitter extends Object
split(Path, Path, Path, FileSystem, Configuration, WALFactory)
or
splitLogFile(Path, FileStatus, FileSystem, Configuration, CancelableProgressable,
LastSequenceId, SplitLogWorkerCoordination, WALFactory, RegionServerServices)
for
entry-point.Modifier and Type | Class and Description |
---|---|
(package private) static class |
WALSplitter.CorruptedLogFileException |
static class |
WALSplitter.PipelineController
Contains some methods to control WAL-entries producer / consumer interactions
|
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
static boolean |
DEFAULT_WAL_SPLIT_TO_HFILE |
private EntryBuffers |
entryBuffers |
private org.apache.hadoop.fs.FileStatus |
fileBeingSplit |
protected Map<String,Long> |
lastFlushedSequenceIds |
private static org.slf4j.Logger |
LOG |
(package private) OutputSink |
outputSink |
protected Map<String,Map<byte[],Long>> |
regionMaxSeqIdInStores |
(package private) org.apache.hadoop.fs.Path |
rootDir |
(package private) org.apache.hadoop.fs.FileSystem |
rootFS |
(package private) RegionServerServices |
rsServices |
protected LastSequenceId |
sequenceIdChecker |
static boolean |
SPLIT_SKIP_ERRORS_DEFAULT
By default we retry errors in splitting, rather than skipping.
|
static String |
SPLIT_WAL_BUFFER_SIZE |
static String |
SPLIT_WAL_WRITER_THREADS |
static String |
SPLIT_WRITER_CREATION_BOUNDED
True if we are to run with bounded amount of writers rather than let the count blossom.
|
private SplitLogWorkerCoordination |
splitLogWorkerCoordination
Coordinator for split log.
|
private MonitoredTask |
status |
private String |
tmpDirName |
static String |
WAL_SPLIT_TO_HFILE
Split WAL directly to hfiles instead of into intermediary 'recovered.edits' files.
|
protected org.apache.hadoop.fs.Path |
walDir |
private WALFactory |
walFactory |
protected org.apache.hadoop.fs.FileSystem |
walFS |
Constructor and Description |
---|
WALSplitter(WALFactory factory,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path walDir,
org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.FileSystem rootFS,
LastSequenceId idChecker,
SplitLogWorkerCoordination splitLogWorkerCoordination,
RegionServerServices rsServices) |
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. |
(package private) org.apache.hadoop.fs.FileStatus |
getFileBeingSplit() |
private WAL.Entry |
getNextLogLine(WAL.Reader in,
org.apache.hadoop.fs.Path path,
boolean skipErrors) |
private int |
getNumOpenWriters()
Get current open writers
|
private 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. |
(package private) Map<String,Map<byte[],Long>> |
getRegionMaxSeqIdInStores() |
(package private) String |
getTmpDirName() |
(package private) WALFactory |
getWalFactory() |
private boolean |
isRegionDirPresentUnderRoot(TableName tableName,
String regionName) |
static List<org.apache.hadoop.fs.Path> |
split(org.apache.hadoop.fs.Path walDir,
org.apache.hadoop.fs.Path logDir,
org.apache.hadoop.fs.Path oldLogDir,
org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.conf.Configuration conf,
WALFactory factory)
Split a folder of WAL files.
|
(package private) boolean |
splitLogFile(org.apache.hadoop.fs.FileStatus logfile,
CancelableProgressable reporter)
WAL splitting implementation, splits one log file.
|
static boolean |
splitLogFile(org.apache.hadoop.fs.Path walDir,
org.apache.hadoop.fs.FileStatus logfile,
org.apache.hadoop.fs.FileSystem walFS,
org.apache.hadoop.conf.Configuration conf,
CancelableProgressable reporter,
LastSequenceId idChecker,
SplitLogWorkerCoordination splitLogWorkerCoordination,
WALFactory factory,
RegionServerServices rsServices)
Splits a WAL file.
|
private static final org.slf4j.Logger LOG
public static final boolean SPLIT_SKIP_ERRORS_DEFAULT
protected final org.apache.hadoop.fs.Path walDir
protected final org.apache.hadoop.fs.FileSystem walFS
protected final org.apache.hadoop.conf.Configuration conf
final org.apache.hadoop.fs.Path rootDir
final org.apache.hadoop.fs.FileSystem rootFS
final RegionServerServices rsServices
OutputSink outputSink
private EntryBuffers entryBuffers
private SplitLogWorkerCoordination splitLogWorkerCoordination
private final WALFactory walFactory
private MonitoredTask status
protected final LastSequenceId sequenceIdChecker
protected Map<String,Long> lastFlushedSequenceIds
protected Map<String,Map<byte[],Long>> regionMaxSeqIdInStores
private org.apache.hadoop.fs.FileStatus fileBeingSplit
private final String tmpDirName
public static final String WAL_SPLIT_TO_HFILE
public static final boolean DEFAULT_WAL_SPLIT_TO_HFILE
public static final String SPLIT_WRITER_CREATION_BOUNDED
public static final String SPLIT_WAL_BUFFER_SIZE
public static final String SPLIT_WAL_WRITER_THREADS
WALSplitter(WALFactory factory, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path walDir, org.apache.hadoop.fs.FileSystem walFS, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.FileSystem rootFS, LastSequenceId idChecker, SplitLogWorkerCoordination splitLogWorkerCoordination, RegionServerServices rsServices)
WALFactory getWalFactory()
org.apache.hadoop.fs.FileStatus getFileBeingSplit()
String getTmpDirName()
Map<String,Map<byte[],Long>> getRegionMaxSeqIdInStores()
public static boolean splitLogFile(org.apache.hadoop.fs.Path walDir, org.apache.hadoop.fs.FileStatus logfile, org.apache.hadoop.fs.FileSystem walFS, org.apache.hadoop.conf.Configuration conf, CancelableProgressable reporter, LastSequenceId idChecker, SplitLogWorkerCoordination splitLogWorkerCoordination, WALFactory factory, RegionServerServices rsServices) throws IOException
IOException
public static List<org.apache.hadoop.fs.Path> split(org.apache.hadoop.fs.Path walDir, org.apache.hadoop.fs.Path logDir, org.apache.hadoop.fs.Path oldLogDir, org.apache.hadoop.fs.FileSystem walFS, org.apache.hadoop.conf.Configuration conf, WALFactory factory) throws IOException
IOException
boolean splitLogFile(org.apache.hadoop.fs.FileStatus logfile, CancelableProgressable reporter) throws IOException
logfile
- should be an actual log file.IOException
private boolean isRegionDirPresentUnderRoot(TableName tableName, String regionName) throws IOException
IOException
private WAL.Reader getReader(org.apache.hadoop.fs.FileStatus file, boolean skipErrors, CancelableProgressable reporter) throws IOException, WALSplitter.CorruptedLogFileException
WAL.Reader
for reading logs to split.private WAL.Entry getNextLogLine(WAL.Reader in, org.apache.hadoop.fs.Path path, boolean skipErrors) throws WALSplitter.CorruptedLogFileException, IOException
protected WALProvider.Writer createWriter(org.apache.hadoop.fs.Path logfile) throws IOException
WALProvider.Writer
for writing log splits.IOException
protected WAL.Reader getReader(org.apache.hadoop.fs.Path curLogFile, CancelableProgressable reporter) throws IOException
WAL.Reader
for reading logs to split.IOException
private int getNumOpenWriters()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.