hbase coprocessor 实践:observer

本文介绍了HBase的Coprocessor机制,重点讨论了Observer类型,它类似于数据库的触发器,用于权限管理、监控和二级索引创建。区分了系统级和表级Coprocessor,并详细阐述了表级Observer的使用场景。文章还探讨了Observer的加载方式,包括配置加载和Shell命令加载,以及在加载过程中可能遇到的问题和解决策略,如避免因异常导致的regionserver崩溃,以及处理已加载Coprocessor的更新和替换问题。
摘要由CSDN通过智能技术生成

hbase 的 coprocessor分为observer和endpoint两种方式,具体的区别和应用场景大概如下:

observer 类似于dbms的触发器,工作在服务器端,可以实现权限管理,监控,创建二级索引等

endpoint类似于存储过程,工作在服务器端和客户端,可以实现一些统计型的工作例如:max、min、total等计算

coprocessor 还分为系统级和表级的,系统级的coprocessor会作用于所有的table所有region,而表级的coprocessor只会作用于某个表的region

我们想为表创建一些二级索引表,并且想针对不同的表使用不同的策略。所以使用到了表级的observer的coprocessor。

observer   coprocessor 又分为三类:RegionObserver,WALObserver和MasterObserver。

    RegionObserver: Provides hooks for data manipulation events, Get, Put, Delete, Scan, and so on. There is an instance of a RegionObserver coprocessor
                    for every table region and the scope of the observations they can make is constrained to that region.

    WALObserver: Provides hooks for write-ahead log (WAL) related operations. This is a way to observe or intercept WAL writing and reconstruction events. A WALObserver runs in the context of WAL processing. There is one such context per region server.

    MasterObserver: Provides hooks for DDL-type operation, i.e., create, delete, modify table, etc. The MasterObserver runs within the context of the 
                    HBase master.


<
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值