Search in sources :

Example 16 with BackupInfo

use of org.apache.hadoop.hbase.backup.BackupInfo in project hbase by apache.

the class BackupSystemTable method getBackupHistoryForTable.

/**
   * Get history for a table
   * @param name table name
   * @return history for a table
   * @throws IOException
   */
public List<BackupInfo> getBackupHistoryForTable(TableName name) throws IOException {
    List<BackupInfo> history = getBackupHistory();
    List<BackupInfo> tableHistory = new ArrayList<BackupInfo>();
    for (BackupInfo info : history) {
        List<TableName> tables = info.getTableNames();
        if (tables.contains(name)) {
            tableHistory.add(info);
        }
    }
    return tableHistory;
}
Also used : BackupInfo(org.apache.hadoop.hbase.backup.BackupInfo) TableName(org.apache.hadoop.hbase.TableName) ArrayList(java.util.ArrayList)

Aggregations

BackupInfo (org.apache.hadoop.hbase.backup.BackupInfo)16 ArrayList (java.util.ArrayList)10 TableName (org.apache.hadoop.hbase.TableName)7 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 LocatedFileStatus (org.apache.hadoop.fs.LocatedFileStatus)2 Path (org.apache.hadoop.fs.Path)2 HashSet (java.util.HashSet)1 TreeMap (java.util.TreeMap)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)1 BackupState (org.apache.hadoop.hbase.backup.BackupInfo.BackupState)1 BackupType (org.apache.hadoop.hbase.backup.BackupType)1 HBackupFileSystem (org.apache.hadoop.hbase.backup.HBackupFileSystem)1 BackupManifest (org.apache.hadoop.hbase.backup.impl.BackupManifest)1 BackupImage (org.apache.hadoop.hbase.backup.impl.BackupManifest.BackupImage)1 Admin (org.apache.hadoop.hbase.client.Admin)1 Result (org.apache.hadoop.hbase.client.Result)1 ResultScanner (org.apache.hadoop.hbase.client.ResultScanner)1 Scan (org.apache.hadoop.hbase.client.Scan)1