use of org.apache.hadoop.hbase.rest.model.ScannerModel in project hbase by apache.
the class TestScannerResource method testTableScanWithTableDisable.
// performs table scan during which the underlying table is disabled
// assert that we get 410 (Gone)
@Test
public void testTableScanWithTableDisable() throws IOException {
ScannerModel model = new ScannerModel();
model.addColumn(Bytes.toBytes(COLUMN_1));
model.setCaching(1);
Response response = client.put("/" + TABLE_TO_BE_DISABLED + "/scanner", Constants.MIMETYPE_PROTOBUF, model.createProtobufOutput());
assertEquals(response.getCode(), 201);
String scannerURI = response.getLocation();
assertNotNull(scannerURI);
TEST_UTIL.getAdmin().disableTable(TABLE_TO_BE_DISABLED);
response = client.get(scannerURI, Constants.MIMETYPE_PROTOBUF);
assertTrue("got " + response.getCode(), response.getCode() == 410);
}
Aggregations