问题描述
我知道hbase从不对记录进行真正的删除,它只是设置了一个逻辑删除标记.但是,如果数据量越来越大,又有一天您想通过对某些选定的行进行硬删除(实际删除)来减小大小,该怎么办?
I know hbase never do real delete on records and it just set a tombstone marker.But what if the amount of data is getting bigger and bigger, and some day you want to reduce the size by conducting a hard delete (real delete) on some of the selected rows?
推荐答案
在大型压实过程中,删除了标记和删除的单元格.次要压缩只会将较小的HFiles合并为较大的HFile.您可以使用以下命令手动触发主要压缩:
Delete markers and deleted cells are removed during major compaction. Minor compaction only merges small HFiles into bigger. You can trigger major compaction manually by using the following command:
major_compact "table name"
紧凑(次要和主要)是在线操作.无需维护窗口即可执行压缩.
Compaction (minor and major) is an online operation. There is no need of maintenance window to perform compaction.
请记住,大型压缩可能需要很长时间,因为它将重组所有HFile.为了避免对负载较重的系统造成负面的性能影响,您可以考虑将压缩时间安排在高峰时间以外.
Keep in mind that major compaction might take long time since it will reorganize all the HFiles. To avoid negative performance impact for heavily loaded systems, you might consider scheduling compaction outside peak hours.
大型压缩也会自动发生(默认情况下,每7天进行一次).计划的主要压缩的频率是通过 hbase.hregion.majorcompaction
参数控制的.
Major compaction happens also automatically (by default every 7 days). The frequency of scheduled major compaction is controlled through the hbase.hregion.majorcompaction
parameter.
次要压实也可以升级为主要压实.
Minor compaction can also escalate to major.
有关更多详细信息,我建议使用出色的 HBase参考指南.
For further details, I suggest the excellent HBase Reference Guide.
这篇关于有没有办法在HBase上进行硬删除(真实删除)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!