本文整理汇总了Java中org.apache.hadoop.hbase.client.Put.getRow方法的典型用法代码示例。如果您正苦于以下问题:Java Put.getRow方法的具体用法?Java Put.getRow怎么用?Java Put.getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.client.Put
的用法示例。
在下文中一共展示了Put.getRow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processPut
import org.apache.hadoop.hbase.client.Put; //导入方法依赖的package包/类
/**
* parse put, add index put into mdRecordList
*/
private void processPut(List<KeyValue> mdRecordList, Put put) throws IOException {
if (put == null) return;
byte[] rawRowkey = put.getRow();
int[] arr = new int[dimensions];
int i = 0;
for (Map.Entry<byte[], TreeSet<byte[]>> entry : tableRelation.getIndexFamilyMap().entrySet()) {
for (byte[] qualifier : entry.getValue()) {
arr[i] = Bytes.toInt(put.get(entry.getKey(), qualifier).get(0).getValue());
++i;
}
}
byte[] mdKey = MDUtils.bitwiseZip(arr, dimensions);
KeyValue keyValue =
new KeyValue(mdKey, LMDIndexConstants.FAMILY, rawRowkey, put.getTimeStamp(), Type.Put,
LMDIndexConstants.VALUE);
mdRecordList.add(keyValue);
}
示例2: parsePut
import org.apache.hadoop.hbase.client.Put; //导入方法依赖的package包/类
@Override protected Map<TableName, Put> parsePut(Put put, boolean serverSide) {
Map<TableName, Put> map = new HashMap<>();
byte[] row = put.getRow();
for (Map.Entry<byte[], List<Cell>> entry : put.getFamilyCellMap().entrySet()) {
byte[] family = entry.getKey();
for (Cell cell : entry.getValue()) {
byte[] q = CellUtil.cloneQualifier(cell);
if (tableRelation.isIndexColumn(family, q)) {
TableName indexTableName = tableRelation.getIndexTableName(family, q);
Put newPut = new Put(getIndexRow(row, CellUtil.cloneValue(cell)));
if (serverSide) newPut
.addColumn(IndexType.SEDONDARY_FAMILY_BYTES, (byte[]) null, cell.getTimestamp(),
null);
else newPut.addColumn(IndexType.SEDONDARY_FAMILY_BYTES, null, null);
map.put(indexTableName, newPut);
}
}
}
tableRelation.getIndexFamilyMap();
return map;
}
示例3: testRow
import org.apache.hadoop.hbase.client.Put; //导入方法依赖的package包/类
@Override
void testRow(final int i) throws IOException {
byte [] bytes = format(i);
// Put a known value so when we go to check it, it is there.
Put put = new Put(bytes);
put.addColumn(FAMILY_NAME, getQualifier(), bytes);
this.table.put(put);
Delete delete = new Delete(put.getRow());
delete.addColumn(FAMILY_NAME, getQualifier());
this.table.checkAndDelete(bytes, FAMILY_NAME, getQualifier(), CompareOp.EQUAL, bytes, delete);
}
示例4: parsePutList
import org.apache.hadoop.hbase.client.Put; //导入方法依赖的package包/类
/**
* override this method to improve performance
*/
@Override protected Map<TableName, List<Put>> parsePutList(List<Put> puts, boolean serverSide) {
Map<TableName, List<Put>> map = new TreeMap<>();
for (Put put : puts) {
byte[] row = put.getRow();
for (Map.Entry<byte[], List<Cell>> entry : put.getFamilyCellMap().entrySet()) {
byte[] family = entry.getKey();
for (Cell cell : entry.getValue()) {
byte[] q = CellUtil.cloneQualifier(cell);
if (tableRelation.isIndexColumn(family, q)) {
TableName indexTableName = tableRelation.getIndexTableName(family, q);
List<Put> list = map.get(indexTableName);
if (list == null) {
list = new ArrayList<>();
map.put(indexTableName, list);
}
Put newPut = new Put(getIndexRow(row, CellUtil.cloneValue(cell)));
if (serverSide) newPut
.addColumn(IndexType.SEDONDARY_FAMILY_BYTES, (byte[]) null, cell.getTimestamp(),
null);
else newPut.addColumn(IndexType.SEDONDARY_FAMILY_BYTES, null, null);
list.add(newPut);
}
}
}
}
tableRelation.getIndexFamilyMap();
return map;
}
示例5: buildModelFromPut
import org.apache.hadoop.hbase.client.Put; //导入方法依赖的package包/类
protected CellSetModel buildModelFromPut(Put put) {
RowModel row = new RowModel(put.getRow());
long ts = put.getTimeStamp();
for (List<Cell> cells: put.getFamilyCellMap().values()) {
for (Cell cell: cells) {
row.addCell(new CellModel(CellUtil.cloneFamily(cell), CellUtil.cloneQualifier(cell),
ts != HConstants.LATEST_TIMESTAMP ? ts : cell.getTimestamp(),
CellUtil.cloneValue(cell)));
}
}
CellSetModel model = new CellSetModel();
model.addRow(row);
return model;
}