hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject svn commit: r1228761 - in /hbase/trunk/src/main/java/org/apache/hadoop/hbase: client/HConnectionManager.java util/SoftValueSortedMap.java
Date Sun, 08 Jan 2012 01:18:53 GMT
Author: larsh
Date: Sun Jan  8 01:18:53 2012
New Revision: 1228761

URL: http://svn.apache.org/viewvc?rev=1228761&view=rev
Log:
HBASE-5088  addendum

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1228761&r1=1228760&r2=1228761&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java Sun Jan
 8 01:18:53 2012
@@ -522,9 +522,9 @@ public class HConnectionManager {
      * Map of table to table {@link HRegionLocation}s.  The table key is made
      * by doing a {@link Bytes#mapKey(byte[])} of the table's name.
      */
-    private final Map<Integer, SoftValueSortedMap<byte [], HRegionLocation>>
+    private final Map<Integer, SortedMap<byte [], HRegionLocation>>
       cachedRegionLocations =
-        new HashMap<Integer, SoftValueSortedMap<byte [], HRegionLocation>>();
+        new HashMap<Integer, SortedMap<byte [], HRegionLocation>>();
 
     // The presence of a server in the map implies it's likely that there is an
     // entry in cachedRegionLocations that map to this server; but the absence
@@ -1069,7 +1069,7 @@ public class HConnectionManager {
      */
     HRegionLocation getCachedLocation(final byte [] tableName,
         final byte [] row) {
-      SoftValueSortedMap<byte [], HRegionLocation> tableLocations =
+      SortedMap<byte [], HRegionLocation> tableLocations =
         getTableLocations(tableName);
 
       // start to examine the cache. we can only do cache actions
@@ -1180,11 +1180,11 @@ public class HConnectionManager {
      * @param tableName
      * @return Map of cached locations for passed <code>tableName</code>
      */
-    private SoftValueSortedMap<byte [], HRegionLocation> getTableLocations(
+    private SortedMap<byte [], HRegionLocation> getTableLocations(
         final byte [] tableName) {
       // find the map of cached locations for this table
       Integer key = Bytes.mapKey(tableName);
-      SoftValueSortedMap<byte [], HRegionLocation> result;
+      SortedMap<byte [], HRegionLocation> result;
       synchronized (this.cachedRegionLocations) {
         result = this.cachedRegionLocations.get(key);
         // if tableLocations for this table isn't built yet, make one

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java?rev=1228761&r1=1228760&r2=1228761&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/util/SoftValueSortedMap.java Sun Jan
 8 01:18:53 2012
@@ -106,9 +106,9 @@ public class SoftValueSortedMap<K,V> imp
   }
 
   public V get(Object key) {
-    synchronized (sync) {
+    synchronized(sync) {
       checkReferences();
-      SoftValue<K, V> value = this.internalMap.get(key);
+      SoftValue<K,V> value = this.internalMap.get(key);
       if (value == null) {
         return null;
       }
@@ -121,9 +121,9 @@ public class SoftValueSortedMap<K,V> imp
   }
 
   public V remove(Object key) {
-    synchronized (sync) {
+    synchronized(sync) {
       checkReferences();
-      SoftValue<K, V> value = this.internalMap.remove(key);
+      SoftValue<K,V> value = this.internalMap.remove(key);
       return value == null ? null : value.get();
     }
   }
@@ -225,10 +225,10 @@ public class SoftValueSortedMap<K,V> imp
   }
 
   public Collection<V> values() {
-    synchronized (sync) {
+    synchronized(sync) {
       checkReferences();
       ArrayList<V> hardValues = new ArrayList<V>();
-      for (SoftValue<K, V> softValue : this.internalMap.values()) {
+      for (SoftValue<K,V> softValue : this.internalMap.values()) {
         hardValues.add(softValue.get());
       }
       return hardValues;



Mime
View raw message