You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "dineshjoshi (via GitHub)" <gi...@apache.org> on 2023/06/03 15:27:02 UTC

[GitHub] [cassandra-sidecar] dineshjoshi commented on a diff in pull request #47: CASSANDRASC-52 Sidecar Returns Own Version in Node Settings

dineshjoshi commented on code in PR #47:
URL: https://github.com/apache/cassandra-sidecar/pull/47#discussion_r1215603904


##########
common/src/main/java/org/apache/cassandra/sidecar/common/NodeSettings.java:
##########
@@ -16,33 +16,80 @@
  * limitations under the License.
  */
 
-
 package org.apache.cassandra.sidecar.common;
 
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Collections;
+import java.util.Map;
 import java.util.Objects;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Holds information about the specific node settings
  */
 public class NodeSettings
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger(NodeSettings.class);
+    private static final String VERSION = "version";
+    private static final Map<String, String> SIDECAR = Collections.singletonMap(VERSION, getSidecarVersion());

Review Comment:
   I don't recommend opening a file during static initialization of variables. While this seems like a good idea, it should be avoided. I would prefer reading this explicitly during server initialization and populating the node settings (perhaps injecting it via Guice?).



-- 
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.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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