Github user sbroeder commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/599#discussion_r71370937 --- Diff: core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java --- @@ -1452,6 +1456,72 @@ public Integer doAbortX(final List<TransactionRegionLocation> locations, final l if(LOG.isTraceEnabled()) LOG.trace("doAbortX - Batch -- EXIT txID: " + transactionId); return 0; } + + public Integer pushRegionEpochX(final TransactionState txState, + final HRegionLocation location, HConnection connection) throws IOException { + if (LOG.isTraceEnabled()) LOG.trace("pushRegionEpochX -- Entry txState: " + txState + + " location: " + location); + + Batch.Call<TrxRegionService, PushEpochResponse> callable = + new Batch.Call<TrxRegionService, PushEpochResponse>() { + ServerRpcController controller = new ServerRpcController(); + BlockingRpcCallback<PushEpochResponse> rpcCallback = + new BlockingRpcCallback<PushEpochResponse>(); + + public PushEpochResponse call(TrxRegionService instance) throws IOException { + org.apache.hadoop.hbase.coprocessor.transactional.generated.TrxRegionProtos.PushEpochRequest.Builder + builder = PushEpochRequest.newBuilder(); + builder.setTransactionId(txState.getTransactionId()); + builder.setEpoch(txState.getStartEpoch()); + builder.setRegionName(ByteString.copyFromUtf8(Bytes.toString(location.getRegionInfo().getRegionName()))); + instance.pushOnlineEpoch(controller, builder.build(), rpcCallback); + return rpcCallback.get(); + } + }; + + Map<byte[], PushEpochResponse> result = null; + if (LOG.isTraceEnabled()) LOG.trace("pushRegionEpochX -- before coprocessorService: startKey: " + + new String(startKey, "UTF-8") + " endKey: " + new String(endKey, "UTF-8")); + + boolean loopExit = false; + do + { + try { + result = table.coprocessorService(TrxRegionService.class, startKey, endKey, callable); + loopExit = true; + } + catch (ServiceException se) { + if (LOG.isTraceEnabled()) LOG.trace("pushRegionEpochX -- ServiceException ", se); + throw new IOException(se); + } + catch (Throwable t) { + if (LOG.isTraceEnabled()) LOG.trace("pushRegionEpochX -- Throwable ", t); + throw new IOException(t); + } + + } while (loopExit == false); --- End diff -- Yes good point ________________________________ From: selvaganesang <notificati...@github.com> Sent: Tuesday, July 19, 2016 7:37 AM To: apache/incubator-trafodion Cc: Sean Broeder; Author Subject: Re: [apache/incubator-trafodion] Cherry-pick changes for JIRA 2095 (#599) In core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java<https://github.com/apache/incubator-trafodion/pull/599#discussion_r71351294>: > + do > + { > + try { > + result = table.coprocessorService(TrxRegionService.class, startKey, endKey, callable); > + loopExit = true; > + } > + catch (ServiceException se) { > + if (LOG.isTraceEnabled()) LOG.trace("pushRegionEpochX -- ServiceException ", se); > + throw new IOException(se); > + } > + catch (Throwable t) { > + if (LOG.isTraceEnabled()) LOG.trace("pushRegionEpochX -- Throwable ", t); > + throw new IOException(t); > + } > + > + } while (loopExit == false); It is not clear why do...while loop is needed. - You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<https://github.com/apache/incubator-trafodion/pull/599/files/9bbee32d530e92a8bcaf9786a47ea500aa6d413d#r71351294>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AHwC38zy523BV8p9mDOz73hm9rHPirQLks5qXOE3gaJpZM4JOMC->.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---