package rawtopicreader

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopicreader"

Index

Variables

var ErrUnexpectedMessageType = errors.New("unexpected message type")

Types

type Batch

type Batch struct {
	Codec rawtopiccommon.Codec

	ProducerID       string
	WriteSessionMeta map[string]string // nil if session meta is empty
	WrittenAt        time.Time

	MessageData []MessageData
}

type ClientMessage

type ClientMessage interface {
	// contains filtered or unexported methods
}

type CommitOffsetRequest

type CommitOffsetRequest struct {
	CommitOffsets []PartitionCommitOffset
	// contains filtered or unexported fields
}

type CommitOffsetResponse

type CommitOffsetResponse struct {
	rawtopiccommon.ServerMessageMetadata

	PartitionsCommittedOffsets []PartitionCommittedOffset
	// contains filtered or unexported fields
}

type EndPartitionSession

type EndPartitionSession struct {
	rawtopiccommon.ServerMessageMetadata

	PartitionSessionID   PartitionSessionID
	AdjacentPartitionIDs []int64
	ChildPartitionIDs    []int64
	// contains filtered or unexported fields
}

type GrpcStream

type GrpcStream interface {
	Send(messageNew *Ydb_Topic.StreamReadMessage_FromClient) error
	Recv() (*Ydb_Topic.StreamReadMessage_FromServer, error)
	CloseSend() error
}

type InitRequest

type InitRequest struct {
	TopicsReadSettings []TopicReadSettings

	Consumer                string
	AutoPartitioningSupport bool
	// contains filtered or unexported fields
}

func (*InitRequest) GetConsumer

func (r *InitRequest) GetConsumer() string

GetConsumer for implement trace.TopicReadStreamInitRequestInfo

func (*InitRequest) GetTopics

func (r *InitRequest) GetTopics() []string

GetTopics for implement trace.TopicReadStreamInitRequestInfo

type InitResponse

type InitResponse struct {
	rawtopiccommon.ServerMessageMetadata

	SessionID string
	// contains filtered or unexported fields
}

type MessageData

type MessageData struct {
	Offset           rawtopiccommon.Offset
	SeqNo            int64
	CreatedAt        time.Time
	Data             []byte
	UncompressedSize int64
	MessageGroupID   string
	MetadataItems    []rawtopiccommon.MetadataItem
}

type OptionalOffset

type OptionalOffset struct {
	Offset   rawtopiccommon.Offset
	HasValue bool
}

func (*OptionalOffset) FromInt64

func (offset *OptionalOffset) FromInt64(v int64)

func (*OptionalOffset) FromInt64Pointer

func (offset *OptionalOffset) FromInt64Pointer(v *int64)

func (OptionalOffset) ToInt64

func (offset OptionalOffset) ToInt64() int64

func (OptionalOffset) ToInt64Pointer

func (offset OptionalOffset) ToInt64Pointer() *int64

type PartitionCommitOffset

type PartitionCommitOffset struct {
	PartitionSessionID PartitionSessionID
	Offsets            []rawtopiccommon.OffsetRange
}

type PartitionCommittedOffset

type PartitionCommittedOffset struct {
	PartitionSessionID PartitionSessionID
	CommittedOffset    rawtopiccommon.Offset
}

type PartitionData

type PartitionData struct {
	PartitionSessionID PartitionSessionID

	Batches []Batch
}

type PartitionSession

type PartitionSession struct {
	PartitionSessionID PartitionSessionID
	Path               string // Topic path of partition
	PartitionID        int64
}

type PartitionSessionID

type PartitionSessionID int64

func (*PartitionSessionID) FromInt64

func (id *PartitionSessionID) FromInt64(v int64)

func (PartitionSessionID) ToInt64

func (id PartitionSessionID) ToInt64() int64

type PartitionSessionStatusRequest

type PartitionSessionStatusRequest struct {
	PartitionSessionID PartitionSessionID
	// contains filtered or unexported fields
}

type PartitionSessionStatusResponse

type PartitionSessionStatusResponse struct {
	rawtopiccommon.ServerMessageMetadata

	PartitionSessionID     PartitionSessionID
	PartitionOffsets       rawtopiccommon.OffsetRange
	WriteTimeHighWatermark time.Time
	// contains filtered or unexported fields
}

type ReadRequest

type ReadRequest struct {
	BytesSize int
	// contains filtered or unexported fields
}

type ReadResponse

type ReadResponse struct {
	rawtopiccommon.ServerMessageMetadata

	BytesSize     int
	PartitionData []PartitionData
	// contains filtered or unexported fields
}

func (*ReadResponse) GetBytesSize

func (r *ReadResponse) GetBytesSize() int

GetBytesSize implements trace.TopicReaderDataResponseInfo

func (*ReadResponse) GetPartitionBatchMessagesCounts

func (r *ReadResponse) GetPartitionBatchMessagesCounts() (partitionDataCount, batchCount, messagesCount int)

GetPartitionBatchMessagesCounts implements trace.TopicReaderDataResponseInfo

type ServerMessage

type ServerMessage interface {
	StatusData() rawtopiccommon.ServerMessageMetadata
	SetStatus(status rawydb.StatusCode)
	// contains filtered or unexported methods
}

type StartPartitionSessionRequest

type StartPartitionSessionRequest struct {
	rawtopiccommon.ServerMessageMetadata

	PartitionSession PartitionSession
	CommittedOffset  rawtopiccommon.Offset
	PartitionOffsets rawtopiccommon.OffsetRange
	// contains filtered or unexported fields
}

type StartPartitionSessionResponse

type StartPartitionSessionResponse struct {
	PartitionSessionID PartitionSessionID
	ReadOffset         OptionalOffset
	CommitOffset       OptionalOffset
	// contains filtered or unexported fields
}

type StopPartitionSessionRequest

type StopPartitionSessionRequest struct {
	rawtopiccommon.ServerMessageMetadata

	PartitionSessionID PartitionSessionID
	Graceful           bool
	CommittedOffset    rawtopiccommon.Offset
	// contains filtered or unexported fields
}

type StopPartitionSessionResponse

type StopPartitionSessionResponse struct {
	PartitionSessionID PartitionSessionID
	// contains filtered or unexported fields
}

type StreamReader

type StreamReader struct {
	Stream   GrpcStream
	ReaderID int64

	Tracer *trace.Topic
	// contains filtered or unexported fields
}

func (StreamReader) CloseSend

func (s StreamReader) CloseSend() error

func (StreamReader) Recv

func (s StreamReader) Recv() (_ ServerMessage, resErr error)

func (StreamReader) Send

func (s StreamReader) Send(msg ClientMessage) (resErr error)

type TopicReadSettings

type TopicReadSettings struct {
	Path         string
	PartitionsID []int64

	MaxLag   rawoptional.Duration
	ReadFrom rawoptional.Time
}

type TopicReaderStreamInterface

type TopicReaderStreamInterface interface {
	Recv() (ServerMessage, error)
	Send(msg ClientMessage) error
	CloseSend() error
}

type UpdateTokenRequest

type UpdateTokenRequest struct {
	rawtopiccommon.UpdateTokenRequest
	// contains filtered or unexported fields
}

type UpdateTokenResponse

type UpdateTokenResponse struct {
	rawtopiccommon.UpdateTokenResponse

	rawtopiccommon.ServerMessageMetadata
	// contains filtered or unexported fields
}

Source Files

messages.go rawtopicreader.go stream_reader_stream_interface.go

Version
v3.106.0
Published
Apr 10, 2025
Platform
linux/amd64
Imports
11 packages
Last checked
1 hour ago

Tools for package owners.