pauloricardomg commented on a change in pull request #1046:
URL: https://github.com/apache/cassandra/pull/1046#discussion_r677375921



##########
File path: src/java/org/apache/cassandra/io/util/FileUtils.java
##########
@@ -1106,4 +1109,9 @@ public static void deleteDirectoryIfEmpty(Path path) 
throws IOException
             }
         }
     }
+
+    public static Map<String, Object> readFileToJson(File file) throws 
IOException {

Review comment:
       no longer needed, please remove

##########
File path: src/java/org/apache/cassandra/service/snapshot/SnapshotManifest.java
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.service.snapshot;
+
+import java.io.File;
+import java.io.IOException;
+import java.time.Instant;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.cassandra.config.Duration;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+
+// Only serialize fields
+@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY,
+                getterVisibility = JsonAutoDetect.Visibility.NONE,
+                setterVisibility = JsonAutoDetect.Visibility.NONE)
+public class SnapshotManifest
+{
+    private static final ObjectMapper mapper = new ObjectMapper();
+    static {
+        mapper.registerModule(new JavaTimeModule());
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, 
false);
+    }
+
+    @JsonProperty("files")
+    public final List<String> files;
+
+    @JsonProperty("created_at")
+    public final Instant createdAt;
+
+    @JsonProperty("expires_at")
+    public final Instant expiresAt;
+
+    /** needed for jackson serialization*/

Review comment:
       add space after `serialization`

##########
File path: src/java/org/apache/cassandra/service/snapshot/SnapshotManager.java
##########
@@ -47,11 +47,21 @@
      */
     private final PriorityQueue<TableSnapshotDetails> expiringSnapshots = new 
PriorityQueue<>(Comparator.comparing(x -> x.getExpiresAt()));
 
+    public PriorityQueue<TableSnapshotDetails> getExpiringSnapshots()

Review comment:
       should return Collection<TableSnapshotDetails> to avoid leaking 
implementation details outside `SnapshotManager` class




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to