Skip to main content

Posts

Showing posts from January, 2015

How to Locate an HBase Region for a Row Key and Trigger a Major Compaction

This guide explains how to inspect a row key, find the region responsible for that row and perform a targeted major compaction using modern HBase shell commands. Region-level compaction is useful for maintenance, skewed regions and cleanup of deleted data, but should be used carefully due to its I/O impact. Inspecting a Row Key To view a sample of rows from a table: scan 'your_table', { LIMIT => 5 } To inspect a specific row key: get 'your_table', "\x00\x01" Locate the Region for a Specific Row Modern HBase shells allow you to query region boundaries directly. locate_region 'your_table', "\x00\x01" This returns the region name, start key, end key and hosting RegionServer. You can also list all regions for the table: get_regions 'your_table' Triggering a Major Compaction on a Region Once you know the region name (e.g. your_table,,1712087434000.abc123 ), you can run: major_compact 'your_table,,1...