Return-Path: X-Original-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-accumulo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C33D87ADC for ; Mon, 24 Oct 2011 22:20:48 +0000 (UTC) Received: (qmail 77782 invoked by uid 500); 24 Oct 2011 22:20:48 -0000 Delivered-To: apmail-incubator-accumulo-commits-archive@incubator.apache.org Received: (qmail 77755 invoked by uid 500); 24 Oct 2011 22:20:48 -0000 Mailing-List: contact accumulo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: accumulo-dev@incubator.apache.org Delivered-To: mailing list accumulo-commits@incubator.apache.org Received: (qmail 77748 invoked by uid 99); 24 Oct 2011 22:20:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 22:20:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 22:20:47 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4FB7823888E4; Mon, 24 Oct 2011 22:20:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: accumulo-commits@incubator.apache.org From: kturner@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111024222027.4FB7823888E4@eris.apache.org> 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 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();