Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Revert "deprecated TransitionTypeBarrier (#336)"
Browse files Browse the repository at this point in the history
This reverts commit 4f02c2c.
  • Loading branch information
hamersaw committed Sep 26, 2023
1 parent 8b417f4 commit be58a07
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion go/tasks/pluginmachinery/core/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const (
// The transition is eventually consistent. For all the state written may not be visible in the next call, but eventually will persist
// Best to use when the plugin logic is completely idempotent. This is also the most performant option.
TransitionTypeEphemeral TransitionType = iota
// @deprecated support for Barrier type transitions has been deprecated
// This transition tries its best to make the latest state visible for every consecutive read. But, it is possible
// to go back in time, i.e. monotonic consistency is violated (in rare cases).
TransitionTypeBarrier
Expand Down
2 changes: 1 addition & 1 deletion go/tasks/pluginmachinery/internal/webapi/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (c CorePlugin) Handle(ctx context.Context, tCtx core.TaskExecutionContext)
return core.UnknownTransition, err
}

return core.DoTransition(phaseInfo), nil
return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil

Check warning on line 100 in go/tasks/pluginmachinery/internal/webapi/core.go

View check run for this annotation

Codecov / codecov/patch

go/tasks/pluginmachinery/internal/webapi/core.go#L100

Added line #L100 was not covered by tests
}

func (c CorePlugin) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion go/tasks/plugins/array/k8s/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (e Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c
return core.UnknownTransition, err
}

return core.DoTransition(phaseInfo), nil
return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil
}

func (e Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion go/tasks/plugins/hive/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (q QuboleHiveExecutor) Handle(ctx context.Context, tCtx core.TaskExecutionC
return core.UnknownTransition, err
}

return core.DoTransition(phaseInfo), nil
return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil

Check warning on line 68 in go/tasks/plugins/hive/executor.go

View check run for this annotation

Codecov / codecov/patch

go/tasks/plugins/hive/executor.go#L68

Added line #L68 was not covered by tests
}

func (q QuboleHiveExecutor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion go/tasks/plugins/presto/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (p Executor) Handle(ctx context.Context, tCtx core.TaskExecutionContext) (c
return core.UnknownTransition, err
}

return core.DoTransition(phaseInfo), nil
return core.DoTransitionType(core.TransitionTypeBarrier, phaseInfo), nil

Check warning on line 66 in go/tasks/plugins/presto/executor.go

View check run for this annotation

Codecov / codecov/patch

go/tasks/plugins/presto/executor.go#L66

Added line #L66 was not covered by tests
}

func (p Executor) Abort(ctx context.Context, tCtx core.TaskExecutionContext) error {
Expand Down
2 changes: 1 addition & 1 deletion tests/end_to_end.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func RunPluginEndToEndTest(t *testing.T, executor pluginCore.Plugin, template *i
tCtx.OnMaxDatasetSizeBytes().Return(1000000)
tCtx.OnSecretManager().Return(secretManager)

trns := pluginCore.DoTransition(pluginCore.PhaseInfoQueued(time.Now(), 0, ""))
trns := pluginCore.DoTransitionType(pluginCore.TransitionTypeBarrier, pluginCore.PhaseInfoQueued(time.Now(), 0, ""))
for !trns.Info().Phase().IsTerminal() {
trns, err = executor.Handle(ctx, tCtx)
assert.NoError(t, err)
Expand Down

0 comments on commit be58a07

Please sign in to comment.