public class TakeSnapshotUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static List<org.apache.hadoop.fs.Path> |
getFamilySnapshotDirectories(HBaseProtos.SnapshotDescription snapshot,
org.apache.hadoop.fs.Path snapshotRegionDir,
org.apache.hadoop.fs.FileStatus[] families)
Get the snapshot directory for each family to be added to the the snapshot
|
static TimeoutExceptionInjector |
getMasterTimerAndBindToMonitor(HBaseProtos.SnapshotDescription snapshot,
org.apache.hadoop.conf.Configuration conf,
ForeignExceptionListener monitor)
Create a snapshot timer for the master which notifies the monitor when an error occurs
|
static org.apache.hadoop.fs.Path |
getRegionSnapshotDirectory(HBaseProtos.SnapshotDescription desc,
org.apache.hadoop.fs.Path rootDir,
String regionName)
Get the per-region snapshot description location.
|
static org.apache.hadoop.fs.Path |
getSnapshotHLogsDir(org.apache.hadoop.fs.Path snapshotDir,
String serverName)
Get the log directory for a specific snapshot
|
static void |
verifyAllLogsGotReferenced(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logsDir,
Set<String> serverNames,
HBaseProtos.SnapshotDescription snapshot,
org.apache.hadoop.fs.Path snapshotLogDir)
Verify that all the expected logs got referenced
|
static void |
verifyRecoveredEdits(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
HRegionInfo regionInfo,
HBaseProtos.SnapshotDescription snapshot)
Verify one of a snapshot's region's recovered.edits, has been at the surface (file names,
length), match the original directory.
|
public static org.apache.hadoop.fs.Path getRegionSnapshotDirectory(HBaseProtos.SnapshotDescription desc, org.apache.hadoop.fs.Path rootDir, String regionName)
Under the per-snapshot directory, specific files per-region are kept in a similar layout as per the current directory layout.
desc - description of the snapshotrootDir - root directory for the hbase installationregionName - encoded name of the region (see HRegionInfo.encodeRegionName(byte[]))public static List<org.apache.hadoop.fs.Path> getFamilySnapshotDirectories(HBaseProtos.SnapshotDescription snapshot, org.apache.hadoop.fs.Path snapshotRegionDir, org.apache.hadoop.fs.FileStatus[] families)
snapshot - description of the snapshot being takesnapshotRegionDir - directory in the snapshot where the region directory information
should be storedfamilies - families to be added (can be null)public static TimeoutExceptionInjector getMasterTimerAndBindToMonitor(HBaseProtos.SnapshotDescription snapshot, org.apache.hadoop.conf.Configuration conf, ForeignExceptionListener monitor)
snapshot - snapshot to monitorconf - configuration to use when getting the max snapshot lifemonitor - monitor to notify when the snapshot life expirespublic static void verifyAllLogsGotReferenced(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logsDir,
Set<String> serverNames,
HBaseProtos.SnapshotDescription snapshot,
org.apache.hadoop.fs.Path snapshotLogDir)
throws IOException
fs - filesystem where the logs livelogsDir - original logs directoryserverNames - names of the servers that involved in the snapshotsnapshot - description of the snapshot being takensnapshotLogDir - directory for logs in the snapshotIOExceptionpublic static void verifyRecoveredEdits(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
HRegionInfo regionInfo,
HBaseProtos.SnapshotDescription snapshot)
throws IOException
fs - filesystem on which the snapshot had been takenrootDir - full path to the root hbase directoryregionInfo - info for the regionsnapshot - description of the snapshot that was takenIOException - if there is an unexpected error talking to the filesystempublic static org.apache.hadoop.fs.Path getSnapshotHLogsDir(org.apache.hadoop.fs.Path snapshotDir,
String serverName)
snapshotDir - directory where the specific snapshot will be storeserverName - name of the parent regionserver for the log filesCopyright © 2014 The Apache Software Foundation. All Rights Reserved.