Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultEgressKafkaConsumerGroup is the default Kafka group name used by egress controller. DefaultEgressKafkaConsumerGroup = "replicator.egress" // DefaultIngressKafkaConsumerGroup is the default Kafka group name used by ingress controller. DefaultIngressKafkaConsumerGroup = "replicator.ingress" // DefaultCompactionKafkaConsumerGroup is the default Kafka group name used by compaction controller. DefaultCompactionKafkaConsumerGroup = "replicator.compaction" )
Functions ¶
func NewCompaction ¶
func NewCompaction(config CompactionConfig) (*compaction.Controller, error)
NewCompaction creates a basic compaction controller.
func NewEgress ¶
func NewEgress(config EgressConfig) (*egress.Controller, error)
NewEgress creates a basic egress controller.
func NewIngress ¶
func NewIngress(config IngressConfig) (*ingress.Controller, error)
NewIngress creates a basic ingress controller.
Types ¶
type CompactionConfig ¶
type CompactionConfig struct {
// Unique name that identifies the local region/data center/cloud.
//
// Field value is required.
LocalRegion string `required:"true"`
// The AWS session object used to create AWS service clients.
//
// Field value is required.
AWSSession *session.Session `required:"true"`
// The AWS config object used to create AWS service clients.
//
// Field value is required.
AWSConfig *aws.Config `required:"true"`
// Bucket name to store segments.
//
// Field value is required.
S3Bucket string `required:"true"`
// Key prefix for segment objects.
//
// Default value is set via DefaultS3KeyPrefix variable.
S3KeyPrefix string
// The segment file format used to write segments.
SegmentFormat core.SegmentFormat `required:"true"`
// The list of Kafka brokers.
//
// Field value is required.
KafkaBrokers []string `required:"true"`
// Source Kafka topic names that will be compacted.
//
// Will use DefaultConfig if topic config was not set.
//
// Field value is required.
Topics map[string]*compaction.Config `required:"true"`
// Kafka consumer group identifier.
//
// Default value is set via DefaultCompactionKafkaConsumerGroup variable.
KafkaConsumerGroup string
// Cron expression that determines compaction schedule.
//
// If not set, automatic compaction will not be executed and
// is required to call Compact method to trigger the operation.
CronSchedule string
// Time zone location used for cron schedule
//
// Default value is UTC.
CronLocation *time.Location
// Maximum number of compactions running simultaneously.
Parallelism int `min:"1"`
}
CompactionConfig represents the compaction configuration.
type EgressConfig ¶
type EgressConfig struct {
// Unique name that identifies the local region/data center/cloud.
//
// Field value is required.
LocalRegion string `required:"true"`
// The AWS config object used to create AWS service clients.
//
// Field value is required.
AWSConfig *aws.Config `required:"true"`
// The AWS session object used to create AWS service clients.
//
// Field value is required.
AWSSession *session.Session `required:"true"`
// Bucket name to store segments.
//
// Field value is required.
S3Bucket string `required:"true"`
// Key prefix for segment objects.
//
// Default value is set via DefaultS3KeyPrefix variable.
S3KeyPrefix string
// The segment file format used to write segments.
SegmentFormat core.SegmentFormat `required:"true"`
// The list of Kafka brokers.
//
// Field value is required.
KafkaBrokers []string `required:"true"`
// Source Kafka topic names that will be consumed and written to segment store.
//
// Will use DefaultTopicConfig if topic config was not set.
//
// Field value is required.
KafkaTopics map[string]*egress.TopicConfig `required:"true"`
// Kafka consumer group identifier.
//
// Default value is set via DefaultEgressKafkaConsumerGroup variable.
KafkaConsumerGroup string
}
EgressConfig represents the basic egresss configuration.
type IngressConfig ¶
type IngressConfig struct {
// Unique name that identifies the local region/data center/cloud.
//
// Field value is required.
LocalRegion string `required:"true"`
// List of sources to ingress from.
//
// Will use DefaultSourceConfig if source config was not set.
//
// Field value is required.
Sources map[ingress.Source]*ingress.SourceConfig `required:"true"`
// The AWS session object used to create AWS service clients.
//
// Field value is required.
AWSSession *session.Session `required:"true"`
// The AWS config object used to create AWS service clients.
//
// Field value is required.
AWSConfig *aws.Config `required:"true"`
// Bucket name to store segments.
//
// Field value is required.
S3Bucket string `required:"true"`
// Key prefix for segment objects.
//
// Default value is set via DefaultS3KeyPrefix variable.
S3KeyPrefix string
// The segment file format used to read segments.
SegmentFormat core.SegmentFormat `required:"true"`
// AWS SQS queue name where AWS S3 notification events are published.
//
// The implementation expects that both Created and Removed event types to be enabled
// for keys storing segments (i.e. the keys with DataKeyPrefix).
//
// Check the AWS S3 documentation for instructions on how to enable event notifications:
// https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html
//
// Field value is required.
SQSQueueName string `required:"true"`
// The list of Kafka brokers.
//
// Field value is required.
KafkaBrokers []string `required:"true"`
// Kafka consumer group identifier.
//
// Used for main Kafka consumer, the checkpoint store and consistent
// segment store PubSubs consumers.
//
// Default value is set via DefaultIngressKafkaConsumerGroup variable.
KafkaConsumerGroup string
// Kafka topic name for used by consistent segment store PubSub client.
//
// The topic cleanup policy needs to be set to 'delete' with appropriate
// retention time set to discard old segment events.
KafkaSegmentEventsTopic string `required:"true"`
// The duration each segment event is tracked.
//
// Should match the configured Kafka topic retention time.
//
// Field value is required.
KafkaSegmentEventsRetention time.Duration `required:"true"`
// Kafka topic name for used by checkpoint store PubSub client.
//
// The topic cleanup policy needs to be set to 'compacted' to retain
// only the last checkpoint for each <region, topic, partition> tuple.
// This avoids unnecessary disk space consumption and improved startup time.
KafkaCheckpointTopic string `required:"true"`
// Kafka producer message batch size.
//
// Higher values improve throughput while lower values improve latency.
//
// Default value is set by underlying Kafka producer.
KafkaProducerBatchSize int
// Kafka producer message batch delay.
//
// Higher values improve throughput while lower values improve latency.
//
// Default value is set by underlying Kafka producer.
KafkaProducerBatchDelay time.Duration
}
IngressConfig represents the basic ingress configuration.
Click to show internal directories.
Click to hide internal directories.
