2018-08-08 00:46:37 +00:00
|
|
|
package state
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/nomad/client/allocrunnerv2/taskrunner/state"
|
|
|
|
"github.com/hashicorp/nomad/nomad/structs"
|
|
|
|
)
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
// NoopDB implements a StateDB that does not persist any data.
|
|
|
|
type NoopDB struct{}
|
2018-08-08 00:46:37 +00:00
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) GetAllAllocations() ([]*structs.Allocation, map[string]error, error) {
|
2018-08-08 00:46:37 +00:00
|
|
|
return nil, nil, nil
|
|
|
|
}
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) PutAllocation(*structs.Allocation) error {
|
2018-08-08 00:46:37 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) GetTaskRunnerState(allocID string, taskName string) (*state.LocalState, *structs.TaskState, error) {
|
2018-08-08 00:46:37 +00:00
|
|
|
return nil, nil, nil
|
|
|
|
}
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) PutTaskRunnerLocalState(allocID string, taskName string, val interface{}) error {
|
2018-08-08 00:46:37 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) PutTaskState(allocID string, taskName string, state *structs.TaskState) error {
|
2018-08-08 00:46:37 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) DeleteTaskBucket(allocID, taskName string) error {
|
2018-08-23 19:03:17 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) DeleteAllocationBucket(allocID string) error {
|
2018-08-23 19:03:17 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-09-27 00:29:08 +00:00
|
|
|
func (n NoopDB) Close() error {
|
2018-08-08 00:46:37 +00:00
|
|
|
return nil
|
|
|
|
}
|