accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1438320 - /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
Date Fri, 25 Jan 2013 04:40:47 GMT
Author: kturner
Date: Fri Jan 25 04:40:47 2013
New Revision: 1438320

URL: http://svn.apache.org/viewvc?rev=1438320&view=rev
Log:
ACCUMULO-988 prevent concurrent table compactions with per compaction iterators

Modified:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java?rev=1438320&r1=1438319&r2=1438320&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/tableOps/CompactRange.java
Fri Jan 25 04:40:47 2013
@@ -217,14 +217,13 @@ public class CompactRange extends Master
           long flushID = Long.parseLong(new String(tokens[0]));
           flushID++;
           
+          if (tokens.length > 1) {
+            throw new ThriftTableOperationException(tableId, null, TableOperation.COMPACT,
TableOperationExceptionType.OTHER,
+                "Another compaction with iterators is running");
+          }
+
           String txidString = String.format("%016x", tid);
           StringBuilder encodedIterators = new StringBuilder();
-          for (int i = 1; i < tokens.length; i++) {
-            if (tokens[i].startsWith(txidString))
-              continue; // skip self
-            encodedIterators.append(",");
-            encodedIterators.append(tokens[i]);
-          }
 
           if (iterators != null && iterators.getIterators().size() > 0) {
             Hex hex = new Hex();



Mime
View raw message