accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1188416 - in /incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server: master/LiveTServerSet.java master/state/tables/TableManager.java tabletserver/Tablet.java
Date Mon, 24 Oct 2011 22:20:27 GMT
Author: kturner
Date: Mon Oct 24 22:20:26 2011
New Revision: 1188416

URL: http://svn.apache.org/viewvc?rev=1188416&view=rev
Log:
ACCUMULO-9 used retrying zooreaderwriter in a few more places

Modified:
    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/master/state/tables/TableManager.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java

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=1188416&r1=1188415&r2=1188416&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
Mon Oct 24 22:20:26 2011
@@ -41,6 +41,7 @@ import org.apache.accumulo.server.conf.S
 import org.apache.accumulo.server.master.state.TServerInstance;
 import org.apache.accumulo.server.security.SecurityConstants;
 import org.apache.accumulo.server.util.AddressUtil;
+import org.apache.accumulo.server.util.Halt;
 import org.apache.accumulo.server.util.time.SimpleTimer;
 import org.apache.accumulo.server.zookeeper.ZooCache;
 import org.apache.accumulo.server.zookeeper.ZooLock;
@@ -301,7 +302,9 @@ public class LiveTServerSet implements W
     try {
       ZooReaderWriter.getRetryingInstance().recursiveDelete(zpath, SKIP);
     } catch (Exception e) {
-      log.error("error removing tablet server lock", e);
+      String msg =  "error removing tablet server lock";
+      log.fatal(msg, e);
+      Halt.halt(msg, -1);
     }
     getZooCache().clear(zpath);
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java?rev=1188416&r1=1188415&r2=1188416&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/state/tables/TableManager.java
Mon Oct 24 22:20:26 2011
@@ -58,7 +58,7 @@ public class TableManager {
       throws KeeperException, InterruptedException {
     // state gets created last
     String zTablePath = Constants.ZROOT + "/" + instanceId + Constants.ZTABLES + "/" + tableId;
-    IZooReaderWriter zoo = ZooReaderWriter.getInstance();
+    IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
     zoo.putPersistentData(zTablePath, new byte[0], existsPolicy);
     zoo.putPersistentData(zTablePath + Constants.ZTABLE_CONF, new byte[0], existsPolicy);
     zoo.putPersistentData(zTablePath + Constants.ZTABLE_NAME, tableName.getBytes(), existsPolicy);
@@ -111,7 +111,7 @@ public class TableManager {
     String statePath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZTABLES
+ "/" + tableId + Constants.ZTABLE_STATE;
     
     try {
-      ZooReaderWriter.getInstance().mutate(statePath, (byte[]) newState.name().getBytes(),
ZooUtil.PUBLIC, new Mutator() {
+      ZooReaderWriter.getRetryingInstance().mutate(statePath, (byte[]) newState.name().getBytes(),
ZooUtil.PUBLIC, new Mutator() {
         @Override
         public byte[] mutate(byte[] oldData) throws Exception {
           TableState oldState = TableState.UNKNOWN;
@@ -179,13 +179,13 @@ public class TableManager {
     prepareNewTableState(instance.getInstanceID(), tableId, tableName, TableState.NEW, existsPolicy);
     String srcTablePath = Constants.ZROOT + "/" + instance.getInstanceID() + Constants.ZTABLES
+ "/" + srcTable + Constants.ZTABLE_CONF;
     String newTablePath = Constants.ZROOT + "/" + instance.getInstanceID() + Constants.ZTABLES
+ "/" + tableId + Constants.ZTABLE_CONF;
-    ZooReaderWriter.getInstance().recursiveCopyPersistent(srcTablePath, newTablePath, NodeExistsPolicy.OVERWRITE);
+    ZooReaderWriter.getRetryingInstance().recursiveCopyPersistent(srcTablePath, newTablePath,
NodeExistsPolicy.OVERWRITE);
     
     for (Entry<String,String> entry : propertiesToSet.entrySet())
       TablePropUtil.setTableProperty(tableId, entry.getKey(), entry.getValue());
     
     for (String prop : propertiesToExclude)
-      ZooReaderWriter.getInstance().recursiveDelete(
+      ZooReaderWriter.getRetryingInstance().recursiveDelete(
           Constants.ZROOT + "/" + instance.getInstanceID() + Constants.ZTABLES + "/" + tableId
+ Constants.ZTABLE_CONF + "/" + prop, NodeMissingPolicy.SKIP);
     
     updateTableStateCache(tableId);
@@ -194,9 +194,9 @@ public class TableManager {
   public void removeTable(String tableId) throws KeeperException, InterruptedException {
     synchronized (tableStateCache) {
       tableStateCache.remove(tableId);
-      ZooReaderWriter.getInstance().recursiveDelete(ZooUtil.getRoot(instance) + Constants.ZTABLES
+ "/" + tableId + Constants.ZTABLE_STATE,
+      ZooReaderWriter.getRetryingInstance().recursiveDelete(ZooUtil.getRoot(instance) + Constants.ZTABLES
+ "/" + tableId + Constants.ZTABLE_STATE,
           NodeMissingPolicy.SKIP);
-      ZooReaderWriter.getInstance().recursiveDelete(ZooUtil.getRoot(instance) + Constants.ZTABLES
+ "/" + tableId, NodeMissingPolicy.SKIP);
+      ZooReaderWriter.getRetryingInstance().recursiveDelete(ZooUtil.getRoot(instance) + Constants.ZTABLES
+ "/" + tableId, NodeMissingPolicy.SKIP);
     }
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1188416&r1=1188415&r2=1188416&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Mon Oct 24 22:20:26 2011
@@ -745,7 +745,7 @@ public class Tablet {
     
     void bringMinorCompactionOnline(Path tmpDatafile, Path newDatafile, Path absMergeFile,
DataFileValue dfv, CommitSession commitSession, long flushId) {
       
-      IZooReaderWriter zoo = ZooReaderWriter.getInstance();
+      IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
       if (extent.equals(Constants.ROOT_TABLET_EXTENT)) {
         try {
           if (!zoo.isLockHeld(tabletServer.getLock().getLockID())) {
@@ -945,7 +945,7 @@ public class Tablet {
         
         t1 = System.currentTimeMillis();
         
-        IZooReaderWriter zoo = ZooReaderWriter.getInstance();
+        IZooReaderWriter zoo = ZooReaderWriter.getRetryingInstance();
         
         dataSourceDeletions.incrementAndGet();
         



Mime
View raw message