Hbase 獲取 rowkey list

HTableInterface table = conn.getTable(tableName);
        try{
            List<Get> gets=new ArrayList<Get>();
            List<Result> lstResult = new ArrayList<Result>();
            for(String rowkey : lstRowkey){
                Get get=new Get(rowkey.getBytes());
                get.setMaxVersions(1000);
                gets.add(get);
            }
            
            Result res[]=table.get(gets);
            lstResult=Arrays.asList(res);
//            lstResult.add(res);        
            return lstResult;
        }
        catch(Exception ex){
            log.info(String.valueOf(ex));
            throw ex;
            
        }
        finally{
            table.close();
        }
相關文章
相關標籤/搜索