Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 872DC968F for ; Sun, 8 Jan 2012 01:19:16 +0000 (UTC) Received: (qmail 71027 invoked by uid 500); 8 Jan 2012 01:19:16 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 70981 invoked by uid 500); 8 Jan 2012 01:19:15 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 70974 invoked by uid 99); 8 Jan 2012 01:19:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jan 2012 01:19:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Jan 2012 01:19:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id ED8C22388980 for ; Sun, 8 Jan 2012 01:18:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@hbase.apache.org From: larsh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120108011853.ED8C22388980@eris.apache.org> 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> + private final Map> cachedRegionLocations = - new HashMap>(); + new HashMap>(); // 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 tableLocations = + SortedMap 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 tableName */ - private SoftValueSortedMap getTableLocations( + private SortedMap getTableLocations( final byte [] tableName) { // find the map of cached locations for this table Integer key = Bytes.mapKey(tableName); - SoftValueSortedMap result; + SortedMap 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 imp } public V get(Object key) { - synchronized (sync) { + synchronized(sync) { checkReferences(); - SoftValue value = this.internalMap.get(key); + SoftValue value = this.internalMap.get(key); if (value == null) { return null; } @@ -121,9 +121,9 @@ public class SoftValueSortedMap imp } public V remove(Object key) { - synchronized (sync) { + synchronized(sync) { checkReferences(); - SoftValue value = this.internalMap.remove(key); + SoftValue value = this.internalMap.remove(key); return value == null ? null : value.get(); } } @@ -225,10 +225,10 @@ public class SoftValueSortedMap imp } public Collection values() { - synchronized (sync) { + synchronized(sync) { checkReferences(); ArrayList hardValues = new ArrayList(); - for (SoftValue softValue : this.internalMap.values()) { + for (SoftValue softValue : this.internalMap.values()) { hardValues.add(softValue.get()); } return hardValues;