accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [1/2] accumulo git commit: ACCUMULO-3597 use new connection when sending messages to load metadata tablets
Date Fri, 13 Mar 2015 13:08:24 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 775cdb1b9 -> 1ea901091


ACCUMULO-3597 use new connection when sending messages to load metadata tablets


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4ff11d40
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4ff11d40
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4ff11d40

Branch: refs/heads/1.6
Commit: 4ff11d4089999cbb7775b04e47ed522af62992c9
Parents: 0c300de
Author: Keith Turner <kturner@apache.org>
Authored: Mon Mar 9 12:56:55 2015 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Fri Mar 13 08:18:08 2015 -0400

----------------------------------------------------------------------
 .../accumulo/server/master/LiveTServerSet.java  | 25 ++++++++++++++++----
 1 file changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4ff11d40/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java b/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
index 1dd2db8..8960005 100644
--- a/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
+++ b/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
@@ -82,12 +82,27 @@ public class LiveTServerSet implements Watcher {
       return mlock.getLockID().serialize(ZooUtil.getRoot(instance) + Constants.ZMASTER_LOCK);
     }
 
+    private void loadTablet(TabletClientService.Client client, ZooLock lock, KeyExtent extent)
throws TException {
+      client.loadTablet(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock),
extent.toThrift());
+    }
+
     public void assignTablet(ZooLock lock, KeyExtent extent) throws TException {
-      TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(),
address, conf);
-      try {
-        client.loadTablet(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), lockString(lock),
extent.toThrift());
-      } finally {
-        ThriftUtil.returnClient(client);
+      if (extent.isMeta()) {
+        // see ACCUMULO-3597
+        TTransport transport = ThriftUtil.createTransport(address, conf);
+        try {
+          TabletClientService.Client client = ThriftUtil.createClient(new TabletClientService.Client.Factory(),
transport);
+          loadTablet(client, lock, extent);
+        } finally {
+          transport.close();
+        }
+      } else {
+        TabletClientService.Client client = ThriftUtil.getClient(new TabletClientService.Client.Factory(),
address, conf);
+        try {
+          loadTablet(client, lock, extent);
+        } finally {
+          ThriftUtil.returnClient(client);
+        }
       }
     }
 


Mime
View raw message