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



##########
File path: src/java/org/apache/cassandra/config/Duration.java
##########
@@ -0,0 +1,279 @@
+/*
+ * 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.config;
+
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import com.google.common.primitives.Ints;
+
+/**
+ * Represents a positive time duration.
+ */
+public final class Duration
+{
+    /**
+     * The Regexp used to parse the duration provided as String.
+     */
+    private static final Pattern TIME_UNITS_PATTERN = 
Pattern.compile(("^(\\d+)([a-zA-Z]{1,2}|µs|µS)$"));
+    private static final Pattern DOUBLE_TIME_UNITS_PATTERN = 
Pattern.compile(("^(\\d+\\.\\d+)([a-zA-Z]{1,2}|µs|µS)$"));
+    
+    private final long quantity;
+
+    private final TimeUnit unit;
+
+    /**

Review comment:
       not necessary comment block (or comment that method which follows 
properly)

##########
File path: src/java/org/apache/cassandra/db/ColumnFamilyStore.java
##########
@@ -1879,6 +1882,15 @@ private void writeSnapshotManifest(final JSONArray 
filesJSONArr, final String sn
             {
                 final JSONObject manifestJSON = new JSONObject();
                 manifestJSON.put("files", filesJSONArr);
+                if (ttl != null) {
+                    DateFormat df = new 
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S'Z'");

Review comment:
       @fibersel should not this be rewritten to new Duration class? Just 
asking ....




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



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

Reply via email to