All Downloads are FREE. Search and download functionalities are using the official Maven repository.

example.ExampleWorkflowSteps Maven / Gradle / Ivy

There is a newer version: 5.2
Show newest version
package example;

import com.bazaarvoice.sswf.ConstantInProgressTimerFunction;
import com.bazaarvoice.sswf.InProgressTimerFunction;
import com.bazaarvoice.sswf.WorkflowStep;

enum ExampleWorkflowSteps implements WorkflowStep {
    EXTRACT_STEP(120, 120) {
        @Override public InProgressTimerFunction inProgressTimerSecondsFn() {
            return (invocationNum, cumulativeStepDurationSeconds) -> Math.min(10 * invocationNum, 100);
        }
    },
    TRANSFORM_STEP(120, 120),
    LOAD_STEP(120, 120),
    TIMEOUT_ONCE_STEP(120, 10)
    ;

    private int startToFinishTimeout;
    private int startToHeartbeatTimeoutSeconds;

    ExampleWorkflowSteps(final int startToFinishTimeout, final int startToHeartbeatTimeoutSeconds) {
        this.startToFinishTimeout = startToFinishTimeout;
        this.startToHeartbeatTimeoutSeconds = startToHeartbeatTimeoutSeconds;
    }

    @Override public int startToFinishTimeoutSeconds() {
        return startToFinishTimeout;
    }

    @Override public int startToHeartbeatTimeoutSeconds() { return startToHeartbeatTimeoutSeconds; }

    @Override public InProgressTimerFunction inProgressTimerSecondsFn() {
        return new ConstantInProgressTimerFunction(10);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy