You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2012/08/16 20:32:38 UTC

svn commit: r1373972 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java

Author: apurtell
Date: Thu Aug 16 18:32:37 2012
New Revision: 1373972

URL: http://svn.apache.org/viewvc?rev=1373972&view=rev
Log:
HBASE-6565. Coprocessor exec result Map is not thread safe (Yuan Kang)

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1373972&r1=1373971&r2=1373972&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/client/HTable.java Thu Aug 16 18:32:37 2012
@@ -29,6 +29,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.Collections;
 import java.util.NavigableMap;
 import java.util.TreeMap;
 import java.util.concurrent.ExecutorService;
@@ -1325,8 +1326,8 @@ public class HTable implements HTableInt
       Batch.Call<T,R> callable)
       throws IOException, Throwable {
 
-    final Map<byte[],R> results = new TreeMap<byte[],R>(
-        Bytes.BYTES_COMPARATOR);
+    final Map<byte[],R> results =  Collections.synchronizedMap(new TreeMap<byte[],R>(
+        Bytes.BYTES_COMPARATOR));
     coprocessorExec(protocol, startKey, endKey, callable,
         new Batch.Callback<R>(){
       public void update(byte[] region, byte[] row, R value) {