当前位置:   article > 正文

【头歌】HBase扫描与过滤_头歌实践中怎么用java来打开hbase

头歌实践中怎么用java来打开hbase

第1关:使用 Shell 命令创建表

start-hbase.sh
create 'exam_tb1','student_info','course_info'
put 'exam_tb1', 'row-1', 'student_info:name', 'zhangsan'
put 'exam_tb1', 'row-1', 'student_info:s_no', '2020001'
put 'exam_tb1', 'row-2', 'student_info:name', 'lisi'
put 'exam_tb1', 'row-2', 'student_info:s_no', '2020002'

put 'exam_tb1', 'row-1', 'course_info:c_no', '123001'
put 'exam_tb1', 'row-1', 'course_info:c_name', 'HBase'
put 'exam_tb1', 'row-2', 'course_info:c_no', '123002'
put 'exam_tb1', 'row-2', 'course_info:c_name', 'Hadoop'
exit

echo "scan 'exam_tb1'" | hbase shell >/root/student.txt
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

第2关:使用 Java API 实现增删操作

在命令行中先启动 HBase (在任意目录输入 start-hbase.sh 命令即可)

命令行

start-hbase.sh
  • 1

代码文件
使用 Java API 实现增删操作

第3关:HBase扫描

在命令行中先启动 HBase (在任意目录输入 start-hbase.sh 命令即可)

命令行

start-hbase.sh
  • 1

代码文件
HBase扫描

第4关:HBase过滤器

在命令行中先启动 HBase (在任意目录输入 start-hbase.sh 命令即可)

命令行

start-hbase.sh
  • 1

代码文件
HBase过滤器

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/817878
推荐阅读
相关标签
  

闽ICP备14008679号