package com.hubspot.singularity.executor.config;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.hubspot.singularity.executor.SingularityExecutorLogrotateFrequency;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public class SingularityExecutorLogrotateAdditionalFile {
    private final String filename;
    private final Optional<String> extension;
    private final Optional<String> dateformat;
    private final Optional<SingularityExecutorLogrotateFrequency> logrotateFrequencyOverride;

    @JsonCreator
    @SuppressFBWarnings("NP_NULL_PARAM_DEREF_NONVIRTUAL")
    public static SingularityExecutorLogrotateAdditionalFile fromString(String value) {
        return new SingularityExecutorLogrotateAdditionalFile(value, Optional.absent(), Optional.absent(), null);
    }

    @JsonCreator
    public SingularityExecutorLogrotateAdditionalFile(@JsonProperty("filename") String filename,
            @JsonProperty("extension") Optional<String> extension,
            @JsonProperty("dateformat") Optional<String> dateformat,
            @JsonProperty("logrotateFrequencyOverride") SingularityExecutorLogrotateFrequency logrotateFrequencyOverride) {
        this.filename = filename;
        this.extension = extension;
        this.dateformat = dateformat;
        this.logrotateFrequencyOverride = Optional.fromNullable(logrotateFrequencyOverride);
    }

    public String getFilename() {
        return filename;
    }

    public Optional<String> getExtension() {
        return extension;
    }

    public Optional<String> getDateformat() {
        return dateformat;
    }

    public Optional<SingularityExecutorLogrotateFrequency> getLogrotateFrequencyOverride() {
        return logrotateFrequencyOverride;
    }

}

@@ -609,16 +609,67 @@
 verride;
+%0A    private final boolean deleteInExecutorCleanup;
 %0A%0A    @J
@@ -936,16 +936,23 @@
 (), null
+, false
 );%0A    %7D
@@ -1323,16 +1323,102 @@
 Override
+,%0A            @JsonProperty(%22deleteInExecutorCleanup%22) boolean deleteInExecutorCleanup
 ) %7B%0A    
@@ -1610,24 +1610,88 @@
 yOverride);%0A
+        this.deleteInExecutorCleanup = deleteInExecutorCleanup;%0A
     %7D%0A%0A    p
@@ -2052,10 +2052,105 @@
 %0A    %7D%0A%0A
+    public boolean isDeleteInExecutorCleanup() %7B%0A        return deleteInExecutorCleanup;%0A    %7D%0A
 %7D%0A

Add config value.