- 1.73.0 (latest)
- 1.72.0
- 1.71.0
- 1.70.0
- 1.69.0
- 1.68.0
- 1.67.0
- 1.66.0
- 1.65.0
- 1.64.0
- 1.63.0
- 1.62.0
- 1.61.0
- 1.60.0
- 1.59.0
- 1.58.0
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.1
- 1.52.0
- 1.49.0
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.1
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.36.0
- 1.35.0
- 1.34.1
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.1
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.0
- 1.24.1
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.1
- 1.13.0
Constants
None, Read, ReadWrite, Batch
const (
None currentActiveTransaction = iota
Read
ReadWrite
Batch
)
Current transaction status
AdminActionHandler
type AdminActionHandler struct {
Action *executorpb.AdminAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
Options []option.ClientOption
}
AdminActionHandler holds the necessary components and options required for performing admin tasks.
func (*AdminActionHandler) ExecuteAction
func (h *AdminActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction execute admin actions by action case, using OutcomeSender to send status and results back.
BatchDmlHandler
type BatchDmlHandler struct {
Action *executorpb.BatchDmlAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
BatchDmlHandler holds the necessary components required for BatchDmlAction.
func (*BatchDmlHandler) ExecuteAction
func (h *BatchDmlHandler) ExecuteAction(ctx context.Context) error
ExecuteAction that execute a BatchDml update action request, store the results in the OutcomeSender
CloseBatchTxnHandler
type CloseBatchTxnHandler struct {
Action *executorpb.CloseBatchTransactionAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
CloseBatchTxnHandler holds the necessary components required for closing batch transaction.
func (*CloseBatchTxnHandler) ExecuteAction
func (h *CloseBatchTxnHandler) ExecuteAction(ctx context.Context) error
ExecuteAction that finishes a batch transaction
DmlActionHandler
type DmlActionHandler struct {
Action *executorpb.DmlAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
DmlActionHandler holds the necessary components required for DML action.
func (*DmlActionHandler) ExecuteAction
func (h *DmlActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction executes a DML update action request, store the results in the outputstream.OutcomeSender.
ExecutePartition
type ExecutePartition struct {
Action *executorpb.ExecutePartitionAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
ExecutePartition holds the necessary components required for executing partition.
func (*ExecutePartition) ExecuteAction
func (h *ExecutePartition) ExecuteAction(ctx context.Context) error
ExecuteAction executes a read or query for the given partitions.
ExecutionFlowContext
type ExecutionFlowContext struct {
Database string // current database path
TxnContext context.Context
// contains filtered or unexported fields
}
ExecutionFlowContext represents a context in which SpannerActions are executed. Among other things, it includes currently active transactions and table metadata. There is exactly one instance of this per stubby call, created when the call is initialized and shared with all actionHandlers.
func (*ExecutionFlowContext) CloseOpenTransactions
func (c *ExecutionFlowContext) CloseOpenTransactions()
CloseOpenTransactions cleans up all the active transactions if the stubby call is closing.
func (*ExecutionFlowContext) IsTransactionActive
func (c *ExecutionFlowContext) IsTransactionActive() bool
IsTransactionActive returns true if any kind of transaction is currently active.
FinishTxnHandler
type FinishTxnHandler struct {
Action *executorpb.FinishTransactionAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
FinishTxnHandler holds the necessary components and options required for finish transaction action.
func (*FinishTxnHandler) ExecuteAction
func (h *FinishTxnHandler) ExecuteAction(ctx context.Context) error
ExecuteAction that finish a transaction. For read-write transaction, either commit or abandon the transaction is allowed. Batch transaction is not supported here.
MutationActionHandler
type MutationActionHandler struct {
Action *executorpb.MutationAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
MutationActionHandler holds the necessary components required for Mutation action.
func (*MutationActionHandler) ExecuteAction
func (h *MutationActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction that execute a Mutation action request.
PartitionQueryActionHandler
type PartitionQueryActionHandler struct {
Action *executorpb.GenerateDbPartitionsForQueryAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
PartitionQueryActionHandler holds the necessary components required for performing partition query action.
func (*PartitionQueryActionHandler) ExecuteAction
func (h *PartitionQueryActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction executes action that generates database partitions for the given query.
PartitionReadActionHandler
type PartitionReadActionHandler struct {
Action *executorpb.GenerateDbPartitionsForReadAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
PartitionReadActionHandler holds the necessary components required for performing partition read action.
func (*PartitionReadActionHandler) ExecuteAction
func (h *PartitionReadActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction executes action that generates database partitions for the given read.
PartitionedUpdate
type PartitionedUpdate struct {
Action *executorpb.PartitionedUpdateAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
PartitionedUpdate holds the necessary components required for performing partitioned update.
func (*PartitionedUpdate) ExecuteAction
func (h *PartitionedUpdate) ExecuteAction(ctx context.Context) error
ExecuteAction executes a partitioned update which runs different partitions in parallel.
QueryActionHandler
type QueryActionHandler struct {
Action *executorpb.QueryAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
QueryActionHandler holds the necessary components required for executorpb.QueryAction.
func (*QueryActionHandler) ExecuteAction
func (h *QueryActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction executes a query action request, store the results in the OutcomeSender.
ReadActionHandler
type ReadActionHandler struct {
Action *executorpb.ReadAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
ReadActionHandler holds the necessary components required for executorpb.ReadAction.
func (*ReadActionHandler) ExecuteAction
func (h *ReadActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction executes a read action request, store the results in the OutcomeSender.
StartBatchTxnHandler
type StartBatchTxnHandler struct {
Action *executorpb.StartBatchTransactionAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
Options []option.ClientOption
}
StartBatchTxnHandler holds the necessary components and options required for start batch transaction action.
func (*StartBatchTxnHandler) ExecuteAction
func (h *StartBatchTxnHandler) ExecuteAction(ctx context.Context) error
ExecuteAction that starts a batch transaction
StartTxnHandler
type StartTxnHandler struct {
Action *executorpb.StartTransactionAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
Options []option.ClientOption
}
StartTxnHandler holds the necessary components and options required for start transaction action.
func (*StartTxnHandler) ExecuteAction
func (h *StartTxnHandler) ExecuteAction(ctx context.Context) error
ExecuteAction that starts a read-write or read-only transaction.
WriteActionHandler
type WriteActionHandler struct {
Action *executorpb.MutationAction
FlowContext *ExecutionFlowContext
OutcomeSender *outputstream.OutcomeSender
}
WriteActionHandler holds the necessary components required for Write action.
func (*WriteActionHandler) ExecuteAction
func (h *WriteActionHandler) ExecuteAction(ctx context.Context) error
ExecuteAction that execute a Write action request.