ddanielr commented on code in PR #4212:
URL: https://github.com/apache/accumulo/pull/4212#discussion_r1475490432
##########
core/src/test/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlannerTest.java:
##########
@@ -470,6 +470,20 @@ public void testErrorDuplicateMaxSize() {
assertTrue(e.getMessage().contains("maxSize"), "Error message didn't
contain maxSize");
}
+ /**
+ * Tests when executors aren't defined.
+ */
+ @Test
+ public void testErrorNoExecutors() {
+ DefaultCompactionPlanner planner = new DefaultCompactionPlanner();
+ String executors = "";
Review Comment:
Added that test case.
##########
core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java:
##########
@@ -167,6 +167,12 @@ public String toString() {
justification = "Field is written by Gson")
@Override
public void init(InitParameters params) {
+
+ if (params.getOptions().containsKey("executors")
+ && params.getOptions().get("executors").isBlank()) {
+ throw new IllegalStateException("No defined executors for this planner");
+ }
+
Review Comment:
Added a test case for that behavior and found that an NPE would still be
thrown.
Modified the logic to handle that case as well.
--
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]