Files
tasks/service/history/workflow/noop_chasm_tree.go
Yichao YangandGitHub 89a4eb7855 CHASM: Engine Update/ReadComponent implementation (#7696)
## What changed?
- Implement chasm engine Update/Read Component method

## Why?
- CHASM work stream

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
2025-05-08 19:21:27 -07:00

58 lines
1.3 KiB
Go

package workflow
import (
"time"
"go.temporal.io/api/serviceerror"
persistencespb "go.temporal.io/server/api/persistence/v1"
"go.temporal.io/server/chasm"
historyi "go.temporal.io/server/service/history/interfaces"
)
var _ historyi.ChasmTree = (*noopChasmTree)(nil)
type noopChasmTree struct{}
func (*noopChasmTree) CloseTransaction() (chasm.NodesMutation, error) {
return chasm.NodesMutation{}, nil
}
func (*noopChasmTree) Snapshot(*persistencespb.VersionedTransition) chasm.NodesSnapshot {
return chasm.NodesSnapshot{}
}
func (*noopChasmTree) ApplyMutation(chasm.NodesMutation) error {
return nil
}
func (*noopChasmTree) ApplySnapshot(chasm.NodesSnapshot) error {
return nil
}
func (*noopChasmTree) IsDirty() bool {
return false
}
func (*noopChasmTree) Terminate(chasm.TerminateComponentRequest) error {
return nil
}
func (*noopChasmTree) Archetype() string {
return ""
}
func (*noopChasmTree) EachPureTask(
deadline time.Time,
callback func(executor chasm.NodeExecutePureTask, task any) error,
) error {
return nil
}
func (*noopChasmTree) IsStale(chasm.ComponentRef) error {
return nil
}
func (*noopChasmTree) Component(chasm.Context, chasm.ComponentRef) (chasm.Component, error) {
return nil, serviceerror.NewInternal("Component() method invoked on noop CHASM tree")
}