Search in sources :

Example 1 with Config

use of org.apache.hadoop.hdds.conf.Config in project ozone by apache.

the class ConfigurationSubCommand method printConfig.

private void printConfig(ConfigGroup configGroup, Class clazz, OzoneConfiguration conf) {
    String prefix = configGroup.prefix();
    for (Field field : clazz.getDeclaredFields()) {
        if (field.isAnnotationPresent(Config.class)) {
            Config config = field.getAnnotation(Config.class);
            String key = prefix + "." + config.key();
            System.out.println(">>> " + key);
            System.out.println("       default: " + config.defaultValue());
            System.out.println("       current: " + conf.get(key));
            System.out.println();
            System.out.println(config.description());
            System.out.println();
            System.out.println();
        }
        final Class superclass = clazz.getSuperclass();
        if (superclass != Object.class) {
            printConfig(configGroup, superclass, conf);
        }
    }
}
Also used : Field(java.lang.reflect.Field) Config(org.apache.hadoop.hdds.conf.Config)

Aggregations

Field (java.lang.reflect.Field)1 Config (org.apache.hadoop.hdds.conf.Config)1