accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1398360 - in /accumulo/trunk: ./ core/ fate/src/main/java/org/apache/accumulo/fate/ server/ server/src/main/java/org/apache/accumulo/server/tabletserver/ server/src/test/java/org/apache/accumulo/server/tabletserver/ src/
Date Mon, 15 Oct 2012 16:16:38 GMT
Author: ecn
Date: Mon Oct 15 16:16:37 2012
New Revision: 1398360

URL: http://svn.apache.org/viewvc?rev=1398360&view=rev
Log:
ACCUMULO-774 re-use the apache commons LRUMap

Removed:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/SimpleLRUCache.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/tabletserver/SimpleLRUCacheTest.java
Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
    accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1398359
  Merged /accumulo/branches/1.4:r1398359

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/core:r1398359
  Merged /accumulo/branches/1.4/src/core:r1398359

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1398359
  Merged /accumulo/branches/1.4/src/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1398359

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1398359
  Merged /accumulo/branches/1.4/src/server:r1398359

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1398360&r1=1398359&r2=1398360&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Mon Oct 15 16:16:37 2012
@@ -198,6 +198,7 @@ import org.apache.accumulo.server.zookee
 import org.apache.accumulo.server.zookeeper.ZooLock;
 import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.start.Platform;
+import org.apache.commons.collections.map.LRUMap;
 import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -2327,7 +2328,7 @@ public class TabletServer extends Abstra
       if (t == null) {
         // Tablet has probably been recently unloaded: repeated master
         // unload request is crossing the successful unloaded message
-        if (!recentlyUnloadedCache.contains(extent)) {
+        if (!recentlyUnloadedCache.containsKey(extent)) {
           log.info("told to unload tablet that was not being served " + extent);
           enqueueMasterMessage(new TabletStatusMessage(TabletLoadState.UNLOAD_FAILURE_NOT_SERVING,
extent));
         }
@@ -2350,7 +2351,7 @@ public class TabletServer extends Abstra
       
       // stop serving tablet - client will get not serving tablet
       // exceptions
-      recentlyUnloadedCache.add(extent);
+      recentlyUnloadedCache.put(extent, System.currentTimeMillis());
       onlineTablets.remove(extent);
       
       try {
@@ -2570,7 +2571,8 @@ public class TabletServer extends Abstra
   private SortedMap<KeyExtent,Tablet> onlineTablets = Collections.synchronizedSortedMap(new
TreeMap<KeyExtent,Tablet>());
   private SortedSet<KeyExtent> unopenedTablets = Collections.synchronizedSortedSet(new
TreeSet<KeyExtent>());
   private SortedSet<KeyExtent> openingTablets = Collections.synchronizedSortedSet(new
TreeSet<KeyExtent>());
-  private Set<KeyExtent> recentlyUnloadedCache = Collections.synchronizedSet(new SimpleLRUCache<KeyExtent>(10));
+  @SuppressWarnings("unchecked")
+  private Map<KeyExtent,Long> recentlyUnloadedCache = (Map<KeyExtent, Long>)Collections.synchronizedMap(new
LRUMap(1000));
   
   private Thread majorCompactorThread;
   

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src/src:r1398359



Mime
View raw message