Firstly, when moving to the delete point in HBase, AFAIK the range is not deleted yet. But there is a way to remove more than one row at a time in the HTableInterface API . To do this, simply create an Delete object with the row keys from the scan and put them on the list and use the API! To speed up the scan, do not include any column family in the scan result, since all you need is a row key to delete entire rows.
Secondly, about design. Firstly, my understanding of the requirement is that there is content with a content identifier, and each content has charts generated against them, and this data is saved; there can be several charts for content by date and depends on the rank. In addition, we want the last generated content table to appear at the top of the table.
For my assumption about the requirement, I would suggest using three tables - auto_id, content_charts and generate_order. The row key for content_charts will be its content identifier, and the row key for generate_order will be long, which will be automatically reduced using the HTableInterface API . To decrease, use "-1" as the sum to offset and initialize the Long.MAX_VALUE value in the auto_id table when you first start the application or manually. Now, if you want to delete chart data, simply clear the column family using delete , then return the new data, and then enter the table of generated_orders. Thus, the last insert will also be at the top of the last insert table, which will contain the content identifier as the cell value. If you want generate_order to have only one entry for each content, first save the identifier of the generated_identification unit and take the value and save it in content_charts when setting and before deleting the column family first remove the row from generate_order. Thus, you can search and display for content using 2, gets the maximum and does not require scanning for diagrams.
I hope this will be helpful.
imyousuf
source share