accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Elser <josh.el...@gmail.com>
Subject Fwd: [1/2] git commit: ACCUMULO-2480 make the tserver give up and die if openning the WAL experiences 5 errors in 10 seconds
Date Mon, 29 Sep 2014 14:49:41 GMT
http://git-wip-us.apache.org/repos/asf/accumulo/blob/72156b82/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
----------------------------------------------------------------------
diff --git 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
index 243b405..86ae596 100644
--- 
a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
+++ 
b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
@@ -86,6 +91,14 @@ public class TabletServerLogger {

    private final AtomicLong syncCounter;
    private final AtomicLong flushCounter;
+
+  private final static int HALT_AFTER_ERROR_COUNT = 5;
+  private final Cache<Long, Object> walErrors;
+  {
+    // Die if we get 5 WAL creation errors in 10 seconds
+    walErrors = 
CacheBuilder.newBuilder().maximumSize(HALT_AFTER_ERROR_COUNT).expireAfterWrite(10, 
TimeUnit.SECONDS).build();
+  }
+

Why the extra pair of brackets instead of just assigning the new cache 
to walErrors?

Mime
View raw message