Skip to content

Configuration

Vinay Chella edited this page Nov 18, 2016 · 27 revisions

NDBench leverages Guice to reduce repetition and in favor of a more readable configuration. The registration of the listener takes place in the web.xml. InjectedWebListener is the logical place where the injectors are created and configured.

Default Implementation

    bind(IConfiguration.class).to(NdBenchConfiguration.class);
    bind(NdBenchMonitor.class).to(FakeMonitor.class);
    bind(IClusterDiscovery.class).to(LocalClusterDiscovery.class);
    bind(DataGenerator.class).to(StringDataGenerator.class);

To use NDBench on AWS, you need to replace LocalClusterDiscovery with AWSLocalClusterDiscovery.

How to Use Configuration source/ Properties:

Configuration Package provides a variety of properties which can be used to configure NDBench

PropertiesConfigSource class reads properties from "NdBench.properties" and reads all the properties provided in configuration.

System Properties class reads properties from "System.getProperties()" and reads all the properties provided.

Properties Interface This interface is a placeholder for all the methods related to configuration.

Properties Implementor This class implements above interface and also provides default properties to use.

How to Use Properties:

Properties inherently use Archaius configuration.

But you can use any of the above methods to supply properties whichever way you would like. (eg. NdBench.properties or System properties)

Another way to provide your properties is by implementing IConfiguration interface.