[
https://issues.apache.org/jira/browse/HBASE-3434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979717#action_12979717
]
dhruba borthakur commented on HBASE-3434:
-----------------------------------------
The idea is that an increment to a counter is recorded in a new record as an
"increment" to the counter, it does not need to have the original value. A new
type of Get() call will assort all the "increment" records associated with this
counter and return the correct value to the application.
In fact, I would like to discuss how the basic Key-Value construct be extended
to a Key-Collection construct. A Collection has base primitives like
adding/deleting/modifying to it, a List and a Counter are two special classes
of this Collection construct. In the current implementation, when an
application wants to delete an element from a Collection, it reads(R) the List
from a HBase key-value, modifies it in memory and then writes a new serialized
Collection back to HBase. If the "Collection" was a basic primitive offered by
HBase, then the application would have just written a new record to indicate
"delete element x from Collection". This would eliminate the step (marked as
(R) above) and converts a read-modify-write to a pure write operation. The
Counter is just a specialized version of a Collection construct. The lazy
background compaction process assorts all the "operations" on the Collection
and materializes a true value of the Collection (let's call it the tombstone).
The creation of the tombstone indicates that all KVs with an older timestamp
can be safely discarded.
The benefit is that all random reads are now converted to sequential reads,
thus leading to better scalability of storage. Another benefit could be that it
might be easier to reduce conflicts while merging records using HBase
replication because it is easier to merge operations-logs rather than absolute
values!
> ability to increment a counter without reading original value from storage
> --------------------------------------------------------------------------
>
> Key: HBASE-3434
> URL: https://issues.apache.org/jira/browse/HBASE-3434
> Project: HBase
> Issue Type: Improvement
> Components: client, regionserver
> Reporter: dhruba borthakur
> Assignee: dhruba borthakur
>
> There are a bunch of applications that do read-modify-write operations on
> HBase constructs, e.g a counter; The counter value has to be read in from
> hdfs before it can be incremented. We have an application where the number
> of increments on a counter far outnumbers the number of times the counter is
> used or read. For these type of applications, it will be very beneficial to
> not have to read in the counter from disk before it can be incremented.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.