hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1373975 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HTable.java
Date Thu, 16 Aug 2012 18:45:41 GMT
Author: apurtell
Date: Thu Aug 16 18:45:41 2012
New Revision: 1373975

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

Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HTable.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1373975&r1=1373974&r2=1373975&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/client/HTable.java Thu Aug 16
18:45:41 2012
@@ -28,6 +28,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;
@@ -1238,8 +1239,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) {



Mime
View raw message