Make available keyvalue.datasource override by -D param

This commit is contained in:
Roman Mandeleil 2015-01-20 14:17:40 +02:00
parent d7f2c859ea
commit 158a86dfd2
1 changed files with 9 additions and 0 deletions

View File

@ -84,6 +84,8 @@ public class SystemProperties {
// load a properties file from class path, inside static method
prop.load(input);
overideCLIParams();
} catch (IOException ex) {
logger.error(ex.getMessage(), ex);
} finally {
@ -97,6 +99,13 @@ public class SystemProperties {
}
}
private void overideCLIParams() {
String value = System.getProperty("keyvalue.datasource");
if (value != null){
prop.setProperty("keyvalue.datasource", value);
}
}
public boolean peerDiscovery() {
if (prop.isEmpty()) return true;
return Boolean.parseBoolean(prop.getProperty("peer.discovery"));