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

Commit

Permalink
Merge 3ce2c13 into d5295d2
Browse files Browse the repository at this point in the history
  • Loading branch information
MorpheusXAUT authored Dec 15, 2022
2 parents d5295d2 + 3ce2c13 commit 79e9a15
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 0 deletions.
14 changes: 14 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,17 @@ 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
// ReleaseReservationByArtifactTag releases an acquired reservation for the given dataset ID, artifact tag and
// owner ID.
ReleaseReservationByArtifactTag(ctx context.Context, datasetID *datacatalog.DatasetID, artifactTag string, 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
// DeleteByArtifactID removes the artifact associated with the given dataset and artifact ID and deletes its
// underlying data from blob storage.
DeleteByArtifactID(ctx context.Context, datasetID *datacatalog.DatasetID, artifactID string) error
}

func IsNotFound(err error) bool {
Expand Down
169 changes: 169 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 79e9a15

Please sign in to comment.