@InterfaceAudience.Private public class HLogUtil extends Object
| Constructor and Description |
|---|
HLogUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getHLogDirectoryName(String serverName)
Construct the HLog directory name
|
static org.apache.hadoop.fs.Path |
getRegionDirRecoveredEditsDir(org.apache.hadoop.fs.Path regiondir) |
static ServerName |
getServerNameFromHLogDirectoryName(org.apache.hadoop.conf.Configuration conf,
String path) |
static ServerName |
getServerNameFromHLogDirectoryName(org.apache.hadoop.fs.Path logFile)
This function returns region server name from a log file name which is in either format:
hdfs://
|
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 wal-log splitter, excluding files
with '.temp' suffix.
|
static boolean |
isMetaFile(org.apache.hadoop.fs.Path p) |
static boolean |
isMetaFile(String p) |
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 boolean |
validateHLogFilename(String filename) |
static void |
writeCompactionMarker(HLog log,
HTableDescriptor htd,
HRegionInfo info,
WALProtos.CompactionDescriptor c,
AtomicLong sequenceId)
Write the marker that a compaction has succeeded and is about to be committed.
|
public static boolean validateHLogFilename(String filename)
filename - name of the file to validatepublic static String getHLogDirectoryName(String serverName)
serverName - Server name formatted as described in ServerName.logs/1.example.org,60030,12345 if
serverName passed is
1.example.org,60030,12345public static org.apache.hadoop.fs.Path getRegionDirRecoveredEditsDir(org.apache.hadoop.fs.Path regiondir)
regiondir - This regions directory in the filesystem.regiondirpublic 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 ServerName getServerNameFromHLogDirectoryName(org.apache.hadoop.conf.Configuration conf, String path) throws IOException
path - - the path to analyze. Expected format, if it's in hlog directory:
/ [base directory for hbase] / hbase / .logs / ServerName /
logfileIOExceptionpublic static ServerName getServerNameFromHLogDirectoryName(org.apache.hadoop.fs.Path logFile)
logFile - public 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 boolean isMetaFile(org.apache.hadoop.fs.Path p)
public static boolean isMetaFile(String p)
public static void writeCompactionMarker(HLog log, HTableDescriptor htd, HRegionInfo info, WALProtos.CompactionDescriptor c, AtomicLong sequenceId) throws IOException
sequenceId - Used by HLog to get sequence Id for the waledit.IOExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.