use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsSnapshotCleanupEnabledResponse in project hbase by apache.
the class TestSnapshotFromMaster method testSnapshotCleanupStatus.
@Test
public void testSnapshotCleanupStatus() throws Exception {
// Enable auto snapshot cleanup for the cluster
SetSnapshotCleanupRequest setSnapshotCleanupRequest = SetSnapshotCleanupRequest.newBuilder().setEnabled(true).build();
master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest);
// Check if auto snapshot cleanup is enabled
IsSnapshotCleanupEnabledRequest isSnapshotCleanupEnabledRequest = IsSnapshotCleanupEnabledRequest.newBuilder().build();
IsSnapshotCleanupEnabledResponse isSnapshotCleanupEnabledResponse = master.getMasterRpcServices().isSnapshotCleanupEnabled(null, isSnapshotCleanupEnabledRequest);
Assert.assertTrue(isSnapshotCleanupEnabledResponse.getEnabled());
// Disable auto snapshot cleanup for the cluster
setSnapshotCleanupRequest = SetSnapshotCleanupRequest.newBuilder().setEnabled(false).build();
master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest);
// Check if auto snapshot cleanup is disabled
isSnapshotCleanupEnabledRequest = IsSnapshotCleanupEnabledRequest.newBuilder().build();
isSnapshotCleanupEnabledResponse = master.getMasterRpcServices().isSnapshotCleanupEnabled(null, isSnapshotCleanupEnabledRequest);
Assert.assertFalse(isSnapshotCleanupEnabledResponse.getEnabled());
}
Aggregations