use of com.rainsoft.hbase.RowkeyColumnSecondarySort in project beijingThirdPeriod by weidongcao.
the class HBaseUtils method getHFileCellListByRow.
/**
* 根据一条数据及字段名和HBase的RowKey生成HBase的一条数据的多个Cell
*
* @param row 一条数据的多个字段
* @param columns 字段名数组
* @param rowkey HBase的RowKey
* @return 经过二次排序的RDD
*/
public static List<Tuple2<RowkeyColumnSecondarySort, String>> getHFileCellListByRow(Row row, String[] columns, String rowkey) {
// 返回结果集
List<Tuple2<RowkeyColumnSecondarySort, String>> list = new ArrayList<>();
for (int j = 0; j < columns.length; j++) {
Object value = row.get(j);
if (null != value) {
RowkeyColumnSecondarySort sort = new RowkeyColumnSecondarySort(rowkey, columns[j]);
list.add(new Tuple2<>(sort, value.toString()));
}
}
return list;
}
Aggregations