private int setConfigValue(DrillConfig config, String configPath, int defaultValue, CheckValid check) { int configValue; try { configValue = config.getInt(configPath); if (!check.isValid(configValue)) { configValue = defaultValue; } } catch (Exception ex) { // Use defaults, if config values not present or any other issue configValue = defaultValue; } return configValue; }
private int setConfigValue(DrillConfig config, String configPath, int defaultValue, CheckValid check) { int configValue; try { configValue = config.getInt(configPath); if (!check.isValid(configValue)) { configValue = defaultValue; } } catch (Exception ex) { // Use defaults, if config values not present or any other issue configValue = defaultValue; } return configValue; }