Class FullTableBackupClient
java.lang.Object
org.apache.hadoop.hbase.backup.impl.TableBackupClient
org.apache.hadoop.hbase.backup.impl.FullTableBackupClient
Full table backup implementation
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.backup.impl.TableBackupClient
TableBackupClient.Stage -
Field Summary
FieldsFields inherited from class org.apache.hadoop.hbase.backup.impl.TableBackupClient
BACKUP_CLIENT_IMPL_CLASS, BACKUP_TEST_MODE_STAGE, backupId, backupInfo, backupManager, conf, conn, fs, newTimestamps, tableList -
Constructor Summary
ConstructorsConstructorDescriptionFullTableBackupClient(Connection conn, String backupId, BackupRequest request) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcomputeLogBoundaries(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path walRootDir, Map<String, Long> rolledHosts, Admin admin) Computes the per-host log boundaries stored by this full backup, so that the next incremental backup includes exactly the WALs whose edits may be missing from the snapshot.private booleanprivate voidenableTableReplication(Admin admin) voidexecute()Backup request execution.private voidhandleContinuousBackup(Admin admin) private voidhandleNonContinuousBackup(Admin admin) private voidperformBackupSnapshots(Admin admin) private voidperformSnapshots(Admin admin) protected voidsnapshotCopy(BackupInfo backupInfo) Do snapshot copy.protected voidsnapshotTable(Admin admin, TableName tableName, String snapshotName) private longstartContinuousWALBackup(Admin admin) private voidprivate voidMethods inherited from class org.apache.hadoop.hbase.backup.impl.TableBackupClient
addManifest, beginBackup, cleanupAndRestoreBackupSystem, cleanupExportSnapshotLog, cleanupTargetDir, completeBackup, deleteSnapshots, failBackup, failStageIf, getAncestors, getMessage, getTestStage, init, obtainBackupMetaDataStr
-
Field Details
-
LOG
-
-
Constructor Details
-
FullTableBackupClient
public FullTableBackupClient() -
FullTableBackupClient
public FullTableBackupClient(Connection conn, String backupId, BackupRequest request) throws IOException - Throws:
IOException
-
-
Method Details
-
snapshotCopy
Do snapshot copy.- Parameters:
backupInfo- backup info- Throws:
IOException- exception
-
execute
Backup request execution.- Specified by:
executein classTableBackupClient- Throws:
IOException- if the execution of the backup fails
-
handleContinuousBackup
- Throws:
IOException
-
handleNonContinuousBackup
- Throws:
IOException
-
performLogRoll
- Throws:
IOException
-
performBackupSnapshots
- Throws:
IOException
-
performSnapshots
- Throws:
IOException
-
computeLogBoundaries
static Map<String,Long> computeLogBoundaries(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path walRootDir, Map<String, Long> rolledHosts, Admin admin) throws IOExceptionComputes the per-host log boundaries stored by this full backup, so that the next incremental backup includes exactly the WALs whose edits may be missing from the snapshot. It must run right after the log roll, before the snapshot is taken, so that a host starting later gets no boundary and has all of its WALs included in the next incremental backup.Boundaries are computed by
BackupUtils.computeLogBoundaries(java.util.Map<java.lang.String, java.lang.Long>, java.util.Collection<java.lang.String>, java.util.Collection<java.lang.String>):- A host that took part in this backup's log roll gets its roll result. WALs created after the roll will be included in the next incremental backup, even though some of their edits may already be in the snapshot, which is safe because deletes are replayed along with the puts.
- For any other host, its archived WALs and the WALs of dead servers are covered by the snapshot, so the next incremental backup does not replay them.
- The WALs of a live server that did not take part in the roll (for example one that started during it) are pending, because they can still receive edits that are not in the snapshot.
- Throws:
IOException
-
updateBackupMetadata
- Throws:
IOException
-
startContinuousWALBackup
- Throws:
IOException
-
enableTableReplication
- Throws:
IOException
-
updateContinuousBackupReplicationPeer
- Throws:
IOException
-
addContinuousBackupReplicationPeer
- Throws:
IOException
-
continuousBackupReplicationPeerExists
- Throws:
IOException
-
snapshotTable
protected void snapshotTable(Admin admin, TableName tableName, String snapshotName) throws IOException - Throws:
IOException
-