use of org.apache.accumulo.core.conf.AccumuloConfiguration in project accumulo by apache.
the class MasterClientServiceHandler method updatePlugins.
private void updatePlugins(String property) {
if (property.equals(Property.MASTER_TABLET_BALANCER.getKey())) {
AccumuloConfiguration conf = master.getConfiguration();
TabletBalancer balancer = Property.createInstanceFromPropertyName(conf, Property.MASTER_TABLET_BALANCER, TabletBalancer.class, new DefaultLoadBalancer());
balancer.init(master);
master.tabletBalancer = balancer;
log.info("tablet balancer changed to {}", master.tabletBalancer.getClass().getName());
}
}
use of org.apache.accumulo.core.conf.AccumuloConfiguration in project accumulo by apache.
the class TCredentialsUpdatingInvocationHandlerTest method setup.
@Before
public void setup() {
cc = new ConfigurationCopy();
conf = new AccumuloConfiguration() {
@Override
public String get(Property property) {
String value = cc.get(property);
if (null == value) {
return DEFAULT_CONFIG.get(property);
}
return value;
}
@Override
public void getProperties(Map<String, String> props, Predicate<String> filter) {
cc.getProperties(props, filter);
}
@Override
public long getUpdateCount() {
return cc.getUpdateCount();
}
};
proxy = new TCredentialsUpdatingInvocationHandler<>(new Object(), conf);
}
use of org.apache.accumulo.core.conf.AccumuloConfiguration in project accumulo by apache.
the class ZooCachePropertyAccessorTest method testGetProperties_Filter.
@Test
public void testGetProperties_Filter() {
Map<String, String> props = new java.util.HashMap<>();
AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
@SuppressWarnings("unchecked") Predicate<String> filter = createMock(Predicate.class);
parent.getProperties(props, filter);
replay(parent);
String child1 = "child1";
List<String> children = new java.util.ArrayList<>();
children.add(child1);
expect(zc.getChildren(PATH)).andReturn(children);
replay(zc);
expect(filter.test(child1)).andReturn(false);
replay(filter);
a.getProperties(props, PATH, filter, parent, null);
assertEquals(0, props.size());
}
use of org.apache.accumulo.core.conf.AccumuloConfiguration in project accumulo by apache.
the class ZooCachePropertyAccessorTest method testGetProperties.
@Test
public void testGetProperties() {
Map<String, String> props = new java.util.HashMap<>();
AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
@SuppressWarnings("unchecked") Predicate<String> filter = createMock(Predicate.class);
parent.getProperties(props, filter);
replay(parent);
String child1 = "child1";
String child2 = "child2";
List<String> children = new java.util.ArrayList<>();
children.add(child1);
children.add(child2);
expect(zc.getChildren(PATH)).andReturn(children);
expect(zc.get(PATH + "/" + child1)).andReturn(VALUE_BYTES);
expect(zc.get(PATH + "/" + child2)).andReturn(null);
replay(zc);
expect(filter.test(child1)).andReturn(true);
expect(filter.test(child2)).andReturn(true);
replay(filter);
a.getProperties(props, PATH, filter, parent, null);
assertEquals(1, props.size());
assertEquals(VALUE, props.get(child1));
verify(parent);
}
use of org.apache.accumulo.core.conf.AccumuloConfiguration in project accumulo by apache.
the class ZooCachePropertyAccessorTest method testGet_Parent_Null.
@Test
public void testGet_Parent_Null() {
AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
expect(parent.get(PROP)).andReturn(null);
replay(parent);
expect(zc.get(FULL_PATH)).andReturn(null);
replay(zc);
assertNull(a.get(PROP, PATH, parent));
}
Aggregations