topicoptions

package
v3.40.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// CommitModeAsync - commit return true if commit success add to internal send buffer (but not sent to server)
	// now it is grpc buffer, in feature it may be internal sdk buffer
	CommitModeAsync = topicreaderinternal.CommitModeAsync // default

	// CommitModeNone - reader will not be commit operation
	CommitModeNone = topicreaderinternal.CommitModeNone

	// CommitModeSync - commit return true when sdk receive ack of commit from server
	// The mode needs strong ordering client code for prevent deadlock.
	// Example:
	// Good:
	// CommitOffset(1)
	// CommitOffset(2)
	//
	// Deadlock:
	// CommitOffset(2) - server will wait commit offset 1 before send ack about offset 1 and 2 committed.
	// CommitOffset(1)
	CommitModeSync = topicreaderinternal.CommitModeSync
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlterOption

type AlterOption interface {
	ApplyAlterOption(req *rawtopic.AlterTopicRequest)
}

AlterOption

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterConsumerWithAttributes

func AlterConsumerWithAttributes(name string, attributes map[string]string) AlterOption

AlterConsumerWithAttributes

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterConsumerWithImportant

func AlterConsumerWithImportant(name string, important bool) AlterOption

AlterConsumerWithImportant

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterConsumerWithReadFrom

func AlterConsumerWithReadFrom(name string, readFrom time.Time) AlterOption

AlterConsumerWithReadFrom

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterConsumerWithSupportedCodecs

func AlterConsumerWithSupportedCodecs(name string, codecs []topictypes.Codec) AlterOption

AlterConsumerWithSupportedCodecs

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithAddConsumers

func AlterWithAddConsumers(consumers ...topictypes.Consumer) AlterOption

AlterWithAddConsumers

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithAttributes

func AlterWithAttributes(attributes map[string]string) AlterOption

AlterWithAttributes

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithDropConsumers

func AlterWithDropConsumers(consumersName ...string) AlterOption

AlterWithDropConsumers

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithMeteringMode added in v3.38.2

func AlterWithMeteringMode(m topictypes.MeteringMode) AlterOption

AlterWithMeteringMode

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithMinActivePartitions

func AlterWithMinActivePartitions(minActivePartitions int64) AlterOption

AlterWithMinActivePartitions

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithPartitionCountLimit

func AlterWithPartitionCountLimit(partitionCountLimit int64) AlterOption

AlterWithPartitionCountLimit

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithPartitionWriteBurstBytes

func AlterWithPartitionWriteBurstBytes(burstBytes int64) AlterOption

AlterWithPartitionWriteBurstBytes

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithPartitionWriteSpeedBytesPerSecond

func AlterWithPartitionWriteSpeedBytesPerSecond(bytesPerSecond int64) AlterOption

AlterWithPartitionWriteSpeedBytesPerSecond

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithRetentionPeriod

func AlterWithRetentionPeriod(retentionPeriod time.Duration) AlterOption

AlterWithRetentionPeriod

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithRetentionStorageMB

func AlterWithRetentionStorageMB(retentionStorageMB int64) AlterOption

AlterWithRetentionStorageMB

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func AlterWithSupportedCodecs

func AlterWithSupportedCodecs(codecs ...topictypes.Codec) AlterOption

AlterWithSupportedCodecs

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type CommitMode

CommitMode

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type CreateDecoderFunc

type CreateDecoderFunc = topicreaderinternal.PublicCreateDecoderFunc

CreateDecoderFunc

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type CreateEncoderFunc added in v3.38.0

type CreateEncoderFunc = topicwriterinternal.PublicCreateEncoderFunc

type CreateOption

type CreateOption interface {
	ApplyCreateOption(request *rawtopic.CreateTopicRequest)
}

CreateOption

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithAttributes

func CreateWithAttributes(attributes map[string]string) CreateOption

CreateWithAttributes

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithConsumer

func CreateWithConsumer(consumers ...topictypes.Consumer) CreateOption

CreateWithConsumer

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithMeteringMode added in v3.38.2

func CreateWithMeteringMode(mode topictypes.MeteringMode) CreateOption

CreateWithMeteringMode

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithMinActivePartitions

func CreateWithMinActivePartitions(count int64) CreateOption

CreateWithMinActivePartitions

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithPartitionCountLimit

func CreateWithPartitionCountLimit(count int64) CreateOption

CreateWithPartitionCountLimit

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithPartitionWriteBurstBytes

func CreateWithPartitionWriteBurstBytes(partitionWriteBurstBytes int64) CreateOption

CreateWithPartitionWriteBurstBytes

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithPartitionWriteSpeedBytesPerSecond

func CreateWithPartitionWriteSpeedBytesPerSecond(partitionWriteSpeedBytesPerSecond int64) CreateOption

CreateWithPartitionWriteSpeedBytesPerSecond

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithRetentionPeriod

func CreateWithRetentionPeriod(retentionPeriod time.Duration) CreateOption

CreateWithRetentionPeriod

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithRetentionStorageMB

func CreateWithRetentionStorageMB(retentionStorageMB int64) CreateOption

CreateWithRetentionStorageMB

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func CreateWithSupportedCodecs added in v3.38.2

func CreateWithSupportedCodecs(codecs ...topictypes.Codec) CreateOption

CreateWithSupportedCodecs

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type DescribeOption

type DescribeOption func(req *rawtopic.DescribeTopicRequest)

DescribeOption

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type DropOption

type DropOption interface {
	ApplyDropOption(request *rawtopic.DropTopicRequest)
}

DropOption

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type GetPartitionStartOffsetFunc

type GetPartitionStartOffsetFunc = topicreaderinternal.PublicGetPartitionStartOffsetFunc

GetPartitionStartOffsetFunc

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type GetPartitionStartOffsetRequest

type GetPartitionStartOffsetRequest = topicreaderinternal.PublicGetPartitionStartOffsetRequest

GetPartitionStartOffsetRequest

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type GetPartitionStartOffsetResponse

type GetPartitionStartOffsetResponse = topicreaderinternal.PublicGetPartitionStartOffsetResponse

GetPartitionStartOffsetResponse

type OnWriterInitResponseCallback added in v3.38.0

type OnWriterInitResponseCallback = topicwriterinternal.PublicOnWriterInitResponseCallback

OnWriterInitResponseCallback

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type ReadSelector

ReadSelector

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type ReadSelectors

type ReadSelectors []ReadSelector

ReadSelectors

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func ReadTopic

func ReadTopic(path string) ReadSelectors

ReadTopic create simple selector for read topics

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type ReaderOption

ReaderOption

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithAddDecoder

func WithAddDecoder(codec topictypes.Codec, decoderCreate CreateDecoderFunc) ReaderOption

WithAddDecoder

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithBatchReadMaxCount

func WithBatchReadMaxCount(count int) ReaderOption

WithBatchReadMaxCount

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithBatchReadMinCount

func WithBatchReadMinCount(count int) ReaderOption

WithBatchReadMinCount prefer min count messages in batch sometimes batch can contain fewer messages, for example if local buffer is full and SDK can't receive more messages

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithCommitCountTrigger

func WithCommitCountTrigger(count int) ReaderOption

WithCommitCountTrigger set count trigger for send batch to server if count > 0 and sdk count of buffered commits >= count - send commit request to server 0 mean no count limit and use timer lag trigger only

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithCommitMode

func WithCommitMode(mode CommitMode) ReaderOption

WithCommitMode

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithCommitTimeLagTrigger

func WithCommitTimeLagTrigger(lag time.Duration) ReaderOption

WithCommitTimeLagTrigger set time lag from first commit message before send commit to server for accumulate many similar-time commits to one server request 0 mean no additional lag and send commit soon as possible Default value: 1 second

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithCommonConfig

func WithCommonConfig(common config.Common) ReaderOption

WithCommonConfig

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithGetPartitionStartOffset

func WithGetPartitionStartOffset(f GetPartitionStartOffsetFunc) ReaderOption

WithGetPartitionStartOffset

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithMessagesBufferSize

func WithMessagesBufferSize(size int) ReaderOption

WithMessagesBufferSize

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithReaderOperationCancelAfter

func WithReaderOperationCancelAfter(cancelAfter time.Duration) ReaderOption

WithReaderOperationCancelAfter

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithReaderOperationTimeout

func WithReaderOperationTimeout(timeout time.Duration) ReaderOption

WithReaderOperationTimeout

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithReaderTrace added in v3.32.0

func WithReaderTrace(tracer trace.Topic) ReaderOption

WithReaderTrace

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type TopicOption

type TopicOption func(c *topic.Config)

TopicOption

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithOperationCancelAfter

func WithOperationCancelAfter(operationCancelAfter time.Duration) TopicOption

WithOperationCancelAfter set the maximum amount of time a YDB server will process an operation. After timeout exceeds YDB will try to cancel operation and if it succeeds appropriate error will be returned to the client; otherwise processing will be continued. If OperationCancelAfter is zero then no timeout is used.

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithOperationTimeout

func WithOperationTimeout(operationTimeout time.Duration) TopicOption

WithOperationTimeout set the maximum amount of time a YDB server will process an operation. After timeout exceeds YDB will try to cancel operation and regardless of the cancellation appropriate error will be returned to the client. If OperationTimeout is zero then no timeout is used.

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithTrace

func WithTrace(trace trace.Topic, opts ...trace.TopicComposeOption) TopicOption

WithTrace defines trace over persqueue client calls

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type WithOnWriterConnectedInfo added in v3.38.0

type WithOnWriterConnectedInfo = topicwriterinternal.PublicWithOnWriterConnectedInfo

WithOnWriterConnectedInfo present information, received from server

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

type WriteSessionMetadata added in v3.38.0

type WriteSessionMetadata map[string]string

type WriterOption added in v3.38.0

func WithCodec added in v3.38.0

func WithCodec(codec topictypes.Codec) WriterOption

WithCodec disable codec auto select and force set codec for the write session

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithCodecAutoSelect added in v3.38.0

func WithCodecAutoSelect() WriterOption

WithCodecAutoSelect - auto select best codec for messages stream enabled by default if option enabled - send a batch of messages for every allowed codec (for prevent delayed bad codec accident) then from time to time measure all codecs and select codec with the smallest result messages size

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithMessageGroupID added in v3.38.0

func WithMessageGroupID(groupID string) WriterOption

WithMessageGroupID set message groupid on write session level

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithOnWriterFirstConnected added in v3.38.0

func WithOnWriterFirstConnected(f OnWriterInitResponseCallback) WriterOption

WithOnWriterFirstConnected set callback f, which will called once - after first successfully init topic writer stream

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithPartitionID added in v3.38.0

func WithPartitionID(partitionID int64) WriterOption

WithPartitionID set direct partition id on write session level

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithSyncWrite added in v3.38.0

func WithSyncWrite(sync bool) WriterOption

WithSyncWrite - when enabled every Write call wait ack from server for all messages from the call disabled by default

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriteSessionMeta added in v3.38.0

func WithWriteSessionMeta(meta map[string]string) WriterOption

WithWriteSessionMeta set session metadata

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriterAddEncoder added in v3.38.0

func WithWriterAddEncoder(codec topictypes.Codec, f CreateEncoderFunc) WriterOption

WithWriterAddEncoder add custom codec implementation to writer

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriterCompressorCount added in v3.38.0

func WithWriterCompressorCount(num int) WriterOption

WithWriterCompressorCount set max count of goroutine for compress messages must be more zero

panic if num <= 0

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriterMaxQueueLen added in v3.38.2

func WithWriterMaxQueueLen(num int) WriterOption

WithWriterMaxQueueLen set max len of queue for wait ack

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriterMessageMaxBytesSize added in v3.38.2

func WithWriterMessageMaxBytesSize(size int) WriterOption

WithWriterMessageMaxBytesSize set max body size of one message in bytes

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriterSetAutoCreatedAt added in v3.38.0

func WithWriterSetAutoCreatedAt(val bool) WriterOption

WithWriterSetAutoCreatedAt set messages CreatedAt by SDK enabled by default if enabled - Message.CreatedAt field must be zero

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriterSetAutoSeqNo added in v3.38.0

func WithWriterSetAutoSeqNo(val bool) WriterOption

WithWriterSetAutoSeqNo set messages SeqNo by SDK enabled by default if enabled - Message.SeqNo field must be zero

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

func WithWriterTrace added in v3.40.0

func WithWriterTrace(tracer trace.Topic) WriterOption

WithWriterTrace

Experimental

Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

Jump to

Keyboard shortcuts

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