connector

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimestampLength = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConnectorFactory

type BaseConnectorFactory struct {
	URLs []string
	// contains filtered or unexported fields
}

BaseConnectorFactory contains underlying common methods for all ConnectorFactory implementations

func (*BaseConnectorFactory) GetNextPublisherIP

func (b *BaseConnectorFactory) GetNextPublisherIP() string

GetNextPublisherIP returns the next IP for a publisher to connect to in a round-robin-manner from the list of available broker servers

func (*BaseConnectorFactory) GetNextSubscriberIP

func (b *BaseConnectorFactory) GetNextSubscriberIP() string

GetNextSubscriberIP returns the next IP for a subscriber to connect to in a reversed round-robin-manner from the list of available broker servers

type Kafka2ConnectorFactory

type Kafka2ConnectorFactory struct {
	URLs  []string
	Topic string
}

Kafka2ConnectorFactory implements ConnectorFactory by creating a Requester which publishes messages to Kafka and waits to consume them.

func (*Kafka2ConnectorFactory) GetPublisher

func (k *Kafka2ConnectorFactory) GetPublisher(num uint64) wrench.Publisher

GetPublisher returns a new Publisher, called for each Benchmark connection.

func (*Kafka2ConnectorFactory) GetSubscriber

func (k *Kafka2ConnectorFactory) GetSubscriber(num uint64) wrench.Subscriber

GetSubscriber returns a new Subscriber, called for each Benchmark connection.

type KafkaConnectorFactory

type KafkaConnectorFactory struct {
	BaseConnectorFactory
	Topic       string
	Version     string
	Compression string
	Replication bool
	Partitions  int32
	KeyProvider KafkaKeyProvider
}

KafkaConnectorFactory implements ConnectorFactory by creating a Requester which publishes messages to Kafka and waits to consume them.

func (*KafkaConnectorFactory) GetPublisher

func (k *KafkaConnectorFactory) GetPublisher(num uint64) wrench.Publisher

GetPublisher returns a new Publisher, called for each Benchmark connection.

func (*KafkaConnectorFactory) GetSubscriber

func (k *KafkaConnectorFactory) GetSubscriber(num uint64) wrench.Subscriber

GetSubscriber returns a new Subscriber, called for each Benchmark connection.

type KafkaKeyProvider

type KafkaKeyProvider interface {
	GetKey(payload *[]byte) sarama.Encoder
}

func GetDefaultKafkaKeyProvider

func GetDefaultKafkaKeyProvider() KafkaKeyProvider

type NATSConnectorFactory

type NATSConnectorFactory struct {
	BaseConnectorFactory
	Subject     string
	NumSubjects uint64
}

NATSConnectorFactory implements ConnectorFactory by creating a Requester which publishes messages to NATS and waits to receive them.

func (*NATSConnectorFactory) GetPublisher

func (n *NATSConnectorFactory) GetPublisher(num uint64) wrench.Publisher

GetPublisher returns a new Publisher, called for each Benchmark connection.

func (*NATSConnectorFactory) GetSubscriber

func (n *NATSConnectorFactory) GetSubscriber(num uint64) wrench.Subscriber

GetSubscriber returns a new Subsciber

type NATSStreamingConnectorFactory

type NATSStreamingConnectorFactory struct {
	BaseConnectorFactory
	Subject  string
	ClientID string
	URL      string
}

NATSStreamingConnectorFactory implements RequesterFactory by creating a Requester which publishes messages to NATS Streaming and waits to receive them.

func (*NATSStreamingConnectorFactory) GetPublisher

GetPublisher returns a new Publisher, called for each Benchmark connection.

func (*NATSStreamingConnectorFactory) GetSubscriber

func (n *NATSStreamingConnectorFactory) GetSubscriber(num uint64) wrench.Subscriber

GetSubscriber returns a new Subscriber, called for each Benchmark connection.

type NOOPConnectorFactory

type NOOPConnectorFactory struct {
}

NOOPConnectorFactory implements ConnectorFactory by providing methods to create Publisher and Subscriber instances

func (*NOOPConnectorFactory) GetPublisher

func (n *NOOPConnectorFactory) GetPublisher(num uint64) wrench.Publisher

GetPublisher returns a new Publisher

func (*NOOPConnectorFactory) GetSubscriber

func (n *NOOPConnectorFactory) GetSubscriber(num uint64) wrench.Subscriber

GetSubscriber returns a new Subsciber

type PulsarConnectorFactory

type PulsarConnectorFactory struct {
	BaseConnectorFactory
	Topic  string
	Client pulsar.Client
}

PulsarConnectorFactory implements ConnectorFactory by creating a Requester which publishes messages to Pulsar and waits to consume them.

func (*PulsarConnectorFactory) GetPublisher

func (k *PulsarConnectorFactory) GetPublisher(num uint64) wrench.Publisher

GetPublisher returns a new Publisher, called for each Benchmark connection.

func (*PulsarConnectorFactory) GetSubscriber

func (k *PulsarConnectorFactory) GetSubscriber(num uint64) wrench.Subscriber

GetSubscriber returns a new Subscriber, called for each Benchmark connection.

type RedisPubSubConnectorFactory

type RedisPubSubConnectorFactory struct {
	BaseConnectorFactory
	Channel string
}

RedisPubSubConnectorFactory implements ConnectorFactory by creating a Requester which publishes messages to Redis and waits to receive them.

func (*RedisPubSubConnectorFactory) GetPublisher

func (r *RedisPubSubConnectorFactory) GetPublisher(num uint64) wrench.Publisher

GetPublisher returns a new Publisher, called for each Benchmark connection.

func (*RedisPubSubConnectorFactory) GetSubscriber

func (r *RedisPubSubConnectorFactory) GetSubscriber(num uint64) wrench.Subscriber

GetSubscriber returns a new Subscriber, called for each Benchmark connection.

Jump to

Keyboard shortcuts

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