public class IntegrationTestBackupRestore extends IntegrationTestBase
Modifier and Type | Field and Description |
---|---|
private static String |
BACKUP_ROOT_DIR |
private static String |
CLASS_NAME |
protected static String |
COLUMN_NAME |
protected static int |
DEFAULT_NUM_ITERATIONS |
protected static int |
DEFAULT_NUMBER_OF_TABLES |
protected static int |
DEFAULT_REGION_COUNT |
protected static int |
DEFAULT_REGIONSERVER_COUNT |
protected static int |
DEFAULT_ROWS_IN_ITERATION |
protected static Object |
lock |
protected static org.slf4j.Logger |
LOG |
protected static String |
NUM_ITERATIONS_KEY |
protected static String |
NUMBER_OF_TABLES_KEY |
protected static int |
numIterations |
protected static int |
numTables |
protected static String |
REGION_COUNT_KEY |
protected static int |
regionsCountPerServer |
protected static String |
REGIONSERVER_COUNT_KEY |
protected static int |
regionServerCount |
protected static String |
ROWS_PER_ITERATION_KEY |
protected static int |
rowsInIteration |
protected static long |
SLEEP_TIME_DEFAULT |
protected static String |
SLEEP_TIME_KEY |
protected long |
sleepTime |
protected static org.apache.hadoop.hbase.TableName[] |
tableNames |
CHAOS_MONKEY_PROPS, monkey, MONKEY_LONG_OPT, monkeyProps, monkeyToUse, NO_CLUSTER_CLEANUP_LONG_OPT, noClusterCleanUp, util
Constructor and Description |
---|
IntegrationTestBackupRestore() |
Modifier and Type | Method and Description |
---|---|
protected void |
addOptions() |
private String[] |
allIncremental(List<String> backupIds) |
private String |
backup(org.apache.hadoop.hbase.backup.BackupRequest request,
org.apache.hadoop.hbase.backup.BackupAdmin client) |
protected boolean |
checkSucceeded(String backupId)
Returns status of backup
|
private void |
cleanUpBackupDir() |
org.apache.hadoop.hbase.backup.RestoreRequest |
createRestoreRequest(String backupRootDir,
String backupId,
boolean check,
org.apache.hadoop.hbase.TableName[] fromTables,
org.apache.hadoop.hbase.TableName[] toTables,
boolean isOverwrite)
Get restore request.
|
private void |
createTable(org.apache.hadoop.hbase.TableName tableName) |
private void |
createTables() |
private void |
deleteTablesIfAny() |
private void |
enableBackup(org.apache.hadoop.conf.Configuration conf) |
private org.apache.hadoop.hbase.backup.BackupInfo |
getBackupInfo(String backupId) |
protected Set<String> |
getColumnFamilies()
Provides the name of the CFs that are protected from random Chaos monkey activity (alter)
|
org.apache.hadoop.hbase.TableName |
getTablename()
Provides the name of the table that is protected from random Chaos monkey activity
|
private void |
loadData(org.apache.hadoop.hbase.TableName table,
int numRows) |
static void |
main(String[] args) |
private void |
merge(String[] backupIds,
org.apache.hadoop.hbase.backup.BackupAdmin client) |
protected void |
processOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd) |
private void |
restore(org.apache.hadoop.hbase.backup.RestoreRequest request,
org.apache.hadoop.hbase.backup.BackupAdmin client) |
private void |
restoreVerifyTable(org.apache.hadoop.hbase.client.Connection conn,
org.apache.hadoop.hbase.backup.BackupAdmin client,
org.apache.hadoop.hbase.TableName table,
String backupId,
long expectedRows) |
int |
runTestFromCommandLine()
Returns status of CLI execution
|
private void |
runTestMulti() |
private void |
runTestSingle(org.apache.hadoop.hbase.TableName table) |
void |
setUp() |
void |
setUpCluster() |
void |
setUpMonkey() |
void |
tearDown() |
void |
testBackupRestore() |
cleanUp, cleanUpCluster, cleanUpMonkey, cleanUpMonkey, doWork, getConf, getDefaultMonkeyFactory, getTestingUtil, loadMonkeyProperties, processBaseOptions, startMonkey
addOption, addOptNoArg, addOptNoArg, addOptWithArg, addOptWithArg, addRequiredOption, addRequiredOptWithArg, addRequiredOptWithArg, doStaticMain, getOptionAsDouble, getOptionAsInt, getOptionAsInt, getOptionAsLong, getOptionAsLong, newParser, parseArgs, parseInt, parseLong, printUsage, printUsage, processOldArgs, run, setConf
private static final String CLASS_NAME
protected static final org.slf4j.Logger LOG
protected static final String NUMBER_OF_TABLES_KEY
protected static final String COLUMN_NAME
protected static final String REGION_COUNT_KEY
protected static final String REGIONSERVER_COUNT_KEY
protected static final String ROWS_PER_ITERATION_KEY
protected static final String NUM_ITERATIONS_KEY
protected static final int DEFAULT_REGION_COUNT
protected static final int DEFAULT_REGIONSERVER_COUNT
protected static final int DEFAULT_NUMBER_OF_TABLES
protected static final int DEFAULT_NUM_ITERATIONS
protected static final int DEFAULT_ROWS_IN_ITERATION
protected static final String SLEEP_TIME_KEY
protected static final long SLEEP_TIME_DEFAULT
protected static int rowsInIteration
protected static int regionsCountPerServer
protected static int regionServerCount
protected static int numIterations
protected static int numTables
protected static org.apache.hadoop.hbase.TableName[] tableNames
protected long sleepTime
private static String BACKUP_ROOT_DIR
public IntegrationTestBackupRestore()
public void setUp() throws Exception
setUp
in class IntegrationTestBase
Exception
public void tearDown() throws IOException
IOException
public void setUpMonkey() throws Exception
setUpMonkey
in class IntegrationTestBase
Exception
private void deleteTablesIfAny() throws IOException
IOException
private void createTables() throws Exception
Exception
private void enableBackup(org.apache.hadoop.conf.Configuration conf)
private void cleanUpBackupDir() throws IOException
IOException
public void testBackupRestore() throws Exception
Exception
private void runTestMulti() throws IOException
IOException
private void createTable(org.apache.hadoop.hbase.TableName tableName) throws Exception
Exception
private void loadData(org.apache.hadoop.hbase.TableName table, int numRows) throws IOException
IOException
private String backup(org.apache.hadoop.hbase.backup.BackupRequest request, org.apache.hadoop.hbase.backup.BackupAdmin client) throws IOException
IOException
private void restore(org.apache.hadoop.hbase.backup.RestoreRequest request, org.apache.hadoop.hbase.backup.BackupAdmin client) throws IOException
IOException
private void merge(String[] backupIds, org.apache.hadoop.hbase.backup.BackupAdmin client) throws IOException
IOException
private void runTestSingle(org.apache.hadoop.hbase.TableName table) throws IOException
IOException
private void restoreVerifyTable(org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.backup.BackupAdmin client, org.apache.hadoop.hbase.TableName table, String backupId, long expectedRows) throws IOException
IOException
private String[] allIncremental(List<String> backupIds)
protected boolean checkSucceeded(String backupId) throws IOException
IOException
private org.apache.hadoop.hbase.backup.BackupInfo getBackupInfo(String backupId) throws IOException
IOException
public org.apache.hadoop.hbase.backup.RestoreRequest createRestoreRequest(String backupRootDir, String backupId, boolean check, org.apache.hadoop.hbase.TableName[] fromTables, org.apache.hadoop.hbase.TableName[] toTables, boolean isOverwrite)
backupRootDir
- directory where backup is locatedbackupId
- backup IDcheck
- check the backupfromTables
- table names to restore fromtoTables
- new table names to restore toisOverwrite
- overwrite the table(s)public void setUpCluster() throws Exception
setUpCluster
in class IntegrationTestBase
Exception
public int runTestFromCommandLine() throws Exception
runTestFromCommandLine
in class IntegrationTestBase
Exception
public org.apache.hadoop.hbase.TableName getTablename()
IntegrationTestBase
getTablename
in class IntegrationTestBase
protected Set<String> getColumnFamilies()
IntegrationTestBase
getColumnFamilies
in class IntegrationTestBase
protected void addOptions()
addOptions
in class IntegrationTestBase
protected void processOptions(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine cmd)
processOptions
in class IntegrationTestBase
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.