use of org.apache.hadoop.hbase.filter.SingleColumnValueFilter in project hbase by apache.
the class TestHRegion method testCheckAndMutate_wrongRow.
@Test
@Deprecated
public void testCheckAndMutate_wrongRow() throws Throwable {
final byte[] wrongRow = Bytes.toBytes("wrongRow");
// Setting up region
this.region = initHRegion(tableName, method, CONF, fam1);
try {
region.checkAndMutate(row, fam1, qual1, CompareOperator.EQUAL, new BinaryComparator(value1), new Put(wrongRow).addColumn(fam1, qual1, value1));
fail("should throw DoNotRetryIOException");
} catch (DoNotRetryIOException e) {
assertEquals("The row of the action <wrongRow> doesn't match the original one <rowA>", e.getMessage());
}
try {
region.checkAndMutate(row, new SingleColumnValueFilter(fam1, qual1, CompareOperator.EQUAL, value1), new Put(wrongRow).addColumn(fam1, qual1, value1));
fail("should throw DoNotRetryIOException");
} catch (DoNotRetryIOException e) {
assertEquals("The row of the action <wrongRow> doesn't match the original one <rowA>", e.getMessage());
}
try {
region.checkAndRowMutate(row, fam1, qual1, CompareOperator.EQUAL, new BinaryComparator(value1), new RowMutations(wrongRow).add((Mutation) new Put(wrongRow).addColumn(fam1, qual1, value1)).add((Mutation) new Delete(wrongRow).addColumns(fam1, qual2)));
fail("should throw DoNotRetryIOException");
} catch (DoNotRetryIOException e) {
assertEquals("The row of the action <wrongRow> doesn't match the original one <rowA>", e.getMessage());
}
try {
region.checkAndRowMutate(row, new SingleColumnValueFilter(fam1, qual1, CompareOperator.EQUAL, value1), new RowMutations(wrongRow).add((Mutation) new Put(wrongRow).addColumn(fam1, qual1, value1)).add((Mutation) new Delete(wrongRow).addColumns(fam1, qual2)));
fail("should throw DoNotRetryIOException");
} catch (DoNotRetryIOException e) {
assertEquals("The row of the action <wrongRow> doesn't match the original one <rowA>", e.getMessage());
}
}
Aggregations