use of org.apache.accumulo.core.spi.common.ServiceEnvironment.Configuration in project accumulo by apache.
the class DefaultCompactionPlannerTest method testErrorExternalTypeNumThreads.
/**
* Test external type executor with numThreads set throws error.
*/
@Test
public void testErrorExternalTypeNumThreads() {
DefaultCompactionPlanner planner = new DefaultCompactionPlanner();
Configuration conf = EasyMock.createMock(Configuration.class);
EasyMock.expect(conf.isSet(EasyMock.anyString())).andReturn(false).anyTimes();
ServiceEnvironment senv = EasyMock.createMock(ServiceEnvironment.class);
EasyMock.expect(senv.getConfiguration()).andReturn(conf).anyTimes();
EasyMock.replay(conf, senv);
String executors = getExecutors("'type': 'internal','maxSize':'32M','numThreads':1", "'type': 'internal','maxSize':'128M','numThreads':2", "'type': 'external','maxSize':'512M','numThreads':3");
var e = assertThrows(IllegalArgumentException.class, () -> planner.init(getInitParams(senv, executors)), "Failed to throw error");
assertTrue(e.getMessage().contains("numThreads"), "Error message didn't contain numThreads");
}
use of org.apache.accumulo.core.spi.common.ServiceEnvironment.Configuration in project accumulo by apache.
the class ConfigurationImpl method getDerived.
@Override
public <T> Supplier<T> getDerived(Function<PluginEnvironment.Configuration, T> computeDerivedValue) {
Configuration outerConfiguration = this;
AccumuloConfiguration.Deriver<T> deriver = acfg.newDeriver(entries -> computeDerivedValue.apply(outerConfiguration));
return deriver::derive;
}
Aggregations