incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1294350 - /incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Date Mon, 27 Feb 2012 21:48:01 GMT
Author: kturner
Date: Mon Feb 27 21:48:01 2012
New Revision: 1294350

URL: http://svn.apache.org/viewvc?rev=1294350&view=rev
Log:
ACCUMULO-427 update code no longer accepts updates after a failure occurrs 

Modified:
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1294350&r1=1294349&r2=1294350&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Mon Feb 27 21:48:01 2012
@@ -684,7 +684,7 @@ public class TabletServer extends Abstra
     public Tablet currentTablet;
     public MapCounter<Tablet> successfulCommits = new MapCounter<Tablet>();
     Map<KeyExtent,Long> failures = new HashMap<KeyExtent,Long>();
-    List<KeyExtent> authFailures = new ArrayList<KeyExtent>();
+    HashSet<KeyExtent> authFailures = new HashSet<KeyExtent>();
     public Violations violations;
     public AuthInfo credentials;
     public long totalUpdates = 0;
@@ -1360,6 +1360,14 @@ public class TabletServer extends Abstra
     
     private void setUpdateTablet(UpdateSession us, KeyExtent keyExtent) {
       long t1 = System.currentTimeMillis();
+      if (us.currentTablet != null && us.currentTablet.getExtent().equals(keyExtent))
+        return;
+
+      if (us.currentTablet == null && (us.failures.containsKey(keyExtent) || us.authFailures.contains(keyExtent)))
{
+        // if there were previous failures, then do not accept additional writes
+        return;
+      }
+      
       try {
         // if user has no permission to write to this table, add it to
         // the failures list
@@ -1410,8 +1418,7 @@ public class TabletServer extends Abstra
       
       try {
         KeyExtent keyExtent = new KeyExtent(tkeyExtent);
-        if (us.currentTablet == null || !us.currentTablet.getExtent().equals(keyExtent))
-          setUpdateTablet(us, keyExtent);
+        setUpdateTablet(us, keyExtent);
         
         if (us.currentTablet != null) {
           List<Mutation> mutations = us.queuedMutations.get(us.currentTablet);



Mime
View raw message