[GitHub] incubator-trafodion pull request #599: Cherry-pick changes for JIRA 2095

2016-07-19 Thread sbroeder
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 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 callable =
+   new Batch.Call() {
+  ServerRpcController controller = new ServerRpcController();
+  BlockingRpcCallback rpcCallback =
+ new BlockingRpcCallback();
+
+   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 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 
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:

> +   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,
 or mute the 
thread.



---
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.
---


[GitHub] incubator-trafodion pull request #599: Cherry-pick changes for JIRA 2095

2016-07-19 Thread selvaganesang
Github user selvaganesang commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/599#discussion_r71351960
  
--- Diff: 
core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java
 ---
@@ -694,7 +694,22 @@ public short callCreateTable(long transactionId, 
byte[] pv_htbldesc, Object[]  b
  LOG.error("Error while getting HTableDescriptor caused by : ", 
de);
  throw new IOException("Error while getting HTableDescriptor 
caused by : ", de);
   }
-  trxManager.createTable(ts, htdesc, beginEndKeys);
+  try {
+ trxManager.createTable(ts, htdesc, beginEndKeys);
+  }
+  catch (IOException cte) {
+ if (LOG.isTraceEnabled()) 
LOG.trace("HBaseTxClient:callCreateTable exception trxManager.createTable, 
retval: " +
+TransReturnCode.RET_EXCEPTION.toString() +" txid: " + 
transactionId +" Exception: " + cte);
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ cte.printStackTrace(pw);
--- End diff --

703-705 can be avoided. All the printStackTrace calls were removed as part 
of java exception handling cleanup. Instead you can LOG.error(, e) 
methods


---
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.
---


[GitHub] incubator-trafodion pull request #599: Cherry-pick changes for JIRA 2095

2016-07-19 Thread selvaganesang
Github user selvaganesang commented on a diff in the pull request:

https://github.com/apache/incubator-trafodion/pull/599#discussion_r71351294
  
--- 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 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 callable =
+   new Batch.Call() {
+  ServerRpcController controller = new ServerRpcController();
+  BlockingRpcCallback rpcCallback =
+ new BlockingRpcCallback();
+
+   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 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 --

It is not clear why do...while loop is needed. 


---
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.
---


[GitHub] incubator-trafodion pull request #599: Cherry-pick changes for JIRA 2095

2016-07-18 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-trafodion/pull/599


---
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.
---


[GitHub] incubator-trafodion pull request #599: Cherry-pick changes for JIRA 2095

2016-07-17 Thread sbroeder
GitHub user sbroeder opened a pull request:

https://github.com/apache/incubator-trafodion/pull/599

Cherry-pick changes for JIRA 2095



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/sbroeder/incubator-trafodion sean_2095

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/599.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #599


commit 9fc659ab52e47af92426a535f5e8a88cd9c09023
Author: Sean Broeder 
Date:   2016-06-28T19:54:28Z

Fix to correct loss of updates following a regionServer failure

commit c74e3d62c509c28d890a8329f4346b4b80698064
Author: Sean Broeder 
Date:   2016-07-01T21:43:38Z

Fix to correct loss of updates following a regionServer failure v2

commit b452921fe23a7f6c1cebc8dd670fbcc98a7e88d9
Author: Sean Broeder 
Date:   2016-07-07T03:50:39Z

Cherry-pick changes for JIRA 2095

commit 440123ab824fa6b57ac38293874ca3958e3ffba7
Author: Sean Broeder 
Date:   2016-07-17T04:05:04Z

Merge branch 'master' of github.com:apache/incubator-trafodion into 
sean_2095

Conflicts:

core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java

commit 9bbee32d530e92a8bcaf9786a47ea500aa6d413d
Author: Sean Broeder 
Date:   2016-07-17T09:17:04Z

Merging HEAD into sbroeder_2095




---
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.
---