accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1196189 - in /incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server: client/HdfsZooInstance.java master/LiveTServerSet.java zookeeper/ZooLock.java
Date Tue, 01 Nov 2011 18:26:03 GMT
Author: vines
Date: Tue Nov  1 18:26:02 2011
New Revision: 1196189

URL: http://svn.apache.org/viewvc?rev=1196189&view=rev
Log:
fixes accumulo-11

Modified:
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java?rev=1196189&r1=1196188&r2=1196189&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
Tue Nov  1 18:26:02 2011
@@ -99,7 +99,7 @@ public class HdfsZooInstance implements 
     
     OpTimer opTimer = new OpTimer(log, Level.TRACE).start("Looking up master location in
zoocache.");
     
-    byte[] loc = ZooLock.getLockData(zooCache, masterLocPath);
+    byte[] loc = ZooLock.getLockData(zooCache, masterLocPath, null);
     
     opTimer.stop("Found master at " + (loc == null ? null : new String(loc)) + " in %DURATION%");
     

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java?rev=1196189&r1=1196188&r2=1196189&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/LiveTServerSet.java
Tue Nov  1 18:26:02 2011
@@ -52,6 +52,7 @@ import org.apache.thrift.TException;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
+import org.apache.zookeeper.data.Stat;
 
 public class LiveTServerSet implements Watcher {
   
@@ -225,14 +226,15 @@ public class LiveTServerSet implements W
           // Nope... there's a server out there: is this is a new server?
           if (info == null) {
             // Yep: hold onto the information about this server
-            byte[] lockData = ZooLock.getLockData(lockPath);
+            Stat stat = new Stat();
+            byte[] lockData = ZooLock.getLockData(lockPath, stat);
             String lockString = new String(lockData == null ? new byte[] {} : lockData);
             if (lockString.length() > 0 && !lockString.equals("master")) {
               ServerServices services = new ServerServices(new String(lockData));
               InetSocketAddress client = services.getAddress(ServerServices.Service.TSERV_CLIENT);
               InetSocketAddress addr = AddressUtil.parseAddress(server, Property.TSERV_CLIENTPORT);
               TServerConnection conn = new TServerConnection(addr);
-              instance = new TServerInstance(client, lock.getSessionId());
+              instance = new TServerInstance(client, stat.getEphemeralOwner());
               info = new TServerInfo(lock, instance, conn, watcher);
               current.put(server, info);
               updates.add(instance);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java?rev=1196189&r1=1196188&r2=1196189&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
Tue Nov  1 18:26:02 2011
@@ -352,7 +352,7 @@ public class ZooLock implements Watcher 
     return zk.getData(path + "/" + lockNode, false, null);
   }
   
-  public static byte[] getLockData(org.apache.accumulo.core.zookeeper.ZooCache zc, String
path) {
+  public static byte[] getLockData(org.apache.accumulo.core.zookeeper.ZooCache zc, String
path, Stat stat) {
     
     List<String> children = zc.getChildren(path);
     
@@ -369,13 +369,17 @@ public class ZooLock implements Watcher 
       throw new RuntimeException("Node " + lockNode + " at " + path + " is not a lock node");
     }
     
-    return zc.get(path + "/" + lockNode);
+    return zc.get(path + "/" + lockNode, stat);
   }
   
   private static ZooCache getLockDataZooCache = new ZooCache();
   
   public static byte[] getLockData(String path) {
-    return getLockData(getLockDataZooCache, path);
+    return getLockData(path, null);
+  }
+
+  public static byte[] getLockData(String path, Stat stat) {
+    return getLockData(getLockDataZooCache, path, stat);
   }
   
   public static long getSessionId(ZooCache zc, String path) throws KeeperException, InterruptedException
{



Mime
View raw message