New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --no-commit and --no-run options #227

Open
frsyuki opened this Issue Jul 6, 2015 · 7 comments

Comments

Projects
None yet
5 participants
@frsyuki
Contributor

frsyuki commented Jul 6, 2015

I want to verify whether configuration is correct or not before actually running a transaction.
Idea here is that:

  • --no-commit: Begin a transaction, and run the bulk import job. But don't commit the transaction.
  • --no-run: Begin a transaction, but don't run the bulk import job.

It should be used with --resume-path option.

@frsyuki

This comment has been minimized.

Show comment
Hide comment
@frsyuki

frsyuki Jul 6, 2015

Contributor

In terms of implementation, we can add a hook points to BulkLoader#run and #resume.
For example,

public static class TransactionHook
{
    private TransactionHook() { ... }  // private

    public static interface BeforeCommit
    {
        public void beforeCommit(ExecSession exec, ProcessState /* or another class? */ state);
    }

    public static interface BeforeRun
    {
        public void beforeRun(ExecSession exec);
    }

    public static class Builder
    {
        public Builder beforeRun(BeforeRun hook) { ... }
        public Builder beforeCommit(BeforeCommit hook) { ... }
        public TransactionHook build() { ... }
    }
}

public ExecutionResult run(ExecSession exec, final ConfigSource config, TransactionHook)
{
   ...
}
Contributor

frsyuki commented Jul 6, 2015

In terms of implementation, we can add a hook points to BulkLoader#run and #resume.
For example,

public static class TransactionHook
{
    private TransactionHook() { ... }  // private

    public static interface BeforeCommit
    {
        public void beforeCommit(ExecSession exec, ProcessState /* or another class? */ state);
    }

    public static interface BeforeRun
    {
        public void beforeRun(ExecSession exec);
    }

    public static class Builder
    {
        public Builder beforeRun(BeforeRun hook) { ... }
        public Builder beforeCommit(BeforeCommit hook) { ... }
        public TransactionHook build() { ... }
    }
}

public ExecutionResult run(ExecSession exec, final ConfigSource config, TransactionHook)
{
   ...
}
@muga

This comment has been minimized.

Show comment
Hide comment
@muga

muga Jul 6, 2015

Contributor

Good feature.

Contributor

muga commented Jul 6, 2015

Good feature.

@dmnlk

This comment has been minimized.

Show comment
Hide comment
@dmnlk

dmnlk Jul 21, 2015

I think --dry-run is more familiar.

dmnlk commented Jul 21, 2015

I think --dry-run is more familiar.

@sonots

This comment has been minimized.

Show comment
Hide comment
@sonots

sonots Jul 21, 2015

Member

👍

But, embulk run --no-run sounds somewhat awkward. What I requested is something like configtest. dry-run would be suitable.

Member

sonots commented Jul 21, 2015

👍

But, embulk run --no-run sounds somewhat awkward. What I requested is something like configtest. dry-run would be suitable.

@frsyuki

This comment has been minimized.

Show comment
Hide comment
@frsyuki

frsyuki Jul 21, 2015

Contributor

@dmnlk @sonots but --dry-run actually runs transaction (create temporary tables, etc.). although the transaction won't be committed, is it ok?

Contributor

frsyuki commented Jul 21, 2015

@dmnlk @sonots but --dry-run actually runs transaction (create temporary tables, etc.). although the transaction won't be committed, is it ok?

@sonots

This comment has been minimized.

Show comment
Hide comment
@sonots

sonots Jul 21, 2015

Member

It is not okay.

Member

sonots commented Jul 21, 2015

It is not okay.

@frsyuki

This comment has been minimized.

Show comment
Hide comment
@frsyuki

frsyuki Jul 21, 2015

Contributor

--no-commit (starts transaction, runs bulkload, doesn't commit) and --no-run (starts transaction, doesn't run bulkload, doesn't commit) are easy to implement.
--dry-run (doesn't start, doesn't run bulk load, doesn't commit) is not easy. So my idea for now is to add --no-commit and --no-run.
I welcome further comments.

Contributor

frsyuki commented Jul 21, 2015

--no-commit (starts transaction, runs bulkload, doesn't commit) and --no-run (starts transaction, doesn't run bulkload, doesn't commit) are easy to implement.
--dry-run (doesn't start, doesn't run bulk load, doesn't commit) is not easy. So my idea for now is to add --no-commit and --no-run.
I welcome further comments.

@dmikurube dmikurube added the kaizen label Mar 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment