Search in sources :

Example 6 with ExecSession

use of org.embulk.spi.ExecSession in project embulk by embulk.

the class BulkLoader method cleanup.

public void cleanup(final ConfigSource config, final ResumeState resume) {
    try {
        ExecSession exec = ExecSession.builder(injector).fromExecConfig(resume.getExecSessionConfigSource()).build();
        Exec.doWith(exec, new ExecAction<Void>() {

            public Void run() {
                try (SetCurrentThreadName dontCare = new SetCurrentThreadName("cleanup")) {
                    doCleanup(config, resume);
                    return null;
                }
            }
        });
        exec.cleanup();
    } catch (ExecutionException ex) {
        throw Throwables.propagate(ex.getCause());
    }
}
Also used : ExecSession(org.embulk.spi.ExecSession) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ExecSession (org.embulk.spi.ExecSession)6 ExecutionException (java.util.concurrent.ExecutionException)2 PartialExecutionException (org.embulk.exec.PartialExecutionException)2 ExecutionResult (org.embulk.exec.ExecutionResult)1