Documentation
¶
Index ¶
- Variables
- type Client
- func NewClient(ctx context.Context, conn *grpc.ClientConn, tableName string) (Client, error)
- func NewClientWithOptions(ctx context.Context, conn *grpc.ClientConn, tableName string, ...) (Client, error)
- func NewConnectedClient(ctx context.Context, backendOpts *plugin.BackendOptions) (Client, error)
- func NewConnectedClientWithOptions(ctx context.Context, backendOpts *plugin.BackendOptions, ...) (Client, error)
- type ClientOptions
- type ConnectionOptions
- type NoOpClient
Constants ¶
This section is empty.
Variables ¶
var ErrSyncAborted = checkpoint.ErrSyncAborted
ErrSyncAborted is returned by Flush when the sync was cancelled before the state could be sent as a checkpoint. The state stays pending.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
SetKey(ctx context.Context, key string, value string) error
GetKey(ctx context.Context, key string) (string, error)
Flush(ctx context.Context) error
Close() error
}
func NewClientWithOptions ¶ added in v4.37.0
func NewClientWithOptions(ctx context.Context, conn *grpc.ClientConn, tableName string, opts ClientOptions) (Client, error)
NewClientWithOptions returns a client of the state backend at conn. It returns an error if opts sets Checkpoints, as only NewConnectedClientWithOptions gets the backend options that say whether the CLI persists checkpoints.
func NewConnectedClient ¶ added in v4.40.0
NewConnectedClient returns a state client and initialises the gRPC connection to the state backend with a 100MiB max message size. The state client is guaranteed to be non-nil (it defaults to the NoOpClient). You must call Close() on the returned Client object.
func NewConnectedClientWithOptions ¶ added in v4.40.0
func NewConnectedClientWithOptions(ctx context.Context, backendOpts *plugin.BackendOptions, connOpts ConnectionOptions, clOpts ClientOptions) (Client, error)
NewConnectedClientWithOptions returns a state client and initialises the gRPC connection to the state backend. The state client is guaranteed to be non-nil (it defaults to the NoOpClient). You must call Close() on the returned Client object.
type ClientOptions ¶ added in v4.37.0
type ClientOptions struct {
// Checkpoints is the res channel of the plugin's Sync, the same one passed to the scheduler.
// When the CLI supports checkpoints, Flush sends state on it instead of writing to the backend, and the CLI persists
// the state once the destinations commit the resources synced before it. Changes made within a table resolver (using
// its ctx) wait only for the resources that resolver produced; other changes must be flushed after the resources
// they summarize are sent, e.g. once the scheduler's Sync returns. With StrategyShuffleQueue, queue workers resolve
// relations on other goroutines, so changes made within table resolvers are held until the scheduler's Sync
// completes.
// Only NewConnectedClientWithOptions uses it, as only the backend options say whether the CLI supports checkpoints.
Checkpoints chan<- message.SyncMessage
}
type ConnectionOptions ¶ added in v4.40.0
type ConnectionOptions struct {
MaxMsgSizeInBytes int
}
type NoOpClient ¶
type NoOpClient struct{}
func (*NoOpClient) Close ¶ added in v4.40.0
func (*NoOpClient) Close() error