package com.atlassian.bitbucket.mesh.config;

import javax.annotation.Nonnull;
import java.time.Duration;

/**
 * Application configuration properties related to replica repair.
 */
public interface RepairConfig {

    /**
     * @return the backoff to apply between repair attempts
     */
    @Nonnull
    Backoff getBackoff();

    /**
     * @return the maximum amount of attempts to repair a repository before abandoning background repair
     */
    int getMaxAttempts();

    /**
     * @return the maximum amount of concurrent repair operations allowed
     */
    int getThrottleLimit();

    /**
     * @return the maximum time repair is willing to wait for a repair slot to become available
     */
    @Nonnull
    Duration getThrottleTimeout();

    /**
     * @return the timeout for repository repair processes
     */
    @Nonnull
    Duration getTimeout();

    /**
     * @return the maximum amount of refs to update in a single operation during repair
     */
    int getUpdateRefBatchSize();
}
