HBase:如何删除区域

发布于 2024-11-16 08:28:20 字数 108 浏览 7 评论 0原文

由于法律问题,我需要从 HBase 中删除旧数据。

我找到了一种使用我的标准分割区域并将旧数据移动到新区域的方法,但是有没有办法删除该区域?

还有其他想法如何实现目标吗?

Due to legal issues I need to delete old data from HBase.

I found a way to split the region using my criteria and by that moving the old data to the new region, but is there a way to delete that region?

any other idea how to achieve by goal?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

时光清浅 2024-11-23 08:28:20

请尝试

delete '.META.', 'ROW_FROM_META_WITH_YOUR_TABLE'

如果您不确定要删除的行, 对“.META”运行扫描。或将其值转储到文件中:

echo "scan '.META.'"| hbase shell &> dump.txt

然后找到您的行并将其删除。

由于这会给您的区域留下“漏洞”,因此请确保运行 hbase hbck PlatformData -repair 来修复这些问题。

这是一个 小型 java 代码片段,它可以做到这一点,并从底层 HDFS 中删除文件。

Try

delete '.META.', 'ROW_FROM_META_WITH_YOUR_TABLE'

If you are not sure what the row you want to delete run a scan on the ".META." or dump its value into a file:

echo "scan '.META.'"| hbase shell &> dump.txt

then find your row and delete it.

Since this will leave your regions with a "hole", make sure you run hbase hbck PlatformData -repair to fix those.

Here is a small java code snippet that does just that, and deletes files from underlying HDFS.

以歌曲疗慰 2024-11-23 08:28:20

在较新的版本(例如 0.96)中,命令是:

deleteall 'hbase:meta', 'YOUR_ROW'

In the newer versions such as 0.96 the command is:

deleteall 'hbase:meta', 'YOUR_ROW'
单调的奢华 2024-11-23 08:28:20

可以通过删除表中存在的所有列族来删除 Hbase 行键。
如果 hbase 中没有针对 rowkey 的数据,则该键将从 hbase 中删除。这可以使用 Hbase shell 中的 Alter 命令来完成。

尽管这些行键未显示在表中,但已删除行键的区域存在于 .META 中。没有数据。

Hbase rowkeys can be removed by deleting the all columnfamilies present for the table.
If there is no data against a rowkey in hbase the key is removed from hbase. This can be done using the Alter command in the Hbase shell.

Though these rowkeys do not show up in the table the regions for the deleted rowkeys are present in the .META. with no data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文