keith-turner commented on code in PR #4092: URL: https://github.com/apache/accumulo/pull/4092#discussion_r1433201612
########## core/src/test/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlannerTest.java: ########## @@ -239,6 +243,38 @@ public void testMaxSize() { assertEquals(CompactionExecutorIdImpl.externalId("large"), job.getExecutor()); } + /** + * Tests max.open can be overridden with maxOpen. + */ + @Test + @SuppressWarnings("removal") + public void testOverrideMaxOpen() { + DefaultCompactionPlanner planner = new DefaultCompactionPlanner(); + ConfigurationCopy aconf = new ConfigurationCopy(DefaultConfiguration.getInstance()); + aconf.set(Property.TSERV_MAJC_THREAD_MAXOPEN.getKey(), "5"); + + ConfigurationImpl config = new ConfigurationImpl(aconf); + + ServiceEnvironment senv = EasyMock.createMock(ServiceEnvironment.class); + EasyMock.expect(senv.getConfiguration()).andReturn(config).anyTimes(); + EasyMock.replay(senv); + + String executors = getExecutors("'type': 'internal','maxSize':'32M','numThreads':1", + "'type': 'internal','maxSize':'128M','numThreads':2", "'type': 'external','queue':'q1'"); + + // Test with max.open property + planner.init(getInitParams(senv, executors, "15")); + assertEquals(5, planner.getMaxFilesToCompact()); Review Comment: > while also getting these tests closer to mimicking a real-world situation. That is nice. -- 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: notifications-unsubscr...@accumulo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org