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 Writer
- type WriterReconnector
- type WriterReconnectorConfig
- 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 ¶ added in v3.52.3
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 ¶ added in v3.39.0
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 ¶ added in v3.39.0
func (p PublicFuturePartitioning) ToRaw() rawtopicwriter.Partitioning
type PublicMessage ¶ added in v3.54.3
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 ¶ added in v3.67.1
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 ¶ added in v3.38.2
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 ¶ added in v3.42.0
func WithStartTimeout(timeout time.Duration) PublicWriterOption
func WithTokenUpdateInterval ¶ added in v3.41.0
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 Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(cred credentials.Credentials, options []PublicWriterOption) (*Writer, error)
type WriterReconnector ¶
type WriterReconnector struct {
// contains filtered or unexported fields
}
func (*WriterReconnector) Flush ¶ added in v3.66.1
func (w *WriterReconnector) Flush(ctx context.Context) error
func (*WriterReconnector) WaitInit ¶ added in v3.52.3
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 }
type WritersCommonConfig ¶
type WritersCommonConfig struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.