以下是搜索内容: 关闭

  • 首页
  • 日志
  • 友情链接
  • 关于我

KoiNL.

愿世间美好 温柔以待

“锦鲤握运,未离我韵”

“愿好运常在”

18 分类
0 标签
16 归档
  • 小站首页
  • 个人日志
  • 友情链接
  • 关于自己
  • 我的工具
站点信息

文章数目: 84 篇

最近动态: 2天前

上线时间: 531天

当前版本: v3.0.0

第5章 HBase 分布式数据库

分类: Spark
标签:

创建日期:2023-03-31 17:00:05

Spark计算框架如何在分布式环境下对数据处理后的结构进行随机地、实时地存储?HBase前来解决这个问题。

HBase一般使用Shell命令行或者**Java API **方式进行操作。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[root@hadoop01 conf]# hbase shell
2023-03-31 20:06:06,069 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
Version 2.0.2, r1cfab033e779df840d5612a85277f42a6a4e8172, Tue Aug 28 20:50:40 PDT 2018
Took 0.0022 seconds
hbase(main):001:0> create 'student','info'.'score'
SyntaxError: (hbase):1: syntax error, unexpected tSTRING_BEG
create 'student','info'.'score'


hbase(main):002:0> create 'student','info','score'
Created table student
Took 2.2020 seconds
=> Hbase::Table - student
hbase(main):003:0> list
TABLE
student
1 row(s)
Took 0.0968 seconds
=> ["student"]
hbase(main):004:0> put 'student','1001','info:name','Graay'
Took 0.6300 seconds
hbase(main):006:0> put 'student','1001','info:age','18'
Took 0.0259 seconds
hbase(main):007:0> scan 'student'
ROW COLUMN+CELL
1001 column=info:age, timestamp=1680318580788, value=18
1001 column=info:name, timestamp=1680318521517, value=Gra
ay
1 row(s)
Took 0.1029 seconds
hbase(main):008:0> put 'student','1002','info:age','21'
Took 0.0161 seconds
hbase(main):009:0> scan 'student'
ROW COLUMN+CELL
1001 column=info:age, timestamp=1680318580788, value=18
1001 column=info:name, timestamp=1680318521517, value=Gra
ay
1002 column=info:age, timestamp=1680318604807, value=21
2 row(s)
Took 0.0136 seconds
hbase(main):010:0> describe 'student'
Table student is ENABLED
student
COLUMN FAMILIES DESCRIPTION
{NAME => 'info', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW
_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA
_ON_WRITE => 'false', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER',
MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CA
CHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_BLOOMS_ON_WR
ITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NON
E', BLOCKCACHE => 'true', BLOCKSIZE => '65536'}
{NAME => 'score', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NE
W_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DAT
A_ON_WRITE => 'false', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER',
MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', C
ACHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_BLOOMS_ON_W
RITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NO
NE', BLOCKCACHE => 'true', BLOCKSIZE => '65536'}
2 row(s)
Took 0.2478 seconds
hbase(main):011:0> get 'student','1001'
COLUMN CELL
info:age timestamp=1680318580788, value=18
info:name timestamp=1680318521517, value=Graay
1 row(s)
Took 0.1066 seconds
hbase(main):012:0> count 'student'
2 row(s)
Took 0.0993 seconds
=> 2
hbase(main):013:0> delete 'student','1002','info:sex'
Took 0.0651 seconds
hbase(main):014:0> deleteall 'student','1001'
Took 0.0595 seconds
hbase(main):017:0> truncate 'student'
Truncating 'student' table (it may take a while):
Disabling table...
Truncating table...
Took 2.8205 seconds
hbase(main):019:0> scan 'student'
ROW COLUMN+CELL
0 row(s)
Took 1.4101 seconds
hbase(main):020:0> disable 'student'
Took 0.5823 seconds
hbase(main):021:0> drop 'student'
Took 0.5392 seconds
hbase(main):022:0>


浏览量

评论区

欢迎你留下宝贵的意见,昵称输入QQ号会显示QQ头像哦~

目录

上一篇: 第1章 点云图

下一篇 第4章 Spark SQL结构化数据文件处理

公告栏

《 

 》

Hello~近期剽窃本站内容频发,本站唯一指定网站:https://koinl.github.io。请认准。点击点击此处选择进入。
回到顶部
查看评论

Power By Hexo.

Theme:koinl.

信息来源于锦鲤未离