/** * Check that ExportSnapshot will fail if we inject failure more times than MR will retry. */ @Test public void testExportFailure() throws Exception { Path copyDir = getLocalDestinationDir(); FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration()); copyDir = copyDir.makeQualified(fs); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true); conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 4); conf.setInt("mapreduce.map.maxattempts", 3); testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles, TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), false); }
protected Set<String> verifySnapshot(final FileSystem fs, final Path rootDir, final TableName tableName, final String snapshotName) throws IOException { return verifySnapshot(TEST_UTIL.getConfiguration(), fs, rootDir, tableName, snapshotName, getBypassRegionPredicate()); }
/** * Check that ExportSnapshot will succeed if something fails but the retry succeed. */ @Test public void testExportRetry() throws Exception { Path copyDir = getLocalDestinationDir(); FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration()); copyDir = copyDir.makeQualified(fs); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true); conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2); conf.setInt("mapreduce.map.maxattempts", 3); testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles, TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), true); }
protected void testExportFileSystemState(final TableName tableName, final byte[] snapshotName, final byte[] targetName, int filesExpected, Path copyDir, boolean overwrite) throws Exception { testExportFileSystemState(TEST_UTIL.getConfiguration(), tableName, snapshotName, targetName, filesExpected, TEST_UTIL.getDefaultRootDirPath(), copyDir, overwrite, getBypassRegionPredicate(), true); }
/** * Check that ExportSnapshot will succeed if something fails but the retry succeed. */ @Test public void testExportRetry() throws Exception { Path copyDir = getLocalDestinationDir(); FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration()); copyDir = copyDir.makeQualified(fs); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true); conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2); conf.setInt("mapreduce.map.maxattempts", 3); testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles, TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), true); }
/** * Check that ExportSnapshot will succeed if something fails but the retry succeed. */ @Test public void testExportRetry() throws Exception { Path copyDir = getLocalDestinationDir(); FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration()); copyDir = copyDir.makeQualified(fs); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true); conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 2); conf.setInt("mapreduce.map.maxattempts", 3); testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles, TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), true); }
protected Set<String> verifySnapshot(final FileSystem fs, final Path rootDir, final TableName tableName, final String snapshotName) throws IOException { return verifySnapshot(TEST_UTIL.getConfiguration(), fs, rootDir, tableName, snapshotName, getBypassRegionPredicate()); }
protected Set<String> verifySnapshot(final FileSystem fs, final Path rootDir, final TableName tableName, final String snapshotName) throws IOException { return verifySnapshot(TEST_UTIL.getConfiguration(), fs, rootDir, tableName, snapshotName, getBypassRegionPredicate()); }
/** * Check that ExportSnapshot will fail if we inject failure more times than MR will retry. */ @Test public void testExportFailure() throws Exception { Path copyDir = getLocalDestinationDir(); FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration()); copyDir = copyDir.makeQualified(fs); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true); conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 4); conf.setInt("mapreduce.map.maxattempts", 3); testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles, TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), false); }
/** * Check that ExportSnapshot will fail if we inject failure more times than MR will retry. */ @Test public void testExportFailure() throws Exception { Path copyDir = getLocalDestinationDir(); FileSystem fs = FileSystem.get(copyDir.toUri(), new Configuration()); copyDir = copyDir.makeQualified(fs); Configuration conf = new Configuration(TEST_UTIL.getConfiguration()); conf.setBoolean(ExportSnapshot.Testing.CONF_TEST_FAILURE, true); conf.setInt(ExportSnapshot.Testing.CONF_TEST_FAILURE_COUNT, 4); conf.setInt("mapreduce.map.maxattempts", 3); testExportFileSystemState(conf, tableName, snapshotName, snapshotName, tableNumFiles, TEST_UTIL.getDefaultRootDirPath(), copyDir, true, getBypassRegionPredicate(), false); }
protected void testExportFileSystemState(final TableName tableName, final byte[] snapshotName, final byte[] targetName, int filesExpected, Path copyDir, boolean overwrite) throws Exception { testExportFileSystemState(TEST_UTIL.getConfiguration(), tableName, snapshotName, targetName, filesExpected, TEST_UTIL.getDefaultRootDirPath(), copyDir, overwrite, getBypassRegionPredicate(), true); }
protected void testExportFileSystemState(final TableName tableName, final byte[] snapshotName, final byte[] targetName, int filesExpected, Path copyDir, boolean overwrite) throws Exception { testExportFileSystemState(TEST_UTIL.getConfiguration(), tableName, snapshotName, targetName, filesExpected, TEST_UTIL.getDefaultRootDirPath(), copyDir, overwrite, getBypassRegionPredicate(), true); }