CONTENTS ITEMS 1 ITEMS 2 3 ITEMS 4
- Slides: 43
CONTENTS ITEMS 1 ITEMS 2 3 ITEMS 4 HBase介绍 HBase数据读写流程 HBase模型和系统架构 HBase环境搭建 国家级 程实践教育中心
CONTENTS ITEMS 5 ITEMS 6 7 ITEMS 8 HBase Shell HBase高级特性 HBase程序开发 Map. Reduce On HBase 国家级 程实践教育中心
HBase模型和系统架构 • HBase逻辑模型 HBase是一个类似Big. Table的分布式数据库,它是一个稀疏的长期存储的(存储在硬盘上)、 多维度的、排序的映射表,这张表的索引是行关键字、列关键字和时间戳,HBase中的数据都 是字符串,没有类型。 表 2 -1 HBase的逻辑模型 行健 时间戳 列族anchor 列族info t 4 anchor: tel="01012345678" info: PC="100000" t 3 anchor: name="James" "database. software. www" info: address="Bei. Jing" t 2 t 1 anchor: name="John" info: address="Bei. Jing" t 3 "c. software. www" t 2 anchor: tel="01012345678" t 1 anchor: name="James" 国家级 程实践教育中心
HBase数据读写流程 • HRegion. Server详解 HRegion. Server一般和Data. Node在同一台机器上运行,实现数据的本地性。 HRegion. Server架构如图所示,HRegion. Server包含多个HRegion,由WAL,Block. Cache, Mem. Store和HFile组成。 国家级 程实践教育中心
HBase Shell • 表数据的增删改查 • put命令 向表中插入数据。语法格式:put <table>, <row. Key>, <family: column>, <value>, <timestamp> • get命令 查询数据。语法格式:get <table>, <row. Key>, [<family: column>, . . ] • can命令 扫描表。语法格式:scan <table>, {COLUMNS => [ <family: column>, . . ], LIMIT => num} • delete命令 删除数据。语法格式:delete <table>, <row. Key>, <family: column> , <timestamp> • deleteall命令 删除行。语法格式:deleteall <table>, <row. Key>, <family: column> , <timestamp> • count 查询表中总共有多少行数据。语法格式:count <table> • truncate 清空表。语法格式:truncate <table> 国家级 程实践教育中心
HBase程序开发 • 表的相关操作 • HBase Java API核心类主要有HBase. Configuration,HBase. Admin,HTable和数据操作类组成 HBase Java类 HBase数据模型 HBase. Admin 数据库(Data. Base) HBase. Configuration HTable 表(Table) HTable. Descriptor 列族(Column Family) Put Get 列标识符(Column Qualifier) Scanner 国家级 程实践教育中心
HBase程序开发 • 创建表 import java. io. IOException; import org. apache. hadoop. conf. Configuration; import org. apache. hadoop. hbase. HBase. Configuration; import org. apache. hadoop. hbase. HColumn. Descriptor; import org. apache. hadoop. hbase. HTable. Descriptor; import org. apache. hadoop. hbase. Master. Not. Running. Exception; import org. apache. hadoop. hbase. Table. Name; import org. apache. hadoop. hbase. Zoo. Keeper. Connection. Exception; import org. apache. hadoop. hbase. client. HBase. Admin; public class Create. Table. Demo { static Configuration conf = null; static{ conf = HBase. Configuration. create(); conf. set("hbase. rootdir", " hdfs: //192. 168. 254. 128: 9000/hbase "); conf. set("hbase. master", "hdfs: // 192. 168. 254. 128: 60000"); conf. set("hbase. zookeeper. property. client. Port", "2181"); conf. set("hbase. zookeeper. quorum", "master, slave 1, slave 2"); } public static int create. Table(String table. Name, String[] family) throws Master. Not. Running. Exception, Zoo. Keeper. Connection. Exception, IOException{ HBase. Admin admin = new HBase. Admin(conf); HTable. Descriptor table = new HTable. Descriptor(Table. Name. value. Of(table. Name)); // HTable. Descriptor table = new HTable. Descriptor(table. Name); //HColumn. Descriptor列的相关信息 for(String str : family){ HColumn. Descriptor cloumn = new HColumn. Descriptor(str); // cloumn. set. Max. Versions(3); table. add. Family(cloumn); } if(admin. table. Exists(table. Name)){ System. out. println(table. Name + "已经存在"); return -1; } admin. create. Table(table); admin. close(); System. out. println("create success"); 国家级 程实践教育中心
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Acuity charting forms
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Absorptive atelectasis
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Mosby
- Mosby items and derived items
- Mosby items and derived items
- Autonomic drugs
- Mosby items and derived items
- Mosby items and derived items
- Mosby items and derived items
- Reproductive system
- Mosby items and derived items
- Contents introduction
- Greater sciatic foramen contents
- Oxygen table of contents
- Prophylaxis
- Plasma components
- Geometry table of contents
- Difference between abstract and summary
- Absolute bioavailability
- Ism code objectives
- Quality manual contents
- Subclavian artery
- Contents of urogenital triangle
- Cvs sterno
- Comic book table
- Contents background
- Biceps brachii
- Deep perineal pouch contents