outputstream

package
v1.60.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL