Documentation ¶
Index ¶
- Variables
- type ConnectFunc
- type EncoderMap
- func (e *EncoderMap) AddEncoder(codec rawtopiccommon.Codec, creator PublicCreateEncoderFunc)
- func (e *EncoderMap) CreateLazyEncodeWriter(codec rawtopiccommon.Codec, target io.Writer) (io.WriteCloser, error)
- func (e *EncoderMap) GetSupportedCodecs() rawtopiccommon.SupportedCodecs
- func (e *EncoderMap) IsSupported(codec rawtopiccommon.Codec) bool
- type EncoderSelector
- type InitialInfo
- type MessageQueueAckWaiter
- type PublicCreateEncoderFunc
- type PublicFuturePartitioning
- type PublicMessage
- type PublicOnWriterInitResponseCallback
- type PublicWithOnWriterConnectedInfo
- type PublicWriterOption
- func WithAddEncoder(codec rawtopiccommon.Codec, encoderFunc PublicCreateEncoderFunc) PublicWriterOption
- func WithAutoCodec() PublicWriterOption
- func WithAutoSetSeqNo(val bool) PublicWriterOption
- func WithAutosetCreatedTime(enable bool) PublicWriterOption
- func WithClock(clock clockwork.Clock) PublicWriterOption
- func WithCodec(codec rawtopiccommon.Codec) PublicWriterOption
- func WithCommonConfig(common config.Common) PublicWriterOption
- func WithCompressorCount(num int) PublicWriterOption
- func WithConnectFunc(connect ConnectFunc) PublicWriterOption
- func WithConnectTimeout(timeout time.Duration) PublicWriterOption
- func WithCredentials(cred credentials.Credentials) PublicWriterOption
- func WithMaxQueueLen(num int) PublicWriterOption
- func WithPartitioning(partitioning PublicFuturePartitioning) PublicWriterOption
- func WithProducerID(producerID string) PublicWriterOption
- func WithSessionMeta(meta map[string]string) PublicWriterOption
- func WithStartTimeout(timeout time.Duration) PublicWriterOption
- func WithTokenUpdateInterval(interval time.Duration) PublicWriterOption
- func WithTopic(topic string) PublicWriterOption
- func WithTrace(tracer *trace.Topic) PublicWriterOption
- func WithWaitAckOnWrite(val bool) PublicWriterOption
- type RawTopicWriterStream
- type SingleStreamWriter
- type SingleStreamWriterConfig
- type StreamWriter
- type WriterReconnector
- func (w *WriterReconnector) Close(ctx context.Context) error
- func (w *WriterReconnector) Flush(ctx context.Context) error
- func (w *WriterReconnector) GetSessionID() (sessionID string)
- func (w *WriterReconnector) WaitInit(ctx context.Context) (info InitialInfo, err error)
- func (w *WriterReconnector) Write(ctx context.Context, messages []PublicMessage) error
- type WriterReconnectorConfig
- type WriterWithTransaction
- type WritersCommonConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
PublicErrQueueIsFull = xerrors.Wrap(errors.New("ydb: queue is full"))
)
Functions ¶
This section is empty.
Types ¶
type ConnectFunc ¶
type ConnectFunc func(ctx context.Context) (RawTopicWriterStream, error)
type EncoderMap ¶
type EncoderMap struct {
// contains filtered or unexported fields
}
func NewEncoderMap ¶
func NewEncoderMap() *EncoderMap
func (*EncoderMap) AddEncoder ¶
func (e *EncoderMap) AddEncoder(codec rawtopiccommon.Codec, creator PublicCreateEncoderFunc)
func (*EncoderMap) CreateLazyEncodeWriter ¶
func (e *EncoderMap) CreateLazyEncodeWriter(codec rawtopiccommon.Codec, target io.Writer) (io.WriteCloser, error)
func (*EncoderMap) GetSupportedCodecs ¶
func (e *EncoderMap) GetSupportedCodecs() rawtopiccommon.SupportedCodecs
func (*EncoderMap) IsSupported ¶
func (e *EncoderMap) IsSupported(codec rawtopiccommon.Codec) bool
type EncoderSelector ¶
type EncoderSelector struct {
// contains filtered or unexported fields
}
EncoderSelector not thread safe
func NewEncoderSelector ¶
func NewEncoderSelector( m *EncoderMap, allowedCodecs rawtopiccommon.SupportedCodecs, parallelCompressors int, tracer *trace.Topic, writerReconnectorID, sessionID string, ) EncoderSelector
func (*EncoderSelector) CompressMessages ¶
func (s *EncoderSelector) CompressMessages(messages []messageWithDataContent) (rawtopiccommon.Codec, error)
func (*EncoderSelector) ResetAllowedCodecs ¶
func (s *EncoderSelector) ResetAllowedCodecs(allowedCodecs rawtopiccommon.SupportedCodecs)
type InitialInfo ¶
type InitialInfo struct {
LastSeqNum int64
}
type MessageQueueAckWaiter ¶
type MessageQueueAckWaiter struct {
// contains filtered or unexported fields
}
func (*MessageQueueAckWaiter) AddWaitIndex ¶
func (m *MessageQueueAckWaiter) AddWaitIndex(index int)
type PublicCreateEncoderFunc ¶
type PublicCreateEncoderFunc func(writer io.Writer) (io.WriteCloser, error)
type PublicFuturePartitioning ¶
type PublicFuturePartitioning struct {
// contains filtered or unexported fields
}
PublicFuturePartitioning will be published in feature, after server implementation completed.
func NewPartitioningWithMessageGroupID ¶
func NewPartitioningWithMessageGroupID(id string) PublicFuturePartitioning
func NewPartitioningWithPartitionID ¶
func NewPartitioningWithPartitionID(id int64) PublicFuturePartitioning
func (PublicFuturePartitioning) ToRaw ¶
func (p PublicFuturePartitioning) ToRaw() rawtopicwriter.Partitioning
type PublicMessage ¶
type PublicOnWriterInitResponseCallback ¶
type PublicOnWriterInitResponseCallback func(info PublicWithOnWriterConnectedInfo) error
type PublicWithOnWriterConnectedInfo ¶
type PublicWithOnWriterConnectedInfo struct { LastSeqNo int64 SessionID string PartitionID int64 CodecsFromServer []topictypes.Codec AllowedCodecs []topictypes.Codec // Intersection between codecs from server and codecs, supported by writer }
type PublicWriterOption ¶
type PublicWriterOption func(cfg *WriterReconnectorConfig)
func WithAddEncoder ¶
func WithAddEncoder(codec rawtopiccommon.Codec, encoderFunc PublicCreateEncoderFunc) PublicWriterOption
func WithAutoCodec ¶
func WithAutoCodec() PublicWriterOption
func WithAutoSetSeqNo ¶
func WithAutoSetSeqNo(val bool) PublicWriterOption
func WithAutosetCreatedTime ¶
func WithAutosetCreatedTime(enable bool) PublicWriterOption
func WithClock ¶
func WithClock(clock clockwork.Clock) PublicWriterOption
WithClock is private option for tests
func WithCodec ¶
func WithCodec(codec rawtopiccommon.Codec) PublicWriterOption
func WithCommonConfig ¶
func WithCommonConfig(common config.Common) PublicWriterOption
WithCommonConfig
Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
func WithCompressorCount ¶
func WithCompressorCount(num int) PublicWriterOption
func WithConnectFunc ¶
func WithConnectFunc(connect ConnectFunc) PublicWriterOption
func WithConnectTimeout ¶
func WithConnectTimeout(timeout time.Duration) PublicWriterOption
func WithCredentials ¶
func WithCredentials(cred credentials.Credentials) PublicWriterOption
WithCredentials for internal usage only no proxy to public interface
func WithMaxQueueLen ¶
func WithMaxQueueLen(num int) PublicWriterOption
func WithPartitioning ¶
func WithPartitioning(partitioning PublicFuturePartitioning) PublicWriterOption
func WithProducerID ¶
func WithProducerID(producerID string) PublicWriterOption
func WithSessionMeta ¶
func WithSessionMeta(meta map[string]string) PublicWriterOption
func WithStartTimeout ¶
func WithStartTimeout(timeout time.Duration) PublicWriterOption
func WithTokenUpdateInterval ¶
func WithTokenUpdateInterval(interval time.Duration) PublicWriterOption
func WithTopic ¶
func WithTopic(topic string) PublicWriterOption
func WithTrace ¶
func WithTrace(tracer *trace.Topic) PublicWriterOption
func WithWaitAckOnWrite ¶
func WithWaitAckOnWrite(val bool) PublicWriterOption
type RawTopicWriterStream ¶
type RawTopicWriterStream interface { Recv() (rawtopicwriter.ServerMessage, error) Send(mess rawtopicwriter.ClientMessage) error CloseSend() error }
type SingleStreamWriter ¶
type SingleStreamWriter struct { Encoder EncoderSelector CodecsFromServer rawtopiccommon.SupportedCodecs SessionID string ReceivedLastSeqNum int64 PartitionID int64 LastSeqNumRequested bool // contains filtered or unexported fields }
func NewSingleStreamWriter ¶
func NewSingleStreamWriter( ctxForPProfLabelsOnly context.Context, cfg SingleStreamWriterConfig, ) (*SingleStreamWriter, error)
type SingleStreamWriterConfig ¶
type SingleStreamWriterConfig struct { WritersCommonConfig // contains filtered or unexported fields }
type StreamWriter ¶
type WriterReconnector ¶
type WriterReconnector struct {
// contains filtered or unexported fields
}
func NewWriterReconnector ¶
func NewWriterReconnector( cfg WriterReconnectorConfig, ) (*WriterReconnector, error)
func (*WriterReconnector) GetSessionID ¶
func (w *WriterReconnector) GetSessionID() (sessionID string)
func (*WriterReconnector) WaitInit ¶
func (w *WriterReconnector) WaitInit(ctx context.Context) (info InitialInfo, err error)
func (*WriterReconnector) Write ¶
func (w *WriterReconnector) Write(ctx context.Context, messages []PublicMessage) error
type WriterReconnectorConfig ¶
type WriterReconnectorConfig struct { WritersCommonConfig MaxMessageSize int MaxQueueLen int Common config.Common AdditionalEncoders map[rawtopiccommon.Codec]PublicCreateEncoderFunc Connect ConnectFunc WaitServerAck bool AutoSetSeqNo bool AutoSetCreatedTime bool OnWriterInitResponseCallback PublicOnWriterInitResponseCallback RetrySettings topic.RetrySettings // contains filtered or unexported fields }
func NewWriterReconnectorConfig ¶
func NewWriterReconnectorConfig(options ...PublicWriterOption) WriterReconnectorConfig
type WriterWithTransaction ¶
type WriterWithTransaction struct {
// contains filtered or unexported fields
}
func NewTopicWriterTransaction ¶
func NewTopicWriterTransaction(w *WriterReconnector, tx tx.Transaction, tracer *trace.Topic) *WriterWithTransaction
func (*WriterWithTransaction) Close ¶
func (w *WriterWithTransaction) Close(ctx context.Context) error
func (*WriterWithTransaction) WaitInit ¶
func (w *WriterWithTransaction) WaitInit(ctx context.Context) (info InitialInfo, err error)
func (*WriterWithTransaction) Write ¶
func (w *WriterWithTransaction) Write(ctx context.Context, messages ...PublicMessage) error
type WritersCommonConfig ¶
Click to show internal directories.
Click to hide internal directories.