Skip to content

Commit 93119a5

Browse files
authored
Fix failing 2.1 tests (#6028)
PR #5990 introduced stricter checks to NewTableConfiguration to check that properties or iterators set on the NewTableConfiguration do not conflict with default table properties or iterators. These tests were setting properties which did conflict.
1 parent 552c7a1 commit 93119a5

6 files changed

Lines changed: 9 additions & 7 deletions

File tree

core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ public Map<String,String> getProperties() {
206206
try {
207207
TableOperationsHelper.checkIteratorConflicts(noDefaultsPropMap, setting, scopes);
208208
} catch (AccumuloException e) {
209-
throw new IllegalStateException(e);
209+
throw new IllegalStateException(String.format(
210+
"conflict with default table iterator: scopes: %s setting: %s", scopes, setting), e);
210211
}
211212
});
212213

core/src/main/java/org/apache/accumulo/core/conf/Property.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,9 @@ public enum Property {
13221322
+ " constraints to a table. These properties start with the category"
13231323
+ " prefix, followed by a number, and their values correspond to a fully"
13241324
+ " qualified Java class that implements the Constraint interface.\nFor example:\n"
1325-
+ "table.constraint.1 = org.apache.accumulo.core.constraints.MyCustomConstraint\n"
1326-
+ "and:\n table.constraint.2 = my.package.constraints.MySecondConstraint.",
1325+
+ "table.constraint.2 = org.apache.accumulo.core.constraints.MyCustomConstraint\n"
1326+
+ "and:\n table.constraint.3 = my.package.constraints.MySecondConstraint.\n"
1327+
+ "Note that table.constraint.1 is a reserved, default table constraint.",
13271328
"1.3.5"),
13281329
TABLE_INDEXCACHE_ENABLED("table.cache.index.enable", "true", PropertyType.BOOLEAN,
13291330
"Determines whether index block cache is enabled for a table.", "1.3.5"),

test/src/main/java/org/apache/accumulo/test/BatchWriterIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void testSingleMutationWriteRPC() throws Exception {
111111
String table = getUniqueNames(1)[0];
112112
try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
113113
NewTableConfiguration ntc = new NewTableConfiguration();
114-
ntc.setProperties(Map.of(Property.TABLE_CONSTRAINT_PREFIX.getKey() + "1",
114+
ntc.setProperties(Map.of(Property.TABLE_CONSTRAINT_PREFIX.getKey() + "2",
115115
NumericValueConstraint.class.getName()));
116116
c.tableOperations().create(table, ntc);
117117

test/src/main/java/org/apache/accumulo/test/WriteAfterCloseIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void testWriteAfterClose(TimeType timeType, boolean killTservers, long ti
127127

128128
NewTableConfiguration ntc = new NewTableConfiguration().setTimeType(timeType);
129129
ntc.setProperties(
130-
Map.of(Property.TABLE_CONSTRAINT_PREFIX.getKey() + "1", SleepyConstraint.class.getName()));
130+
Map.of(Property.TABLE_CONSTRAINT_PREFIX.getKey() + "2", SleepyConstraint.class.getName()));
131131

132132
// The short rpc timeout and the random sleep in the constraint can cause some of the writes
133133
// done by a batch writer to timeout. The batch writer will internally retry the write, but the

test/src/main/java/org/apache/accumulo/test/functional/FlushNoFileIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void test() throws Exception {
6868
String tableName = getUniqueNames(1)[0];
6969

7070
NewTableConfiguration ntc = new NewTableConfiguration();
71-
IteratorSetting iteratorSetting = new IteratorSetting(20, NullIterator.class);
71+
IteratorSetting iteratorSetting = new IteratorSetting(30, NullIterator.class);
7272
ntc.attachIterator(iteratorSetting, EnumSet.of(IteratorUtil.IteratorScope.minc));
7373
ntc.withSplits(new TreeSet<>(Set.of(new Text("a"), new Text("s"))));
7474

test/src/main/java/org/apache/accumulo/test/functional/IteratorMincClassCastBugIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void test() throws Exception {
7777
groups.put("g2", Set.of(new Text("odd")));
7878
ntc.setLocalityGroups(groups);
7979

80-
IteratorSetting iteratorSetting = new IteratorSetting(20, ClasCastIterator.class);
80+
IteratorSetting iteratorSetting = new IteratorSetting(30, ClasCastIterator.class);
8181
ntc.attachIterator(iteratorSetting, EnumSet.of(IteratorUtil.IteratorScope.minc));
8282

8383
c.tableOperations().create(tableName, ntc);

0 commit comments

Comments
 (0)