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

Commit 09489d8

Browse files
author
Nick Müller
committed
Added function for deleting artifacts to catalog client interface
Extended reservation retrieval to allow querying via artifact tag in catalog client interface Signed-off-by: Nick Müller <nmueller@blackshark.ai>
1 parent d5295d2 commit 09489d8

2 files changed

Lines changed: 113 additions & 0 deletions

File tree

go/tasks/pluginmachinery/catalog/client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ type Client interface {
131131
// GetOrExtendReservation tries to retrieve a (valid) reservation for the given key, creating a new one using the
132132
// specified owner ID if none was found or updating an existing one if it has expired.
133133
GetOrExtendReservation(ctx context.Context, key Key, ownerID string, heartbeatInterval time.Duration) (*datacatalog.Reservation, error)
134+
// GetOrExtendReservationByArtifactTag tries to retrieve a (valid) reservation for the given dataset ID and artifact
135+
// tag, creating a new one using the specified owner ID if none was found or updating an existing one if it has expired.
136+
GetOrExtendReservationByArtifactTag(ctx context.Context, datasetID *datacatalog.DatasetID, artifactTag string, ownerID string, heartbeatInterval time.Duration) (*datacatalog.Reservation, error)
134137
// Put stores the given data using the specified key, creating artifact entries as required.
135138
// To update an existing artifact, use Update instead.
136139
Put(ctx context.Context, key Key, reader io.OutputReader, metadata Metadata) (Status, error)
@@ -139,6 +142,11 @@ type Client interface {
139142
Update(ctx context.Context, key Key, reader io.OutputReader, metadata Metadata) (Status, error)
140143
// ReleaseReservation releases an acquired reservation for the given key and owner ID.
141144
ReleaseReservation(ctx context.Context, key Key, ownerID string) error
145+
// Delete removes the artifact associated with the given key and deletes its underlying data from blob storage.
146+
Delete(ctx context.Context, key Key) error
147+
// DeleteByArtifactTag removes the artifact associated with the given dataset ID and artifact tag and deletes its
148+
// underlying data from blob storage.
149+
DeleteByArtifactTag(ctx context.Context, datasetID *datacatalog.DatasetID, artifactTag string) error
142150
}
143151

144152
func IsNotFound(err error) bool {

go/tasks/pluginmachinery/catalog/mocks/client.go

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)