package outputstream

import "cloud.google.com/go/spanner/test/cloudexecutor/executor/internal/outputstream"

Index

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

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.

Source Files

handler.go

Version
v1.76.1 (latest)
Published
Feb 21, 2025
Platform
linux/amd64
Imports
9 packages
Last checked
14 hours ago

Tools for package owners.