Search in sources :

Example 6 with Pipeline

use of pipelite.Pipeline in project pipelite by enasequence.

the class PipelineRunnerProcessQueueTest method async.

@Test
public void async() {
    Pipeline pipeline = new ConfigurableTestPipeline<>(PARALLELISM, PROCESS_CNT, new AsyncTestProcessConfiguration());
    test(pipeline);
}
Also used : ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) ConfigurableTestPipeline(pipelite.tester.pipeline.ConfigurableTestPipeline) Pipeline(pipelite.Pipeline) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 7 with Pipeline

use of pipelite.Pipeline in project pipelite by enasequence.

the class ProcessFactoryTest method createSuccess.

@Test
public void createSuccess() {
    ProcessEntity processEntity = new ProcessEntity();
    processEntity.setProcessId(PROCESS_ID);
    processEntity.setPipelineName(PIPELINE_NAME);
    Pipeline pipeline = new Pipeline() {

        @Override
        public String pipelineName() {
            return PIPELINE_NAME;
        }

        @Override
        public Options configurePipeline() {
            return new Options().pipelineParallelism(5);
        }

        @Override
        public void configureProcess(ProcessBuilder builder) {
            builder.execute("STAGE1").withSyncTestExecutor();
        }
    };
    Process process = ProcessFactory.create(processEntity, pipeline);
    assertThat(process).isNotNull();
    assertThat(process.getProcessId()).isEqualTo(PROCESS_ID);
    assertThat(process.getProcessEntity()).isNotNull();
    assertThat(process.getProcessEntity()).isSameAs(processEntity);
}
Also used : ProcessEntity(pipelite.entity.ProcessEntity) ProcessBuilder(pipelite.process.builder.ProcessBuilder) Pipeline(pipelite.Pipeline) Test(org.junit.jupiter.api.Test)

Example 8 with Pipeline

use of pipelite.Pipeline in project pipelite by enasequence.

the class ProcessRunnerPoolManager method _createPipelineRunners.

/**
 * Should not be called directly. Called by {@link #createPools()}.
 */
public void _createPipelineRunners() {
    if (state != State.STOPPED) {
        log.atWarning().log("Failed to create pipeline runners manager state is not stopped");
        return;
    }
    for (Pipeline pipeline : pipeliteServices.registeredPipeline().getRegisteredPipelines(Pipeline.class)) {
        PipelineRunner pipelineRunner = createPipelineRunner(pipeline.pipelineName());
        log.atInfo().log("Creating pipeline runner: " + pipeline.pipelineName());
        pipeliteServices.runner().addPipelineRunner(pipelineRunner);
        pools.add(pipelineRunner);
    }
    log.atInfo().log("Created pipeline runners");
}
Also used : PipelineRunner(pipelite.runner.pipeline.PipelineRunner) Pipeline(pipelite.Pipeline)

Aggregations

Pipeline (pipelite.Pipeline)8 Test (org.junit.jupiter.api.Test)4 ProcessEntity (pipelite.entity.ProcessEntity)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 PipeliteException (pipelite.exception.PipeliteException)2 ProcessBuilder (pipelite.process.builder.ProcessBuilder)2 ConfigurableTestPipeline (pipelite.tester.pipeline.ConfigurableTestPipeline)2 RegisteredPipeline (pipelite.RegisteredPipeline)1 Schedule (pipelite.Schedule)1 PipeliteConfiguration (pipelite.configuration.PipeliteConfiguration)1 PipeliteMetrics (pipelite.metrics.PipeliteMetrics)1 PipelineRunner (pipelite.runner.pipeline.PipelineRunner)1 ProcessQueue (pipelite.runner.process.ProcessQueue)1 ProcessQueueFactory (pipelite.runner.process.ProcessQueueFactory)1 ProcessRunner (pipelite.runner.process.ProcessRunner)1 ProcessRunnerFactory (pipelite.runner.process.ProcessRunnerFactory)1 ProcessEntityCreator (pipelite.runner.process.creator.ProcessEntityCreator)1 PipeliteServices (pipelite.service.PipeliteServices)1 RegisteredPipelineService (pipelite.service.RegisteredPipelineService)1