Client
Client represents the default cache client that allows the memoization data in Flyte
Methods
Get()
@classmethod
def Get(
ctx: context.Context,
key: [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key)
) - > [Entry](entry.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_entry), error
Returns the artifact associated with the given key.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, enabling cancellation and timeouts. |
| key | [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key) | The unique identifier for the artifact to retrieve. |
Returns
| Type | Description |
|---|---|
[Entry](entry.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_entry), error | The artifact entry and an error, if any. |
GetOrExtendReservation()
@classmethod
def GetOrExtendReservation(
ctx: context.Context,
key: [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key),
ownerID: string,
heartbeatInterval: time.Duration
) - > *cacheservice.Reservation, error
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.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, enabling cancellation and timeouts. |
| key | [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key) | The unique identifier for the reservation. |
| ownerID | string | The identifier of the owner requesting or extending the reservation. |
| heartbeatInterval | time.Duration | The duration after which the reservation should be considered expired if not extended. |
Returns
| Type | Description |
|---|---|
*cacheservice.Reservation, error | The reservation object and an error, if any. |
Put()
@classmethod
def Put(
ctx: context.Context,
key: [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key),
reader: io.OutputReader,
metadata: [Metadata](metadata.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_metadata)
) - > [Status](status.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_status), error
Stores the given data using the specified key, creating artifact entries as required. To update an existing artifact, use Update instead.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, enabling cancellation and timeouts. |
| key | [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key) | The unique identifier under which to store the data. |
| reader | io.OutputReader | The reader providing the data to be stored. |
| metadata | [Metadata](metadata.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_metadata) | Additional metadata to associate with the stored artifact. |
Returns
| Type | Description |
|---|---|
[Status](status.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_status), error | The status of the put operation and an error, if any. |
Update()
@classmethod
def Update(
ctx: context.Context,
key: [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key),
reader: io.OutputReader,
metadata: [Metadata](metadata.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_metadata)
) - > [Status](status.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_status), error
Updates existing data stored at the specified key, overwriting artifact entries with the new data provided. To create a new (non-existent) artifact, use Put instead.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, enabling cancellation and timeouts. |
| key | [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key) | The unique identifier of the artifact to update. |
| reader | io.OutputReader | The reader providing the new data to overwrite the existing artifact. |
| metadata | [Metadata](metadata.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_metadata) | Additional metadata to associate with the updated artifact. |
Returns
| Type | Description |
|---|---|
[Status](status.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_status), error | The status of the update operation and an error, if any. |
ReleaseReservation()
@classmethod
def ReleaseReservation(
ctx: context.Context,
key: [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key),
ownerID: string
) - > error
Releases an acquired reservation for the given key and owner ID.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, enabling cancellation and timeouts. |
| key | [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key) | The unique identifier of the reservation to release. |
| ownerID | string | The identifier of the owner who acquired the reservation. |
Returns
| Type | Description |
|---|---|
error | An error, if the reservation could not be released. |
GetReservationCache()
@classmethod
def GetReservationCache(
ownerID: string
) - > [ReservationCache](reservationcache.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_reservationcache)
Checks the reservation cache for the given owner ID
Parameters
| Name | Type | Description |
|---|---|---|
| ownerID | string | The identifier of the owner whose reservation cache is to be retrieved. |
Returns
| Type | Description |
|---|---|
[ReservationCache](reservationcache.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_reservationcache) | The reservation cache associated with the owner ID. |
UpdateReservationCache()
@classmethod
def UpdateReservationCache(
ownerID: string,
entry: [ReservationCache](reservationcache.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_reservationcache)
)
Updates the reservation cache for the given owner ID
Parameters
| Name | Type | Description |
|---|---|---|
| ownerID | string | The identifier of the owner whose reservation cache is to be updated. |
| entry | [ReservationCache](reservationcache.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_reservationcache) | The new reservation cache entry to set for the owner. |