@InterfaceAudience.Private @InterfaceStability.Evolving public final class BackupServerUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected static Log |
LOG |
static String |
LOGNAME_SEPARATOR |
Modifier and Type | Method and Description |
---|---|
static void |
cleanupBackupData(BackupInfo context,
Configuration conf) |
static void |
copyTableRegionInfo(BackupInfo backupContext,
Configuration conf)
copy out Table RegionInfo into incremental backup image need to consider move this logic into
HBackupFileSystem
|
static long |
getFilesLength(FileSystem fs,
Path dir)
Get the total length of files under the given directory recursively.
|
static List<String> |
getListOfWALFiles(Configuration c)
Get list of all WAL files (WALs and archive)
|
static List<String> |
getListOfWALFiles(Configuration c,
PathFilter filter)
Get list of all WAL files (WALs and archive)
|
static HashMap<String,Long> |
getRSLogTimestampMins(HashMap<TableName,HashMap<String,Long>> rsLogTimestampMap)
Loop through the RS log timestamp map for the tables, for each RS, find the min timestamp
value for the RS among the tables.
|
static String |
getUniqueWALFileNamePart(Path p)
Returns WAL file name
|
static String |
getUniqueWALFileNamePart(String walFileName)
Returns WAL file name
|
static List<String> |
getWALFilesOlderThan(Configuration c,
HashMap<String,Long> hostTimestampMap)
Get list of all old WAL files (WALs and archive)
|
static String |
join(TableName[] names) |
static String |
parseHostNameFromLogFile(Path p)
TODO: return hostname:port
|
static TableName[] |
parseTableNames(String tables) |
static ArrayList<BackupInfo> |
sortHistoryListDesc(ArrayList<BackupInfo> historyList)
Sort history list by start time in descending order.
|
static void |
waitForSnapshot(HBaseProtos.SnapshotDescription snapshot,
long max,
SnapshotManager snapshotMgr,
Configuration conf) |
static void |
writeRegioninfoOnFilesystem(Configuration conf,
FileSystem fs,
Path regionInfoDir,
HRegionInfo regionInfo)
Write the .regioninfo file on-disk.
|
protected static final Log LOG
public static final String LOGNAME_SEPARATOR
public static void waitForSnapshot(HBaseProtos.SnapshotDescription snapshot, long max, SnapshotManager snapshotMgr, Configuration conf) throws IOException
IOException
public static HashMap<String,Long> getRSLogTimestampMins(HashMap<TableName,HashMap<String,Long>> rsLogTimestampMap)
rsLogTimestampMap
- timestamp mappublic static void copyTableRegionInfo(BackupInfo backupContext, Configuration conf) throws IOException, InterruptedException
backupContext
- backup contextconf
- configurationIOException
- exceptionInterruptedException
- exceptionpublic static void writeRegioninfoOnFilesystem(Configuration conf, FileSystem fs, Path regionInfoDir, HRegionInfo regionInfo) throws IOException
IOException
public static String parseHostNameFromLogFile(Path p) throws IOException
p
- IOException
public static String getUniqueWALFileNamePart(String walFileName) throws IOException
walFileName
- WAL file nameIOException
- exceptionIllegalArgumentException
- exceptionpublic static String getUniqueWALFileNamePart(Path p) throws IOException
p
- - WAL file pathIOException
- exceptionpublic static long getFilesLength(FileSystem fs, Path dir) throws IOException
fs
- The hadoop file systemdir
- The target directoryIOException
- exceptionpublic static ArrayList<BackupInfo> sortHistoryListDesc(ArrayList<BackupInfo> historyList)
historyList
- history listpublic static List<String> getListOfWALFiles(Configuration c) throws IOException
c
- - configurationIOException
- exceptionpublic static List<String> getListOfWALFiles(Configuration c, PathFilter filter) throws IOException
c
- - configurationIOException
- exceptionpublic static List<String> getWALFilesOlderThan(Configuration c, HashMap<String,Long> hostTimestampMap) throws IOException
c
- - configurationhostTimestampMap
- - host timestamp mapIOException
- exceptionpublic static void cleanupBackupData(BackupInfo context, Configuration conf) throws IOException
IOException