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

Commit

Permalink
Added function for deleting artifacts to catalog client interface
Browse files Browse the repository at this point in the history
Extended reservation retrieval to allow querying via artifact tag in catalog client interface

Signed-off-by: Nick Müller <nmueller@blackshark.ai>
  • Loading branch information
Nick Müller committed Jan 4, 2023
1 parent 8efeda7 commit 4593b01
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
8 changes: 8 additions & 0 deletions go/tasks/pluginmachinery/catalog/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ type Client interface {
// GetOrExtendReservation tries to retrieve a (valid) reservation for the given key, creating a new one using the
// specified owner ID if none was found or updating an existing one if it has expired.
GetOrExtendReservation(ctx context.Context, key Key, ownerID string, heartbeatInterval time.Duration) (*datacatalog.Reservation, error)
// GetOrExtendReservationByArtifactTag tries to retrieve a (valid) reservation for the given dataset ID and artifact
// tag, creating a new one using the specified owner ID if none was found or updating an existing one if it has expired.
GetOrExtendReservationByArtifactTag(ctx context.Context, datasetID *datacatalog.DatasetID, artifactTag string, ownerID string, heartbeatInterval time.Duration) (*datacatalog.Reservation, error)
// Put stores the given data using the specified key, creating artifact entries as required.
// To update an existing artifact, use Update instead.
Put(ctx context.Context, key Key, reader io.OutputReader, metadata Metadata) (Status, error)
Expand All @@ -139,6 +142,11 @@ type Client interface {
Update(ctx context.Context, key Key, reader io.OutputReader, metadata Metadata) (Status, error)
// ReleaseReservation releases an acquired reservation for the given key and owner ID.
ReleaseReservation(ctx context.Context, key Key, ownerID string) error
// Delete removes the artifact associated with the given key and deletes its underlying data from blob storage.
Delete(ctx context.Context, key Key) error
// DeleteByArtifactTag removes the artifact associated with the given dataset ID and artifact tag and deletes its
// underlying data from blob storage.
DeleteByArtifactTag(ctx context.Context, datasetID *datacatalog.DatasetID, artifactTag string) error
}

func IsNotFound(err error) bool {
Expand Down
105 changes: 105 additions & 0 deletions go/tasks/pluginmachinery/catalog/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4593b01

Please sign in to comment.