Repository: accumulo
Updated Branches:
  refs/heads/master 8158d39c9 -> 4e3911b6a


ACCUMULO-3653 Call testClassLoad on iterators and compaction strategy

Make sure that the classes specified by the client exist in a
tabletserver (although not all of them). Also adds a timeout
to an IT that would otherwise hang.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/4e3911b6
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/4e3911b6
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/4e3911b6

Branch: refs/heads/master
Commit: 4e3911b6ad681a3ed5b1bfeeaff08aa9c1de8406
Parents: 8158d39
Author: Josh Elser <els...@apache.org>
Authored: Mon Mar 9 18:23:18 2015 -0400
Committer: Josh Elser <els...@apache.org>
Committed: Wed Mar 11 17:42:51 2015 -0400

----------------------------------------------------------------------
 .../core/client/impl/TableOperationsImpl.java      | 17 +++++++++++++++++
 .../accumulo/test/UserCompactionStrategyIT.java    |  5 +++++
 2 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/4e3911b6/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
 
b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
index 49dc645..cb35cd2 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
@@ -807,6 +807,23 @@ public class TableOperationsImpl extends 
TableOperationsHelper {
     checkArgument(tableName != null, "tableName is null");
     ByteBuffer EMPTY = ByteBuffer.allocate(0);
 
+    // Ensure compaction iterators exist on a tabletserver
+    final String skviName = SortedKeyValueIterator.class.getName();
+    for (IteratorSetting setting : config.getIterators()) {
+      String iteratorClass = setting.getIteratorClass();
+      if (!testClassLoad(tableName, iteratorClass, skviName)) {
+        throw new AccumuloException("TabletServer could not load iterator 
class " + iteratorClass);
+      }
+    }
+
+    // Make sure the specified compaction strategy exists on a tabletserver
+    final String compactionStrategyName = 
config.getCompactionStrategy().getClassName();
+    if 
(!CompactionStrategyConfigUtil.DEFAULT_STRATEGY.getClassName().equals(compactionStrategyName))
 {
+      if (!testClassLoad(tableName, compactionStrategyName, 
"org.apache.accumulo.tserver.compaction.CompactionStrategy")) {
+        throw new AccumuloException("TabletServer could not load 
CompactionStrategy class " + compactionStrategyName);
+      }
+    }
+
     String tableId = Tables.getTableId(context.getInstance(), tableName);
 
     Text start = config.getStartRow();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/4e3911b6/test/src/test/java/org/apache/accumulo/test/UserCompactionStrategyIT.java
----------------------------------------------------------------------
diff --git 
a/test/src/test/java/org/apache/accumulo/test/UserCompactionStrategyIT.java 
b/test/src/test/java/org/apache/accumulo/test/UserCompactionStrategyIT.java
index 31f7804..e6e766f 100644
--- a/test/src/test/java/org/apache/accumulo/test/UserCompactionStrategyIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/UserCompactionStrategyIT.java
@@ -52,6 +52,11 @@ import com.google.common.collect.ImmutableSet;
 
 public class UserCompactionStrategyIT extends AccumuloClusterIT {
 
+  @Override
+  public int defaultTimeoutSeconds() {
+    return 3 * 60;
+  }
+
   @Test
   public void testDropA() throws Exception {
     Connector c = getConnector();

Reply via email to