datax-hbase2stream

勤奋不是嘴上说说而已,而是实际的行动,在勤奋的苦度中持之以恒,永不退却。业精于勤,荒于嬉;行成于思,毁于随。在人生的仕途上,我们毫不迟疑地选择勤奋,她是几乎于世界上一切成就的催产婆。只要我们拥着勤奋去思考,拥着勤奋的手去耕耘,用抱勤奋的心去对待工作,浪迹红尘而坚韧不拔,那么,我们的生命就会绽放火花,让人生的时光更加的闪亮而精彩。

导读:本篇文章讲解 datax-hbase2stream,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文

####准备hadoop,hbase的环境,参考
https://blog.csdn.net/yandao/article/details/108690126

hbase(main):001:0> list
TABLE                                                                                                                                                                                                                                                                                         
0 row(s) in 0.5890 seconds

hbase(main):002:0> create 'datax','t'
0 row(s) in 2.4830 seconds

=> Hbase::Table - datax
hbase(main):003:0> list
TABLE                                                                                                                                            
datax                                                                                                                                                                                                                                                                                           
1 row(s) in 0.0300 seconds

=> ["datax", "t1", "t2"]
hbase(main):004:0> put 'datax','row1','t:name','name1'
0 row(s) in 0.3360 seconds

hbase(main):005:0> put 'datax','row1','t:age','21'
0 row(s) in 0.0200 seconds

hbase(main):006:0> put 'datax','row2','t:age','21'
0 row(s) in 0.0360 seconds

hbase(main):007:0> put 'datax','row2','t:name','name2'
0 row(s) in 0.0630 seconds

hbase(main):008:0> put 'datax','row3','t:name','name3'
0 row(s) in 0.0190 seconds

hbase(main):009:0> put 'datax','row3','t:age','23'
0 row(s) in 0.0330 seconds

hbase(main):010:0> put 'datax','row4','t:age','24'
0 row(s) in 0.0240 seconds

hbase(main):011:0> put 'datax','row4','t:name','name4'
0 row(s) in 0.0230 seconds

hbase(main):012:0> 

####hbase2stream.json

{
    "job": {
        "content": [
            {
                "reader": {
                    "name": "hbase11xreader", 
                    "parameter": {
                       "hbaseConfig": {
                            "hbase.zookeeper.quorum": "192.168.0.200:2182"
                        },
                        "table": "datax",
                        "encoding": "utf-8",
                        "mode": "normal",
                        "column": [
                        {
                          "name":"rowkey",
                          "type":"string"
                        },
                        {
                          "name":"t:name",
                          "type":"string"
                        },
                        {
                          "name":"t:age",
                          "type":"string"
                        }
                        ], 
                      
                        "range": {
                            "endRowkey": "", 
                            "isBinaryRowkey": false, 
                            "startRowkey": ""
                        }
                  
                    }
                }, 
                "writer": {
                    "name": "streamwriter",
                    "parameter": {
                        "print": true
                    }
                }
            }
        ], 
        "setting": {
            "speed": {
                "channel": 5
            }
        }
    }
}

结论

2020-10-30 17:04:04.146 [0-0-0-reader] INFO  HbaseAbstractTask - The task set startRowkey=[], endRowkey=[].
row1    name1   21
row2    name2   21
row3    name3   23
row4    name4   24
2020-10-30 17:04:04.276 [taskGroup-0] INFO  TaskGroupContainer - taskGroup[0] taskId[0] is successed, used[304]ms
2020-10-30 17:04:04.276 [taskGroup-0] INFO  TaskGroupContainer - taskGroup[0] completed it's tasks.
2020-10-30 17:04:13.909 [job-0] INFO  StandAloneJobContainerCommunicator - Total 4 records, 44 bytes | Speed 4B/s, 0 records/s | Error 0 records, 0 bytes |  All Task WaitWriterTime 0.000s |  All Task WaitReaderTime 0.217s | Percentage 100.00%
2020-10-30 17:04:13.911 [job-0] INFO  AbstractScheduler - Scheduler accomplished all tasks.
2020-10-30 17:04:13.921 [job-0] INFO  JobContainer - DataX Writer.Job [streamwriter] do post work.
2020-10-30 17:04:13.923 [job-0] INFO  JobContainer - DataX Reader.Job [hbase11xreader] do post work.
2020-10-30 17:04:13.924 [job-0] INFO  JobContainer - DataX jobId [0] completed successfully.
2020-10-30 17:04:13.927 [job-0] INFO  HookInvoker - No hook invoked, because base dir not exists or is a file: d:\java\datax\hook
2020-10-30 17:04:13.936 [job-0] INFO  JobContainer -
         [total cpu info] =>
                averageCpu                     | maxDeltaCpu                    | minDeltaCpu
                -1.00%                         | -1.00%                         | -1.00%


         [total gc info] =>
                 NAME                 | totalGCCount       | maxDeltaGCCount    | minDeltaGCCount    | totalGCTime        | maxDeltaGCTime     | minDeltaGCTime
                 PS MarkSweep         | 1                  | 1                  | 1                  | 0.038s             | 0.038s             | 0.038s
                 PS Scavenge          | 1                  | 1                  | 1                  | 0.018s             | 0.018s             | 0.018s

2020-10-30 17:04:13.936 [job-0] INFO  JobContainer - PerfTrace not enable!
2020-10-30 17:04:13.939 [job-0] INFO  StandAloneJobContainerCommunicator - Total 4 records, 44 bytes | Speed 4B/s, 0 records/s | Error 0 records, 0 bytes |  All Task WaitWriterTime 0.000s |  All Task WaitReaderTime 0.217s | Percentage 100.00%
2020-10-30 17:04:13.949 [job-0] INFO  JobContainer -
任务启动时刻                    : 2020-10-30 17:03:56
任务结束时刻                    : 2020-10-30 17:04:13
任务总计耗时                    :                 17s
任务平均流量                    :                4B/s
记录写入速度                    :              0rec/s
读出记录总数                    :                   4
读写失败总数                    :                   0


d:\java\datax\bin>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/140799.html

(0)
飞熊的头像飞熊bm

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!