package com.atlassian.bitbucket.mesh.git.gc;

import javax.annotation.Nonnull;

public interface GcOperation {

    /**
     * Main method that executes the garbage collection operation. Each operation that executes one or more garbage
     * collection activities should add those activities to the provided {@code log}, whether they succeeded or failed.
     *
     * @param context describes the gc activities already completed as part of the current garbage collection operation
     */
    void run(@Nonnull GcContext context);

    /**
     * @return {@code true} if the should be run; otherwise {@code false}
     */
    default boolean shouldRun() {
        return true;
    }
}
