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


##########
src/main/java/org/apache/cassandra/sidecar/MainModule.java:
##########
@@ -304,4 +314,28 @@ public ChecksumVerifier checksumVerifier(Vertx vertx)
     {
         return new MD5ChecksumVerifier(vertx.fileSystem());
     }
+
+    @Provides
+    @Singleton
+    @Named("SidecarVersion")
+    public String sidecarVersion()
+    {
+        String resource = "/sidecar.version";
+        try (InputStream input = 
NodeSettings.class.getResourceAsStream(resource);
+             ByteArrayOutputStream output = new ByteArrayOutputStream())
+        {
+            byte[] buffer = new byte[32];
+            int length;
+            while ((length = input.read(buffer)) >= 0)
+            {
+                output.write(buffer, 0, length);
+            }
+            return output.toString(StandardCharsets.UTF_8.name());
+        }
+        catch (Exception exception)
+        {
+            LOGGER.error("Failed to retrieve Sidecar version", exception);

Review Comment:
   Done.



-- 
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-unsubscr...@cassandra.apache.org

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


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

Reply via email to