How to findout Hbase PUT inserts a new Row or Update an exisiting row

2014-11-03 Thread Bora, Venu
Hello, We have a requirement to determine whether a PUT will create a new row or update an existing one. I looked at using preBatchMutate in a co-processor and have the code below. Few things I need to ask: 1) Is there a more efficient way of doing this? 2) Will region.getClosestRowBefore() add

How to findout Hbase PUT inserts a new Row or Update an exisiting row

2014-10-31 Thread Bora, Venu
Hello, We have a requirement to determine whether a PUT will create a new row or update an existing one. I looked at using preBatchMutate in a co-processor and have the code below. Few things I need to ask: 1) Is there a more efficient way of doing this? 2) Will region.getClosestRowBefore() add

Re: How to findout Hbase PUT inserts a new Row or Update an exisiting row

2014-10-31 Thread Ted Yu
For #2, region.getClosestRowBefore() calls store.getRowKeyAtOrBefore(row) Take a look at HStore#getRowKeyAtOrBefore() (around line 1619): IteratorStoreFile sfIterator = this.storeEngine .getStoreFileManager() .getCandidateFilesForRowKeyBefore(state.getTargetKey()); while