Using correct mailing list this time. I last worked on 0.90.x code base back in 2011 (or earlier) So I need to pull down 0.90 source code before giving you an answer.
bq. the next planned environment upgrade is towards the 2nd half of this year Please convey to management that the upgrade should be done earlier, if possible. Cheers On Fri, Feb 28, 2014 at 11:03 AM, Shailesh Samudrala <shailesh2...@gmail.com > wrote: > Hi Ted, > > Thank you for the references. Unfortunately, the next planned environment > upgrade is towards the 2nd half of this year. Also, the transactions I > talked about in my earlier email have already been implemented & we are > currently trying to eliminate possibilities for multiple processes > performing transactions on the same HBase row. > > Do you have any inputs/suggestions around rowLocking or something that is > implementable using my current HBase version? > > I really appreciate your help. > > > On Fri, Feb 28, 2014 at 10:52 AM, Ted Yu <yuzhih...@gmail.com> wrote: > >> In newer releases, there are multiple mechanisms where your scenario can >> be implemented. >> >> Please consider upgrading your deployment. >> >> Some references: >> https://blogs.apache.org/hbase/entry/coprocessor_introduction >> src/main/java/org/apache/hadoop/hbase/coprocessor/MultiRowMutationEndpoint.java >> (0.94) >> >> >> On Fri, Feb 28, 2014 at 10:44 AM, Shailesh Samudrala < >> shailesh2...@gmail.com> wrote: >> >>> The version I'm using is 0.90.6. >>> >>> We are trying to implement rowLock & rowUnLock on a HBase table to >>> support our multi-operation transactions on a JSON object(receive value >>> from user -> read HBase row -> calculate new value based on received value >>> and current value in HBase -> put new Value to HBase) >>> >>> We want the transaction to go through without any writes occurring in >>> between from other processes which also access the table, therefore we are >>> trying to implement this using RowLocks. >>> >>> >>> >>> >>> >>> On Thu, Feb 27, 2014 at 10:16 PM, Ted Yu <yuzhih...@gmail.com> wrote: >>> >>>> You're using 0.94, right ? >>>> >>>> RowLock has been dropped since 0.96.0 >>>> >>>> Can you tell us more about your use case ? >>>> >>>> >>>> On Thu, Feb 27, 2014 at 9:56 PM, Shailesh Samudrala < >>>> shailesh2...@gmail.com> wrote: >>>> >>>>> I'm running a sample code I wrote to test HBase lockRow() and >>>>> unlockRow() methods. The sample code is below: >>>>> >>>>> HTable table = new HTable(config, "test"); >>>>> RowLock rowLock = table.lockRow(Bytes.toBytes(row)); >>>>> System.out.println("Obtained rowlock on " + row + "\nRowLock: " + >>>>> rowLock); >>>>> >>>>> Put p = new Put(Bytes.toBytes(row)); >>>>> p.add(Bytes.toBytes("colFamily"), Bytes.toBytes(colFamily), >>>>> Bytes.toBytes(value)); >>>>> table.put(p); >>>>> System.out.println("put row"); >>>>> table.unlockRow(rowLock); >>>>> System.out.println("Unlocked row!"); >>>>> >>>>> >>>>> When I execute my code, I get an UnknownRowLockException. The >>>>> documentation says that this error is thrown when an unknown row lock is >>>>> passed to the region servers. I'm not sure how this is happening & how to >>>>> resolve it. >>>>> >>>>> The stack trace is below: >>>>> >>>>> Obtained rowlock on row2 >>>>> RowLock: org.apache.hadoop.hbase.client.RowLock@15af33d6 >>>>> put row >>>>> Exception in thread "main" >>>>> org.apache.hadoop.hbase.UnknownRowLockException: >>>>> org.apache.hadoop.hbase.UnknownRowLockException: 5763272717012243790 >>>>> at >>>>> org.apache.hadoop.hbase.regionserver.HRegionServer.unlockRow(HRegionServer.java:2099) >>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>> at >>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>>> at >>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>>> at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:604) >>>>> at >>>>> org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1055) >>>>> >>>>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native >>>>> Method) >>>>> at >>>>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) >>>>> at >>>>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) >>>>> at java.lang.reflect.Constructor.newInstance(Constructor.java:513) >>>>> at >>>>> org.apache.hadoop.hbase.RemoteExceptionHandler.decodeRemoteException(RemoteExceptionHandler.java:96) >>>>> at >>>>> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.translateException(HConnectionManager.java:1268) >>>>> at >>>>> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getRegionServerWithRetries(HConnectionManager.java:1014) >>>>> at org.apache.hadoop.hbase.client.HTable.unlockRow(HTable.java:870) >>>>> at HelloWorld.Hello.HelloWorld.main(HelloWorld.java:41) >>>>> >>>>> >>>> >>> >> >