hadoop - Hbase auto increment any column/row-key -
i new hbase
is possible to/how can auto increment row-key in hbase? (like each insert row-key has auto increment itself)
or possible auto-increment other column ? (like each insert column has auto-increment 1)
monolitically increasing row keys not recommended in hbase, see reference: http://hbase.apache.org/book/rowkey.design.html, p.6.3.2. in fact, using globally ordered row keys cause instances of distributed application write same region, become bottleneck.
if can avoid using auto-increment ids , need have unique ids in distributed system, can utilize "hostname" + "pid" + "timestamp" key. way unique each row
if sure need global autoincrement in table (it can key or value column), can utilize incrementcolumnvalue phone call - have separate row in table (or create dedicated table this) store actual value, , process phone call incrementcolumnvalue before inserting new row next value. way cannot guarantee there no gaps: if client fail after calling incrementcolumnvalue, might counter incremented row won't inserted.
in short, of proposed solutions client-side, there no server-side implementation feature in hbase
hadoop cassandra nosql hbase
No comments:
Post a Comment