nit0906 commented on code in PR #1560:
URL: https://github.com/apache/jackrabbit-oak/pull/1560#discussion_r1669679890


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/AsyncCheckpointCreator.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * 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.jackrabbit.oak.plugins.index;
+
+import org.apache.jackrabbit.guava.common.collect.ImmutableMap;
+import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.apache.jackrabbit.util.ISO8601;
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.Calendar;
+import java.util.Set;
+
+public class AsyncCheckpointCreator implements Runnable {
+
+    /**
+     * Name of service property which determines the name of Async task
+     */
+    public static final String PROP_ASYNC_NAME = "oak.checkpoint.async";
+
+    private final String name;
+    private long checkpointLifetimeInSeconds;
+    private long minConcurrentCheckpoints;
+    private final NodeStore store;
+    public static final String CHECKPOINT_CREATOR_KEY = "creator";
+    public static final String CHECKPOINT_CREATED_KEY = "created";
+    public static final String CHECKPOINT_CREATED_TIMESTAMP_KEY= 
"created-epoch";
+    public static final String CHECKPOINT_THREAD_KEY = "thread";
+    public static final String CHECKPOINT_NAME_KEY = "name";
+    private static final Logger log = LoggerFactory
+            .getLogger(AsyncCheckpointCreator.class);
+
+    public AsyncCheckpointCreator(@NotNull NodeStore store, @NotNull String 
name, long checkpointLifetimeInSeconds, long minConcurrentCheckpoints) {
+        this.store = store;
+        this.name = name;
+        this.checkpointLifetimeInSeconds = checkpointLifetimeInSeconds;
+        this.minConcurrentCheckpoints = minConcurrentCheckpoints;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    protected long getCheckpointLifetimeInSeconds() {
+        return checkpointLifetimeInSeconds;
+    }
+
+    protected long getMinConcurrentCheckpoints() {
+        return minConcurrentCheckpoints;
+    }
+
+    @Override
+    public void run() {
+        Calendar cal = Calendar.getInstance();

Review Comment:
   I have added the a specific time zone as UTC , but I am not entirely sure if 
it's really needed (unless there could be a scenario where the author leader's 
pod could possibly get created in different timezones ? in which case, the 
default time zone would change).
   
   Either way, I specified it explicitly now. 
   
   Currently not moving to the new Time api , since using oak's ISO8601 for 
formatting, and would need to change that class as well to support the new api.



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

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

Reply via email to