org.apache.hadoop.hbase.regionserver.wal
Class HLogUtil
java.lang.Object
org.apache.hadoop.hbase.regionserver.wal.HLogUtil
public class HLogUtil
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HLogUtil
public HLogUtil()
isMetaFamily
public static boolean isMetaFamily(byte[] family)
- Parameters:
family
-
- Returns:
- true if the column is a meta column
getKeyClass
public static Class<? extends HLogKey> getKeyClass(org.apache.hadoop.conf.Configuration conf)
newKey
public static HLogKey newKey(org.apache.hadoop.conf.Configuration conf)
throws IOException
- Throws:
IOException
validateHLogFilename
public static boolean validateHLogFilename(String filename)
- Parameters:
filename
- name of the file to validate
- Returns:
- true if the filename matches an HLog, false
otherwise
getHLogDirectoryName
public static String getHLogDirectoryName(String serverName)
- Construct the HLog directory name
- Parameters:
serverName
- Server name formatted as described in ServerName
- Returns:
- the relative HLog directory name, e.g.
.logs/1.example.org,60030,12345
if
serverName
passed is
1.example.org,60030,12345
getRegionDirRecoveredEditsDir
public static org.apache.hadoop.fs.Path getRegionDirRecoveredEditsDir(org.apache.hadoop.fs.Path regiondir)
- Parameters:
regiondir
- This regions directory in the filesystem.
- Returns:
- The directory that holds recovered edits files for the region
regiondir
moveAsideBadEditsFile
public static org.apache.hadoop.fs.Path moveAsideBadEditsFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path edits)
throws IOException
- Move aside a bad edits file.
- Parameters:
fs
- edits
- Edits file to move aside.
- Returns:
- The name of the moved aside file.
- Throws:
IOException
getServerNameFromHLogDirectoryName
public static ServerName getServerNameFromHLogDirectoryName(org.apache.hadoop.conf.Configuration conf,
String path)
throws IOException
- Parameters:
path
- - the path to analyze. Expected format, if it's in hlog directory:
/ [base directory for hbase] / hbase / .logs / ServerName /
logfile
- Returns:
- null if it's not a log file. Returns the ServerName of the region
server that created this log file otherwise.
- Throws:
IOException
getSplitEditFilesSorted
public static NavigableSet<org.apache.hadoop.fs.Path> getSplitEditFilesSorted(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path regiondir)
throws IOException
- Returns sorted set of edit files made by wal-log splitter, excluding files
with '.temp' suffix.
- Parameters:
fs
- regiondir
-
- Returns:
- Files in passed
regiondir
as a sorted set.
- Throws:
IOException
isMetaFile
public static boolean isMetaFile(org.apache.hadoop.fs.Path p)
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.