You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/07/13 16:50:07 UTC

[GitHub] [cassandra-sidecar] frankgh commented on a diff in pull request #33: CASSANDRASC-40 Fix search in list snapshot endpoint

frankgh commented on code in PR #33:
URL: https://github.com/apache/cassandra-sidecar/pull/33#discussion_r920301917


##########
src/main/java/org/apache/cassandra/sidecar/routes/ListSnapshotFilesHandler.java:
##########
@@ -130,20 +121,18 @@ private ListSnapshotFilesResponse buildResponse(String host,
                                                     ListSnapshotFilesRequest request,
                                                     List<Pair<String, FileProps>> fileList)
     {
-        InstanceMetadata instanceMetadata = instancesConfig.instanceFromHost(host);
-        int sidecarPort = instanceMetadata.port();
-        Path dataDirPath = Paths.get(instanceMetadata.dataDirs().get(DATA_DIR_INDEX));
         ListSnapshotFilesResponse response = new ListSnapshotFilesResponse();
         String snapshotName = request.getSnapshotName();
+        int sidecarPort = configuration.getPort();
 
         for (Pair<String, FileProps> file : fileList)
         {
-            Path pathFromDataDir = dataDirPath.relativize(Paths.get(file.getLeft()));

Review Comment:
   we don't rely on relative paths here for the fix. We use the indexes counting from the end of the path to get the values instead.



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