LakshSingla commented on code in PR #13269: URL: https://github.com/apache/druid/pull/13269#discussion_r1012524958
########## extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleanerConfig.java: ########## @@ -0,0 +1,89 @@ +/* + * 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.druid.msq.indexing; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.Preconditions; + +public class DurableStorageCleanerConfig +{ + + private static final long DEFAULT_INITIAL_DELAY_SECONDS = 86400L; + private static final long DEFAULT_DELAY_SECONDS = 86400L; + + /** + * Whether the {@link DurableStorageCleaner} helper should be enabled or not + */ + @JsonProperty + private final boolean enabled; + + /** + * Initial delay in seconds post which the durable storage cleaner should run + */ + @JsonProperty + private final long initialDelaySeconds; + + /** + * The delay (in seconds) after the last run post which the durable storage cleaner would clean the outputs + */ + @JsonProperty + private final long delaySeconds; + + @JsonCreator + public DurableStorageCleanerConfig( + @JsonProperty("enabled") final Boolean enabled, + @JsonProperty("initialDelay") final Long initialDelaySeconds, + @JsonProperty("delay") final Long delaySeconds + ) + { + this.enabled = enabled != null && enabled; Review Comment: I kept it disabled in case the location for the temp storage is also used for storing any other files. This might be not be prevalant in local storage but for S3 or other cloud storages, I think it would be better if this property is explicitly setup. I don't have a hard opinion on this but this was my reasoning behind this. -- 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]
