Documentation ¶
Index ¶
- type OutcomeSender
- func (s *OutcomeSender) AppendDmlRowsModified(rowsModified int64)
- func (s *OutcomeSender) AppendRow(row *executorpb.ValueList) error
- func (s *OutcomeSender) FinishSuccessfully() error
- func (s *OutcomeSender) FinishWithError(err error) error
- func (s *OutcomeSender) FinishWithTransactionRestarted() error
- func (s *OutcomeSender) InitForBatchRead(table string, index *string)
- func (s *OutcomeSender) InitForQuery()
- func (s *OutcomeSender) InitForRead(table string, index *string)
- func (s *OutcomeSender) SendOutcome(outcome *executorpb.SpannerActionOutcome) error
- func (s *OutcomeSender) SetRowType(rowType *spannerpb.StructType)
- func (s *OutcomeSender) SetTimestamp(timestamp *timestamppb.Timestamp)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OutcomeSender ¶
type OutcomeSender struct {
// contains filtered or unexported fields
}
OutcomeSender is a utility class used for sending action outcomes back to the client. For read actions, it buffers rows and sends partial read results in batches.
func NewOutcomeSender ¶
func NewOutcomeSender(actionID int32, stream executorpb.SpannerExecutorProxy_ExecuteActionAsyncServer) *OutcomeSender
NewOutcomeSender returns an OutcomeSender with default fields set.
func (*OutcomeSender) AppendDmlRowsModified ¶
func (s *OutcomeSender) AppendDmlRowsModified(rowsModified int64)
AppendDmlRowsModified add rows modified in dml to result
func (*OutcomeSender) AppendRow ¶
func (s *OutcomeSender) AppendRow(row *executorpb.ValueList) error
AppendRow adds another row to buffer. If buffer hits its size limit, the buffered rows will be sent back.
func (*OutcomeSender) FinishSuccessfully ¶
func (s *OutcomeSender) FinishSuccessfully() error
FinishSuccessfully sends the last outcome with OK status.
func (*OutcomeSender) FinishWithError ¶
func (s *OutcomeSender) FinishWithError(err error) error
FinishWithError sends the last outcome with given error status.
func (*OutcomeSender) FinishWithTransactionRestarted ¶
func (s *OutcomeSender) FinishWithTransactionRestarted() error
FinishWithTransactionRestarted sends the last outcome with aborted error, this will set the TransactionRestarted to true
func (*OutcomeSender) InitForBatchRead ¶
func (s *OutcomeSender) InitForBatchRead(table string, index *string)
InitForBatchRead init the sender for batch read action, then set the table and index if there exists.
func (*OutcomeSender) InitForQuery ¶
func (s *OutcomeSender) InitForQuery()
InitForQuery init the sender for query action
func (*OutcomeSender) InitForRead ¶
func (s *OutcomeSender) InitForRead(table string, index *string)
InitForRead init the sender for read action, then set the table and index if there exists.
func (*OutcomeSender) SendOutcome ¶
func (s *OutcomeSender) SendOutcome(outcome *executorpb.SpannerActionOutcome) error
SendOutcome sends the given SpannerActionOutcome.
func (*OutcomeSender) SetRowType ¶
func (s *OutcomeSender) SetRowType(rowType *spannerpb.StructType)
SetRowType sets the rowType for appending row.
func (*OutcomeSender) SetTimestamp ¶
func (s *OutcomeSender) SetTimestamp(timestamp *timestamppb.Timestamp)
SetTimestamp sets the timestamp for commit.