public void testStandbySaveNamespace() throws Exception {
TestAvatarCheckpointingHandler h = new TestAvatarCheckpointingHandler();
InjectionHandler.set(h);
setUp(3600, "testStandbySaveNamespace", true);
AvatarNode primary = cluster.getPrimaryAvatar(0).avatar;
AvatarNode standby = cluster.getStandbyAvatar(0).avatar;
createEdits(40);
// trigger checkpoint on the standby
AvatarShell shell = new AvatarShell(conf);
// trigger regular checkpoint
runAndAssertCommand(shell, 0, new String[] { "-one", "-saveNamespace" });
assertCheckpointDone(h);
// trigger regular checkpoint with uncompressed option
// this will fail, as we do not support uncompressed
runAndAssertCommand(shell, -1, new String[] { "-one", "-saveNamespace",
"uncompressed" });
// trigger regular checkpoint with force option
runAndAssertCommand(shell, 0, new String[] { "-one", "-saveNamespace",
"force" });
assertCheckpointDone(h);
// trigger regular checkpoint with force, uncompressed option
// this will fail, as we do not support uncompressed
runAndAssertCommand(shell, -1, new String[] { "-one", "-saveNamespace",
"force", "uncompressed" });
// ///////////////////
// some incorrect option
runAndAssertCommand(shell, -1, new String[] { "-one", "-saveNamespace",
"someOption" });
standby.quiesceStandby(DFSAvatarTestUtil.getCurrentTxId(primary) - 1);
// edits + SLS + 2 * 2(for each successful checkpoint)
assertEquals(45, DFSAvatarTestUtil.getCurrentTxId(primary));
}