读取HBase的表数据,然后将数据写入到hdfs上面去

读取HBase的表数据,然后将数据写入到hdfs上面去
1、Mapper

 public static class mapHdfs extends TableMapper<Text, Text> {
   

        @Override
        protected void map(ImmutableBytesWritable key, Result value, Context context) throws IOException, InterruptedException {
   
            byte[] bytes = key.get();
            String rowkey = Bytes.toString(bytes);
            String address="";
            String sex="";
            String name="";
            int id=0;

            Cell[] cells = value.rawCells();
            for (Cell cell : cells) {
   
                if ("f2".equals(Bytes.toString(CellUtil.cloneFamily(cell)))){
   
                    if ("address".equals(Bytes.toString(CellUtil

你可能感兴趣的:(HBase,hbase)