HBase table 上的普通 Java 程序和 MapReduce java 程序之间的区别

Difference between plain Java program and MapReduce java program on HBase table

我是 Hadoop 和 Hbase 的新手。我想知道编写普通 java 程序和 MapReduce 程序(用 java 编写)之间的区别,当两者都对 HBase table 中的相同数据执行相同的任务时。

我知道 Pig Scripts 和 Hive Queries 将转换为 MapReduce 程序,并将处理 HDFS 上的数据。甚至 HBase 也将数据存储在 Datanode 上。那么正常的java程序是否会转换为mapper redcucer任务并以批处理的方式处理来自datanode的数据,或者它会线性地处理数据?

请告诉我,java 程序在 HBase Table 上如何处理数据? 提前致谢!!!

I wanted to know the difference between writing plain java program and MapReduce program (written in java), when both perform the same task on the same data in the HBase table.

Hbase 有很多客户端,我们可以使用 java 或 Mapreduce(用 java 编写)程序编写独立的 hbase 客户端

  • 一般小java hbase client是针对小数据的。它不会转换为 map-reduce。它将作为独立客户端工作,不会跨 hadoop 集群节点生成,用于测试目的。

  • Mapreduce 适用于 big/huge 数据集,它使用 YARN 并根据输入拆分(并行性)将任务划分到所有节点。所以它比普通的 java 程序运行得更快。

普通 java 或 mapreduce 程序都使用相同的客户端 api 和 hbase.zookeeper.quorum,但其工作方式不同。

how plain java program works on the HBase Table to process the data?

使用客户端 api 它通过 zookeeper(hbase.zookeeper.quorum & ) 连接并将与 hbase table 交互。例如配置请看下面。

 Configuration conf = HBaseConfiguration.create();
     conf.set("hbase.master","121.33.6.94:60000");
     Configuration config = HBaseConfiguration.create();
     config.set("hbase.zookeeper.quorum", "121.33.6.94");
     config.set("hbase.zookeeper.property.clientPort", "2181");
     config.set("hbase.master", "121.33.6.94:60000");
     config.set("zookeeper.znode.parent", "/hbase-unsecure");

您可以将其视为蜂巢如何使用 jdbc api 进行交互,但方式不同。