cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cassandra-sidecar] dineshjoshi commented on a change in pull request #5: Read config from sidecar.config System Property instead of classpath
Date Thu, 22 Aug 2019 18:38:57 GMT
dineshjoshi commented on a change in pull request #5: Read config from sidecar.config System
Property instead of classpath
URL: https://github.com/apache/cassandra-sidecar/pull/5#discussion_r316828721
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/sidecar/MainModule.java
 ##########
 @@ -103,21 +108,29 @@ public Router vertxRouter(Vertx vertx, HealthService healthService)
     @Singleton
     public Configuration configuration() throws ConfigurationException
     {
-        Configurations confs = new Configurations();
-        File propFile = new File("sidecar.yaml");
-        YAMLConfiguration yamlConf = confs.fileBased(YAMLConfiguration.class, propFile);
-
-        return new Configuration.Builder()
-                           .setCassandraHost(yamlConf.get(String.class, "cassandra.host"))
-                           .setCassandraPort(yamlConf.get(Integer.class, "cassandra.port"))
-                           .setHost(yamlConf.get(String.class, "sidecar.host"))
-                           .setPort(yamlConf.get(Integer.class, "sidecar.port"))
-                           .setHealthCheckFrequency(yamlConf.get(Integer.class, "healthcheck.poll_freq_millis"))
-                           .setKeyStorePath(yamlConf.get(String.class, "sidecar.ssl.keystore.path",
null))
-                           .setKeyStorePassword(yamlConf.get(String.class, "sidecar.ssl.keystore.password",
null))
-                           .setTrustStorePath(yamlConf.get(String.class, "sidecar.ssl.truststore.path",
null))
-                           .setTrustStorePassword(yamlConf.get(String.class, "sidecar.ssl.truststore.password",
null))
-                           .setSslEnabled(yamlConf.get(Boolean.class, "sidecar.ssl.enabled",
false))
-                           .build();
+        String confPath = System.getProperty("sidecar.config", "file://./conf/config.yaml");
 
 Review comment:
   Use `final`s?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message