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, error
Returns the artifact associated with the given key.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, allowing 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, 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 operation, allowing 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 for which the reservation should be valid before requiring an extension. |
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
) - > [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 operation, allowing cancellation and timeouts. |
| key | [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key) | The unique identifier for the data to store. |
| reader | io.OutputReader | The reader providing the data to be stored. |
| metadata | Metadata | Additional metadata to associate with the stored data. |
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
) - > [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 operation, allowing cancellation and timeouts. |
| key | [Key](key.md?sid=flyteplugins_go_tasks_pluginmachinery_catalog_key) | The unique identifier for the data to update. |
| reader | io.OutputReader | The reader providing the new data to overwrite the existing data. |
| metadata | Metadata | Additional metadata to associate with the updated data. |
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 operation, allowing 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 any, during the release operation. |
GetReservationCache()
@classmethod
def GetReservationCache(
ownerID: string
) - > 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 | The reservation cache associated with the owner ID. |
UpdateReservationCache()
@classmethod
def UpdateReservationCache(
ownerID: string,
entry: 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 | The new reservation cache entry to set for the owner. |