accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject git commit: ACCUMULO-1833 Change out the AtomicInteger to AtomicLong to make it slightly more robust.
Date Wed, 13 Nov 2013 02:09:50 GMT
Updated Branches:
  refs/heads/ACCUMULO-1833-caching 29efac97c -> c384ab298


ACCUMULO-1833 Change out the AtomicInteger to AtomicLong to make it slightly more robust.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c384ab29
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c384ab29
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c384ab29

Branch: refs/heads/ACCUMULO-1833-caching
Commit: c384ab29842c3197ec800418621d3df78ecdf57b
Parents: 29efac9
Author: Josh Elser <elserj@apache.org>
Authored: Tue Nov 12 18:00:07 2013 -0800
Committer: Josh Elser <elserj@apache.org>
Committed: Tue Nov 12 18:00:07 2013 -0800

----------------------------------------------------------------------
 .../core/client/impl/MultiTableBatchWriterImpl.java       | 10 +++++-----
 .../java/org/apache/accumulo/core/client/impl/Tables.java |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/c384ab29/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
index b99c42b..bd9fbf6 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/MultiTableBatchWriterImpl.java
@@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -48,7 +48,7 @@ public class MultiTableBatchWriterImpl implements MultiTableBatchWriter
{
   
   static final Logger log = Logger.getLogger(MultiTableBatchWriterImpl.class);
   private AtomicBoolean closed;
-  private AtomicInteger cacheLastState;
+  private AtomicLong cacheLastState;
 
   private class TableBatchWriter implements BatchWriter {
 
@@ -116,7 +116,7 @@ public class MultiTableBatchWriterImpl implements MultiTableBatchWriter
{
     this.bw = new TabletServerBatchWriter(instance, credentials, config);
     tableWriters = new ConcurrentHashMap<String,BatchWriter>();
     this.closed = new AtomicBoolean(false);
-    this.cacheLastState = new AtomicInteger(0);
+    this.cacheLastState = new AtomicLong(0);
 
     nameToIdCache = CacheBuilder.newBuilder().expireAfterWrite(cacheTime, cacheTimeUnit).concurrencyLevel(8).maximumSize(64).initialCapacity(16)
         .build(new TableNameToIdLoader());
@@ -190,8 +190,8 @@ public class MultiTableBatchWriterImpl implements MultiTableBatchWriter
{
   public BatchWriter getBatchWriter(String tableName) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException {
     ArgumentChecker.notNull(tableName);
     
-    int cacheResetCount = Tables.getCacheResetCount();
-    int internalResetCount = cacheLastState.get();
+    long cacheResetCount = Tables.getCacheResetCount();
+    long internalResetCount = cacheLastState.get();
     
     if (cacheResetCount > internalResetCount) {
       cacheLastState.set(cacheResetCount);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/c384ab29/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
index 2a85954..d1b10d4 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
@@ -21,7 +21,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
 import java.util.TreeMap;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Instance;
@@ -32,7 +32,7 @@ import org.apache.accumulo.fate.zookeeper.ZooCache;
 
 public class Tables {
   private static SecurityPermission TABLES_PERMISSION = new SecurityPermission("tablesPermission");
-  private static AtomicInteger cacheResetCount = new AtomicInteger(0);
+  private static AtomicLong cacheResetCount = new AtomicLong(0);
   
   private static ZooCache getZooCache(Instance instance) {
     SecurityManager sm = System.getSecurityManager();
@@ -115,7 +115,7 @@ public class Tables {
     return TableState.valueOf(new String(state));
   }
   
-  public static int getCacheResetCount() {
+  public static long getCacheResetCount() {
     return cacheResetCount.get();
   }
 }


Mime
View raw message