writer

package
v0.0.0-...-369b60f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FastFail = func() *ErrorProtect {
	return NewErrorProtect(1, time.Minute)
}

Functions

func ConnectTimeoutOption

func ConnectTimeoutOption(timeout int) config.Option[*MilvusDataHandler]

func DecodePwd

func DecodePwd(pwd string) (string, error)

func DialConfigOption

func DialConfigOption(dialConfig util.DialConfig) config.Option[*MilvusDataHandler]

func IgnorePartitionOption

func IgnorePartitionOption(ignore bool) config.Option[*MilvusDataHandler]

func KafkaAddressOption

func KafkaAddressOption(address string) config.Option[*KafkaDataHandler]

func KafkaEnableSASLOption

func KafkaEnableSASLOption(enableSASL bool) config.Option[*KafkaDataHandler]

func KafkaSecurityOption

func KafkaSecurityOption(sasl KafkaSASLParam) config.Option[*KafkaDataHandler]

func KafkaTopicOption

func KafkaTopicOption(topic string) config.Option[*KafkaDataHandler]

func NewChannelWriter

func NewChannelWriter(dataHandler api.DataHandler,
	writerConfig config.WriterConfig,
	droppedObjs map[string]map[string]uint64,
	downstream string,
) api.Writer

func NewReplicateMessageManager

func NewReplicateMessageManager(handler api.DataHandler, messageBufferSize int) api.MessageManager

func TokenOption

func TokenOption(token string) config.Option[*MilvusDataHandler]

func URIOption

func URIOption(uri string) config.Option[*MilvusDataHandler]

func UpdateMsgBase

func UpdateMsgBase(msgBase *commonpb.MsgBase, withReplicateInfo *commonpb.MsgBase)

Types

type ChannelWriter

type ChannelWriter struct {
	// contains filtered or unexported fields
}

func (*ChannelWriter) HandleOpMessagePack

func (c *ChannelWriter) HandleOpMessagePack(ctx context.Context, msgPack *msgstream.MsgPack) ([]byte, error)

func (*ChannelWriter) HandleReplicateAPIEvent

func (c *ChannelWriter) HandleReplicateAPIEvent(ctx context.Context, apiEvent *api.ReplicateAPIEvent) error

func (*ChannelWriter) HandleReplicateMessage

func (c *ChannelWriter) HandleReplicateMessage(ctx context.Context, channelName string, msgPack *msgstream.MsgPack) ([]byte, []byte, error)

func (*ChannelWriter) UpdateNameMappings

func (c *ChannelWriter) UpdateNameMappings(nameMappings map[string]string)

func (*ChannelWriter) WaitCollectionReady

func (c *ChannelWriter) WaitCollectionReady(ctx context.Context, collectionName, databaseName string, msgTs uint64) InfoState

func (*ChannelWriter) WaitDatabaseReady

func (c *ChannelWriter) WaitDatabaseReady(ctx context.Context, databaseName string, msgTs uint64, collectionName string) InfoState

WaitDatabaseReady wait for database ready, return value: skip the op or not, wait timeout or not

func (*ChannelWriter) WaitObjReady

func (c *ChannelWriter) WaitObjReady(ctx context.Context, db, collection, partition string, ts uint64) (bool, error)

func (*ChannelWriter) WaitObjReadyForAPIEvent

func (c *ChannelWriter) WaitObjReadyForAPIEvent(ctx context.Context, apiEvent *api.ReplicateAPIEvent, waitDatabase, waitCollection, waitPartition bool) (bool, error)

WaitObjReadyForAPIEvent wait database/collection/partition ready, return value: skip the op or not, and error

func (*ChannelWriter) WaitPartitionReady

func (c *ChannelWriter) WaitPartitionReady(ctx context.Context, collectionName, partitionName, databaseName string, msgTs uint64) InfoState

type ErrorProtect

type ErrorProtect struct {
	// contains filtered or unexported fields
}

ErrorProtect avoid to occur a lot of errors in the short time

func NewErrorProtect

func NewErrorProtect(per int32, unit time.Duration) *ErrorProtect

func (*ErrorProtect) Chan

func (e *ErrorProtect) Chan() <-chan struct{}

func (*ErrorProtect) Inc

func (e *ErrorProtect) Inc()

func (*ErrorProtect) Info

func (e *ErrorProtect) Info() string

type InfoState

type InfoState int
const (
	InfoStateUnknown InfoState = iota + 1
	InfoStateCreated
	InfoStateDropped
)

type KafkaDataFormatter

type KafkaDataFormatter struct {
	api.DataFormatter
}

func NewKafkaFormatter

func NewKafkaFormatter() *KafkaDataFormatter

func (*KafkaDataFormatter) Format

func (k *KafkaDataFormatter) Format(data any) ([]byte, error)

type KafkaDataHandler

type KafkaDataHandler struct {
	api.DataHandler
	// contains filtered or unexported fields
}

func NewKafkaDataHandler

func NewKafkaDataHandler(options ...config.Option[*KafkaDataHandler]) (*KafkaDataHandler, error)

NewKafkaDataHandler returns a singleton KafkaDataHandler

func (*KafkaDataHandler) AlterDatabase

func (k *KafkaDataHandler) AlterDatabase(ctx context.Context, param *api.AlterDatabaseParam) error

func (*KafkaDataHandler) AlterIndex

func (k *KafkaDataHandler) AlterIndex(ctx context.Context, param *api.AlterIndexParam) error

func (*KafkaDataHandler) CreateCollection

func (k *KafkaDataHandler) CreateCollection(ctx context.Context, param *api.CreateCollectionParam) error

func (*KafkaDataHandler) CreateDatabase

func (k *KafkaDataHandler) CreateDatabase(ctx context.Context, param *api.CreateDatabaseParam) error

func (*KafkaDataHandler) CreateIndex

func (k *KafkaDataHandler) CreateIndex(ctx context.Context, param *api.CreateIndexParam) error

func (*KafkaDataHandler) CreatePartition

func (k *KafkaDataHandler) CreatePartition(ctx context.Context, param *api.CreatePartitionParam) error

func (*KafkaDataHandler) CreateRole

func (k *KafkaDataHandler) CreateRole(ctx context.Context, param *api.CreateRoleParam) error

func (*KafkaDataHandler) CreateUser

func (k *KafkaDataHandler) CreateUser(ctx context.Context, param *api.CreateUserParam) error

rbac messages

func (*KafkaDataHandler) Delete

func (k *KafkaDataHandler) Delete(ctx context.Context, param *api.DeleteParam) error

func (*KafkaDataHandler) DeleteUser

func (k *KafkaDataHandler) DeleteUser(ctx context.Context, param *api.DeleteUserParam) error

func (*KafkaDataHandler) DropCollection

func (k *KafkaDataHandler) DropCollection(ctx context.Context, param *api.DropCollectionParam) error

func (*KafkaDataHandler) DropDatabase

func (k *KafkaDataHandler) DropDatabase(ctx context.Context, param *api.DropDatabaseParam) error

func (*KafkaDataHandler) DropIndex

func (k *KafkaDataHandler) DropIndex(ctx context.Context, param *api.DropIndexParam) error

func (*KafkaDataHandler) DropPartition

func (k *KafkaDataHandler) DropPartition(ctx context.Context, param *api.DropPartitionParam) error

func (*KafkaDataHandler) DropRole

func (k *KafkaDataHandler) DropRole(ctx context.Context, param *api.DropRoleParam) error

func (*KafkaDataHandler) Flush

func (k *KafkaDataHandler) Flush(ctx context.Context, param *api.FlushParam) error

func (*KafkaDataHandler) Insert

func (k *KafkaDataHandler) Insert(ctx context.Context, param *api.InsertParam) error

func (*KafkaDataHandler) KafkaOp

func (k *KafkaDataHandler) KafkaOp(ctx context.Context, database string, f func(p *kafka.Producer, d chan kafka.Event) error) error

func (*KafkaDataHandler) LoadCollection

func (k *KafkaDataHandler) LoadCollection(ctx context.Context, param *api.LoadCollectionParam) error

func (*KafkaDataHandler) LoadPartitions

func (k *KafkaDataHandler) LoadPartitions(ctx context.Context, param *api.LoadPartitionsParam) error

func (*KafkaDataHandler) OperatePrivilege

func (k *KafkaDataHandler) OperatePrivilege(ctx context.Context, param *api.OperatePrivilegeParam) error

func (*KafkaDataHandler) OperateUserRole

func (k *KafkaDataHandler) OperateUserRole(ctx context.Context, param *api.OperateUserRoleParam) error

func (*KafkaDataHandler) ReleaseCollection

func (k *KafkaDataHandler) ReleaseCollection(ctx context.Context, param *api.ReleaseCollectionParam) error

func (*KafkaDataHandler) ReleasePartitions

func (k *KafkaDataHandler) ReleasePartitions(ctx context.Context, param *api.ReleasePartitionsParam) error

func (*KafkaDataHandler) ReplicateMessage

func (k *KafkaDataHandler) ReplicateMessage(ctx context.Context, param *api.ReplicateMessageParam) error

func (*KafkaDataHandler) UpdateUser

func (k *KafkaDataHandler) UpdateUser(ctx context.Context, param *api.UpdateUserParam) error

type KafkaFormat

type KafkaFormat struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Value any    `json:"value"`
}

type KafkaMsg

type KafkaMsg struct {
	Data string  `json:"data"`
	Info msgType `json:"info"`
}

type KafkaSASLParam

type KafkaSASLParam struct {
	// contains filtered or unexported fields
}

type MilvusDataHandler

type MilvusDataHandler struct {
	api.DataHandler
	// contains filtered or unexported fields
}

func NewMilvusDataHandler

func NewMilvusDataHandler(options ...config.Option[*MilvusDataHandler]) (*MilvusDataHandler, error)

func (*MilvusDataHandler) AlterDatabase

func (m *MilvusDataHandler) AlterDatabase(ctx context.Context, param *api.AlterDatabaseParam) error

func (*MilvusDataHandler) AlterIndex

func (m *MilvusDataHandler) AlterIndex(ctx context.Context, param *api.AlterIndexParam) error

func (*MilvusDataHandler) CreateCollection

func (m *MilvusDataHandler) CreateCollection(ctx context.Context, param *api.CreateCollectionParam) error

func (*MilvusDataHandler) CreateDatabase

func (m *MilvusDataHandler) CreateDatabase(ctx context.Context, param *api.CreateDatabaseParam) error

func (*MilvusDataHandler) CreateIndex

func (m *MilvusDataHandler) CreateIndex(ctx context.Context, param *api.CreateIndexParam) error

func (*MilvusDataHandler) CreatePartition

func (m *MilvusDataHandler) CreatePartition(ctx context.Context, param *api.CreatePartitionParam) error

func (*MilvusDataHandler) CreateRole

func (m *MilvusDataHandler) CreateRole(ctx context.Context, param *api.CreateRoleParam) error

func (*MilvusDataHandler) CreateUser

func (m *MilvusDataHandler) CreateUser(ctx context.Context, param *api.CreateUserParam) error

func (*MilvusDataHandler) Delete

func (m *MilvusDataHandler) Delete(ctx context.Context, param *api.DeleteParam) error

func (*MilvusDataHandler) DeleteUser

func (m *MilvusDataHandler) DeleteUser(ctx context.Context, param *api.DeleteUserParam) error

func (*MilvusDataHandler) DescribeCollection

func (m *MilvusDataHandler) DescribeCollection(ctx context.Context, param *api.DescribeCollectionParam) error

func (*MilvusDataHandler) DescribeDatabase

func (m *MilvusDataHandler) DescribeDatabase(ctx context.Context, param *api.DescribeDatabaseParam) error

func (*MilvusDataHandler) DescribePartition

func (m *MilvusDataHandler) DescribePartition(ctx context.Context, param *api.DescribePartitionParam) error

func (*MilvusDataHandler) DropCollection

func (m *MilvusDataHandler) DropCollection(ctx context.Context, param *api.DropCollectionParam) error

func (*MilvusDataHandler) DropDatabase

func (m *MilvusDataHandler) DropDatabase(ctx context.Context, param *api.DropDatabaseParam) error

func (*MilvusDataHandler) DropIndex

func (m *MilvusDataHandler) DropIndex(ctx context.Context, param *api.DropIndexParam) error

func (*MilvusDataHandler) DropPartition

func (m *MilvusDataHandler) DropPartition(ctx context.Context, param *api.DropPartitionParam) error

func (*MilvusDataHandler) DropRole

func (m *MilvusDataHandler) DropRole(ctx context.Context, param *api.DropRoleParam) error

func (*MilvusDataHandler) Flush

func (m *MilvusDataHandler) Flush(ctx context.Context, param *api.FlushParam) error

func (*MilvusDataHandler) GetObjectType

func (m *MilvusDataHandler) GetObjectType(o string) (entity.PriviledgeObjectType, error)

func (*MilvusDataHandler) Insert

func (m *MilvusDataHandler) Insert(ctx context.Context, param *api.InsertParam) error

func (*MilvusDataHandler) LoadCollection

func (m *MilvusDataHandler) LoadCollection(ctx context.Context, param *api.LoadCollectionParam) error

func (*MilvusDataHandler) LoadPartitions

func (m *MilvusDataHandler) LoadPartitions(ctx context.Context, param *api.LoadPartitionsParam) error

func (*MilvusDataHandler) OperatePrivilege

func (m *MilvusDataHandler) OperatePrivilege(ctx context.Context, param *api.OperatePrivilegeParam) error

func (*MilvusDataHandler) OperateUserRole

func (m *MilvusDataHandler) OperateUserRole(ctx context.Context, param *api.OperateUserRoleParam) error

func (*MilvusDataHandler) ReleaseCollection

func (m *MilvusDataHandler) ReleaseCollection(ctx context.Context, param *api.ReleaseCollectionParam) error

func (*MilvusDataHandler) ReleasePartitions

func (m *MilvusDataHandler) ReleasePartitions(ctx context.Context, param *api.ReleasePartitionsParam) error

func (*MilvusDataHandler) ReplicateMessage

func (m *MilvusDataHandler) ReplicateMessage(ctx context.Context, param *api.ReplicateMessageParam) error

func (*MilvusDataHandler) UpdateUser

func (m *MilvusDataHandler) UpdateUser(ctx context.Context, param *api.UpdateUserParam) error

Jump to

Keyboard shortcuts

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