EdColeman commented on code in PR #3199:
URL: https://github.com/apache/accumulo/pull/3199#discussion_r1114476086
##########
server/base/src/test/java/org/apache/accumulo/server/conf/CheckCompactionConfigTest.java:
##########
@@ -128,6 +128,57 @@ public void testNoPlanner() throws Exception {
assertTrue(e.getMessage().startsWith(expectedErrorMsg));
}
+ @Test
+ public void testRepeatedCompactionExecutorID() throws Exception {
+ String inputString = ("tserver.compaction.major.service.cs1.planner="
+ + "org.apache.accumulo.core.spi.compaction.DefaultCompactionPlanner \n"
+ + "tserver.compaction.major.service.cs1.planner.opts.executors=\\\n"
+ +
"[{'name':'small','type':'internal','maxSize':'16M','numThreads':8},\\\n"
+ +
"{'name':'medium','type':'internal','maxSize':'128M','numThreads':4},\\\n"
+ +
"{'name':'small','type':'internal','numThreads':2}]").replaceAll("'", "\"");
+ String expectedErrorMsg = "Duplicate Compaction Executor ID found";
+
+ String filePath = writeToFileAndReturnPath(inputString);
+
+ var e = assertThrows(IllegalStateException.class,
+ () -> CheckCompactionConfig.main(new String[] {filePath}));
+ assertTrue(e.getMessage().startsWith(expectedErrorMsg));
+ }
+
+ @Test
+ public void testInvalidTypeValue() throws Exception {
+ String inputString = ("tserver.compaction.major.service.cs1.planner="
+ + "org.apache.accumulo.core.spi.compaction.DefaultCompactionPlanner \n"
+ + "tserver.compaction.major.service.cs1.planner.opts.executors=\\\n"
+ +
"[{'name':'small','type':'internal','maxSize':'16M','numThreads':8},\\\n"
+ +
"{'name':'medium','type':'internal','maxSize':'128M','numThreads':4},\\\n"
+ + "{'name':'large','type':'internl','numThreads':2}]").replaceAll("'",
"\"");
+ String expectedErrorMsg = "type must be 'internal' or 'external'";
+
+ String filePath = writeToFileAndReturnPath(inputString);
+
+ var e = assertThrows(IllegalArgumentException.class,
+ () -> CheckCompactionConfig.main(new String[] {filePath}));
+ assertTrue(e.getMessage().startsWith(expectedErrorMsg));
Review Comment:
Sorry - didn't realize that the test was doing that already - all good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]