本文整理汇总了Java中org.apache.hadoop.hbase.client.Table.mutateRow方法的典型用法代码示例。如果您正苦于以下问题:Java Table.mutateRow方法的具体用法?Java Table.mutateRow怎么用?Java Table.mutateRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.client.Table
的用法示例。
在下文中一共展示了Table.mutateRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mutateRow
import org.apache.hadoop.hbase.client.Table; //导入方法依赖的package包/类
@Override
public void mutateRow(ByteBuffer table, TRowMutations rowMutations) throws TIOError, TException {
Table htable = getTable(table);
try {
htable.mutateRow(rowMutationsFromThrift(rowMutations));
} catch (IOException e) {
throw getTIOError(e);
} finally {
closeTable(htable);
}
}
示例2: testRowMutation
import org.apache.hadoop.hbase.client.Table; //导入方法依赖的package包/类
@Test (timeout=300000)
public void testRowMutation() throws IOException {
TableName tableName = TableName.valueOf(TEST_TABLE.getNameAsString() + ".testRowMutation");
Table table = util.createTable(tableName, new byte[][] {A, B, C});
try {
verifyMethodResult(SimpleRegionObserver.class,
new String[] {"hadPreGet", "hadPostGet", "hadPrePut", "hadPostPut",
"hadDeleted"},
tableName,
new Boolean[] {false, false, false, false, false});
Put put = new Put(ROW);
put.add(A, A, A);
put.add(B, B, B);
put.add(C, C, C);
Delete delete = new Delete(ROW);
delete.deleteColumn(A, A);
delete.deleteColumn(B, B);
delete.deleteColumn(C, C);
RowMutations arm = new RowMutations(ROW);
arm.add(put);
arm.add(delete);
table.mutateRow(arm);
verifyMethodResult(SimpleRegionObserver.class,
new String[] {"hadPreGet", "hadPostGet", "hadPrePut", "hadPostPut",
"hadDeleted"},
tableName,
new Boolean[] {false, false, true, true, true}
);
} finally {
util.deleteTable(tableName);
table.close();
}
}