Hbase1.0 客户端api
来源:互联网 发布:mac页面如何放大 编辑:程序博客网 时间:2024/05/21 22:38
最近在试用Hbase1.0的客户端API,发觉变化还是挺大(以前版本也不熟)。到处都是deprecated。
现在应该是这样子:
Configuration conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum", "quorum1,quorum2,quorum3");
conf.set("hbase.zookeeper.property.clientPort", "2181");
connection = ConnectionFactory.createConnection(conf);// HBase 0.99+
//connection = HConnectionManager.createConnection(conf); // HBase <0.99
Table table = connection.getTable(TableName.valueOf("TestTable"));
新的客户端API中,Connection处于关键位置,以下api说明翻译下:
ConnectionFactory
class. The lifecycle of the connection is managed by the caller, who has to close()
the connection to release the resources.The connection object contains logic to find the master, locate regions out on the cluster, keeps a cache of locations and then knows how to re-calibrate after they move. The individual connections to servers, meta cache, zookeeper connection, etc are all shared by the Table
and Admin
instances obtained from this connection.
Connection creation is a heavy-weight operation. Connection implementations are thread-safe, so that the client can create a connection once, and share it with different threads. Table
and Admin
instances, on the other hand, are light-weight and are not thread-safe. Typically, a single connection per client application is instantiated and every thread will obtain its own Table instance. Caching or pooling of Table
and Admin
is not recommended.
This class replaces HConnection
, which is now deprecated.
ConnectionFactory类实例化
。Connection的生命周期由调用者维护,调用者通过调用close(),释放资源。关于 ConnectionFactory.createConnection函数的说明:
public static Connection createConnection(org.apache.hadoop.conf.Configuration conf)
conf
instance. Connection encapsulates all housekeeping for a connection to the cluster. All tables and interfaces created from returned connection share zookeeper connection, meta cache, and connections to region servers and masters. The caller is responsible for calling
Connection.close()
on the returned connection instance.Connection
also returns Admin
and RegionLocator
implementations- Hbase1.0 客户端api
- Hbase1.0 客户端api
- Hbase1.0 客户端api---神算子
- HBase1.0+ java-api 介绍
- HBase1.0以上版本的API改变
- hbase1.0 已经发布
- hbase1.0新特性
- hbase1.0集成phoenix
- HBase1.2.4新版api操作示例
- HBase1.2.4新版本API 操作实例
- hbase1.X的部分api改变(慢慢更新)
- hbase1.0和0.94差别(client端)
- hive2.0版本整合hbase1.2.1
- hive2.0版本整合hbase1.2.1
- Spark 操作 HBase 详解 spark1.4 hbase1.0
- hadoop2.6和hbase1.0单机版安装配置
- Hadoop 2.6.0+Hbase1.12+mahout0.9 集群搭建
- Hadoop 2.6.0+Hbase1.12+mahout0.9 集群搭建
- Eclipse如何修改Web项目的名称
- Java生成和操作Excel文件
- C++转Java自学之路(三)构造代码块、构造函数与static修饰符
- C语言文件操作 fopen, fclose, mkdir(打开关闭文件,建文件夹,判断文件是否存在可读或可写)
- iOS开发 剖析网易新闻标签栏视图切换(addChildViewController属性介绍)
- Hbase1.0 客户端api
- 没有营销,你的微商只是间背街门面 坐等关门
- 浅谈重定向和转发(理论篇)
- Populating Next Right Pointers in Each Node
- sdasd
- myLog.h
- jsp向action传值问题
- 关闭键盘的方法
- java中级-12-GUI图形用户界面(2)-GUI事件响应机制