-
Notifications
You must be signed in to change notification settings - Fork 538
/
noop_catalog.go
40 lines (30 loc) · 1.18 KB
/
noop_catalog.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package catalog
import (
"context"
"time"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/catalog"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
)
var (
_ catalog.Client = &NOOPCatalog{}
)
var disabledStatus = catalog.NewStatus(core.CatalogCacheStatus_CACHE_DISABLED, nil)
type NOOPCatalog struct {
}
func (n NOOPCatalog) Get(_ context.Context, _ catalog.Key) (catalog.Entry, error) {
return catalog.NewCatalogEntry(nil, disabledStatus), nil
}
func (n NOOPCatalog) Put(_ context.Context, _ catalog.Key, _ io.OutputReader, _ catalog.Metadata) (catalog.Status, error) {
return disabledStatus, nil
}
func (n NOOPCatalog) Update(_ context.Context, _ catalog.Key, _ io.OutputReader, _ catalog.Metadata) (catalog.Status, error) {
return disabledStatus, nil
}
func (n NOOPCatalog) GetOrExtendReservation(_ context.Context, _ catalog.Key, _ string, _ time.Duration) (*datacatalog.Reservation, error) {
return nil, nil
}
func (n NOOPCatalog) ReleaseReservation(_ context.Context, _ catalog.Key, _ string) error {
return nil
}