设为首页 加入收藏

TOP

大数据——综合案例(五)
2023-07-23 13:34:35 】 浏览:79
Tags:
nbsp;           if (count % 10000 == 0)

                    System.out.println(count);

            }

        } catch (IOException e) {

            e.printStackTrace();

        } finally {

            if (br != null) {

                try {

                    br.close();

                } catch (IOException e) {

                    e.printStackTrace();

                }

            }

            try {

                table.flushCommits();

                table.close(); // must close the client

            } catch (IOException e) {

                e.printStackTrace();

            }

        }

        long en2 = System.currentTimeMillis();

        System.out.println("Total Time: " + (en2 - st) + " ms");

    }

    @SuppressWarnings("deprecation")

    public void put(String line) throws IOException {

        String[] arr = line.split("\t", -1);

        String[] column = {"id","uid","item_id","behavior_type","item_category","date","province"};

 

        if (arr.length == 7) {

            Put put = new Put(Bytes.toBytes(arr[0]));// rowkey

            for(int i=1;i<arr.length;i++){

                put.add(Bytes.toBytes("f1"), Bytes.toBytes(column[i]),Bytes.toBytes(arr[i]));

            }

      

首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Linux中CentOS 7的安装及Linux常.. 下一篇Linux中CentOS 7版本安装JDK、Tom..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目