更新时间:2023-07-14 GMT+08:00
步骤3:发送数据到DIS
功能简介
将用户本地数据通过DIS通道不断上传至DIS服务。
样例代码
样例工程为DIS SDK桶中下载的“huaweicloud-sdk-dis-java-X.X.X.zip”压缩包中“\dis-sdk-demo\src\main\java\com\bigdata\dis\sdk\demo”路径下“ProducerDemo.java”文件。
运行程序
程序开发完成后,右键选择“Run As > 1 Java Application”运行程序,如图1所示。
数据上传过程中可在Console控制台查看数据上传通道量信息。出现类似信息表示数据上传成功。
14:40:20.090 [main] INFOcom.bigdata.dis.sdk.DISConfig - get from classLoader 14:40:20.093 [main] INFODEMOT - ========== BEGIN PUT ============ 14:40:21.186 [main] INFOcom.bigdata.dis.sdk.util.config.ConfigurationUtils - get from classLoader 14:40:21.187 [main] INFOcom.bigdata.dis.sdk.util.config.ConfigurationUtils - propertyMapFromFile size : 2 14:40:22.092 [main] INFOcom.bigdata.dis.sdk.demo.ProducerDemo - Put 3 records[3 successful / 0 failed]. 14:40:22.092 [main] INFOcom.bigdata.dis.sdk.demo.ProducerDemo - [hello world.] put success, partitionId [shardId-0000000000], partitionKey [964885], sequenceNumber [0] 14:40:22.092 [main] INFOcom.bigdata.dis.sdk.demo.ProducerDemo - [hello world.] put success, partitionId [shardId-0000000000], partitionKey [910960], sequenceNumber [1] 14:40:22.092 [main] INFOcom.bigdata.dis.sdk.demo.ProducerDemo - [hello world.] put success, partitionId [shardId-0000000000], partitionKey [528377], sequenceNumber [2] 14:40:22.092 [main] INFOcom.bigdata.dis.sdk.demo.ProducerDemo - ========== PUT OVER ============