pinpoint,HBase数据清理

HBASE数据清理

pinpoint使用HBASE储存数据,对于HBase进行数据清理。

HBase shell

进入HBASE目录,执行如下命令,进入shell

bin/hbase shell

查看表信息

查看HBASE表:

hbase(main):001:0> list
TABLE                                                                                                                                                          
AgentEvent                                                                                                                                                     
AgentInfo                                                                                                                                                      
AgentLifeCycle                                                                                                                                                 
AgentStatV2                                                                                                                                                    
ApiMetaData                                                                                                                                                    
ApplicationIndex                                                                                                                                               
ApplicationMapStatisticsCallee_Ver2                                                                                                                            
ApplicationMapStatisticsCaller_Ver2                                                                                                                            
ApplicationMapStatisticsSelf_Ver2                                                                                                                              
ApplicationStatAggre                                                                                                                                           
ApplicationTraceIndex                                                                                                                                          
HostApplicationMap_Ver2                                                                                                                                        
SqlMetaData_Ver2                                                                                                                                               
StringMetaData                                                                                                                                                 
TraceV2                                                                                                                                                        
15 row(s) in 0.2120 seconds

查看表描述

查看表描述,里面有个TTL值,代表数据存储时长

hbase(main):002:0> desc 'AgentInfo'
Table AgentInfo is ENABLED                                                                                                                                     
AgentInfo                                                                                                                                                      
COLUMN FAMILIES DESCRIPTION                                                                                                                                    
{ NAME => 'Info', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', 
KEEP_DELETED_CELLS => 'FALSE', 
DATA_BLOCK_ENCODING => 'PREFIX', 
TTL => '31536000 SECONDS (365 DAYS)', 
COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'}                         
1 row(s) in 0.1630 seconds

如果修改表信息

  1. 停用表,使用命令disable 'table_name'
hbase(main):003:0> disable 'TraceV2'
0 row(s) in 8.3610 seconds
  1. 修改表信息;TTL 单位秒。NAME为desc命令查看得的信息
hbase(main):004:0> alter 'AgentInfo' , {NAME=>'Info',TTL=>'604800'}
Updating all regions with the new schema...
256/256 regions updated.
Done.
0 row(s) in 1.9750 seconds
  1. 启用表,使用enable 'table_name'命令
hbase(main):002:0* enable 'TraceV2'
0 row(s) in 28.5440 seconds
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值