replicator

package
Version: v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientFactory

type ClientFactory interface {
	// GetReplicatorClient gets the thrift client for making calls to remote Replicator
	GetReplicatorClient(zone string) (replicator.TChanReplicator, error)

	// SetTChannel sets the tchannel used by thrift client
	SetTChannel(ch *tchannel.Channel)

	// get hosts for a given deployment
	GetHostsForDeployment(deployment string) []string

	// set hosts for a given deployment
	UpdateHostsForDeployment(deployment string, hosts []string)

	// get hosts for all deployments
	GetHostsForAllDeployment() map[string][]string
}

ClientFactory manage discovery of remote replicator and make sure we only allocate new thrift clients when necessary

func NewReplicatorClientFactory

func NewReplicatorClientFactory(config configure.CommonAppConfig, logger bark.Logger, hosts map[string][]string) ClientFactory

NewReplicatorClientFactory instantiates a ReplicatorClientFactory object

type MetadataReconciler

type MetadataReconciler interface {
	common.Daemon
}

MetadataReconciler periodically queries metadata and compare with the metadata from remote replicator and try to reconcile the states

func NewMetadataReconciler

func NewMetadataReconciler(mClient metadata.TChanMetadataService, replicator *Replicator, localZone string, logger bark.Logger, m3client metrics.Client) MetadataReconciler

NewMetadataReconciler returns an instance of MetadataReconciler

type Replicator

type Replicator struct {
	common.SCommon

	AppConfig configure.CommonAppConfig
	// contains filtered or unexported fields
}

Replicator is the main server class for replicator

func NewReplicator

func NewReplicator(serviceName string, sVice common.SCommon, metadataClient metadata.TChanMetadataService, replicatorClientFactory ClientFactory, config configure.CommonAppConfig) (*Replicator, []thrift.TChanServer)

NewReplicator is the constructor for Replicator

func (*Replicator) CreateConsumerGroupExtent added in v1.26.0

func (r *Replicator) CreateConsumerGroupExtent(ctx thrift.Context, createRequest *shared.CreateConsumerGroupExtentRequest) error

CreateConsumerGroupExtent create cg extent at local zone, expect to be called by remote replicator

func (*Replicator) CreateConsumerGroupUUID

func (r *Replicator) CreateConsumerGroupUUID(ctx thrift.Context, createRequest *shared.CreateConsumerGroupUUIDRequest) (*shared.ConsumerGroupDescription, error)

CreateConsumerGroupUUID creates consumer group at local zone, expect to be called by replicator from authoritative zone

func (*Replicator) CreateDestinationUUID

func (r *Replicator) CreateDestinationUUID(ctx thrift.Context, createRequest *shared.CreateDestinationUUIDRequest) (*shared.DestinationDescription, error)

CreateDestinationUUID creates destination at local zone, expect to be called by replicator from authoritative zone

func (*Replicator) CreateExtent

func (r *Replicator) CreateExtent(ctx thrift.Context, createRequest *shared.CreateExtentRequest) (*shared.CreateExtentResult_, error)

CreateExtent create extent at local zone, expect to be called by remote replicator

func (*Replicator) CreateRemoteConsumerGroupExtent added in v1.26.0

func (r *Replicator) CreateRemoteConsumerGroupExtent(ctx thrift.Context, createRequest *shared.CreateConsumerGroupExtentRequest) error

CreateRemoteConsumerGroupExtent propagate creation request to multiple remote zones, expect to be called by local zone services

func (*Replicator) CreateRemoteConsumerGroupUUID

func (r *Replicator) CreateRemoteConsumerGroupUUID(ctx thrift.Context, createRequest *shared.CreateConsumerGroupUUIDRequest) error

CreateRemoteConsumerGroupUUID propagate creation to multiple remote zones, expect to be called only in authoritative zone

func (*Replicator) CreateRemoteDestinationUUID

func (r *Replicator) CreateRemoteDestinationUUID(ctx thrift.Context, createRequest *shared.CreateDestinationUUIDRequest) error

CreateRemoteDestinationUUID propagates creation to multiple remote zones, expect to be called only in authoritative zone

func (*Replicator) CreateRemoteExtent

func (r *Replicator) CreateRemoteExtent(ctx thrift.Context, createRequest *shared.CreateExtentRequest) error

CreateRemoteExtent propagate creation request to multiple remote zones, expect to be called by local zone services

func (*Replicator) DeleteConsumerGroup

func (r *Replicator) DeleteConsumerGroup(ctx thrift.Context, deleteRequest *shared.DeleteConsumerGroupRequest) error

DeleteConsumerGroup deletes consumer group at local zone, expect to be called by replicator from authoritative zone

func (*Replicator) DeleteDestination

func (r *Replicator) DeleteDestination(ctx thrift.Context, deleteRequest *shared.DeleteDestinationRequest) error

DeleteDestination deletes destination at local zone, expect to be called by replicator from authoritative zone

func (*Replicator) DeleteRemoteConsumerGroup

func (r *Replicator) DeleteRemoteConsumerGroup(ctx thrift.Context, deleteRequest *shared.DeleteConsumerGroupRequest) error

DeleteRemoteConsumerGroup propagate deletion to multiple remote zones, expect to be called only in authoritative zone

func (*Replicator) DeleteRemoteDestination

func (r *Replicator) DeleteRemoteDestination(ctx thrift.Context, deleteRequest *shared.DeleteDestinationRequest) error

DeleteRemoteDestination propagate deletion to multiple remote zones, expect to be called only in authoritative zone

func (*Replicator) DumpConnectionStatus added in v1.26.0

func (r *Replicator) DumpConnectionStatus(ctx thrift.Context) (*admin.ReplicatorConnectionStatus, error)

DumpConnectionStatus implements the admin API

func (*Replicator) ListConsumerGroups added in v1.26.0

func (r *Replicator) ListConsumerGroups(ctx thrift.Context, getRequest *shared.ListConsumerGroupRequest) (*shared.ListConsumerGroupResult_, error)

ListConsumerGroups list consumer groups

func (*Replicator) ListDestinations

func (r *Replicator) ListDestinations(ctx thrift.Context, listRequest *shared.ListDestinationsRequest) (*shared.ListDestinationsResult_, error)

ListDestinations returns a list of destinations

func (*Replicator) ListDestinationsByUUID

func (r *Replicator) ListDestinationsByUUID(ctx thrift.Context, listRequest *shared.ListDestinationsByUUIDRequest) (*shared.ListDestinationsResult_, error)

ListDestinationsByUUID returns a list of destinations by UUID

func (*Replicator) ListExtentsStats

func (r *Replicator) ListExtentsStats(ctx thrift.Context, listRequest *shared.ListExtentsStatsRequest) (*shared.ListExtentsStatsResult_, error)

ListExtentsStats returns a list of extents

func (*Replicator) OpenReplicationReadStreamHandler

func (r *Replicator) OpenReplicationReadStreamHandler(w http.ResponseWriter, req *http.Request)

OpenReplicationReadStreamHandler is websocket handler for opening replication read stream. This is called by remote replicator to start a replication request for a local extent Internally the API will connect to local store to read the actual message

func (*Replicator) OpenReplicationRemoteReadStreamHandler

func (r *Replicator) OpenReplicationRemoteReadStreamHandler(w http.ResponseWriter, req *http.Request)

OpenReplicationRemoteReadStreamHandler is websocket handler for opening replication remote read stream. This is called by local store host to initiate a replication request for a remote extent Internally the API will connect to a remote replicator to read message

func (*Replicator) ReadConsumerGroup added in v1.26.0

func (r *Replicator) ReadConsumerGroup(ctx thrift.Context, getRequest *shared.ReadConsumerGroupRequest) (*shared.ConsumerGroupDescription, error)

ReadConsumerGroup reads a cg

func (*Replicator) ReadConsumerGroupExtents added in v1.26.0

ReadConsumerGroupExtents list consumer group extents

func (*Replicator) ReadConsumerGroupInRemoteZone added in v1.26.0

func (r *Replicator) ReadConsumerGroupInRemoteZone(ctx thrift.Context, getRequest *shared.ReadConsumerGroupInRemoteRequest) (*shared.ConsumerGroupDescription, error)

ReadConsumerGroupInRemoteZone reads a cg in remote zone

func (*Replicator) ReadDestination added in v1.26.0

func (r *Replicator) ReadDestination(ctx thrift.Context, getRequest *shared.ReadDestinationRequest) (*shared.DestinationDescription, error)

ReadDestination reads a destination

func (*Replicator) ReadDestinationInRemoteZone added in v1.26.0

func (r *Replicator) ReadDestinationInRemoteZone(ctx thrift.Context, getRequest *shared.ReadDestinationInRemoteZoneRequest) (*shared.DestinationDescription, error)

ReadDestinationInRemoteZone reads a destination in remote zone

func (*Replicator) RegisterWSHandler

func (r *Replicator) RegisterWSHandler() *http.ServeMux

RegisterWSHandler is the implementation of WSService interface

func (*Replicator) SetAckOffset added in v1.26.0

func (r *Replicator) SetAckOffset(ctx thrift.Context, request *shared.SetAckOffsetRequest) error

SetAckOffset updates ack offsets in local zone

func (*Replicator) SetAckOffsetInRemote added in v1.26.0

func (r *Replicator) SetAckOffsetInRemote(ctx thrift.Context, request *shared.SetAckOffsetRequest) error

SetAckOffsetInRemote updates ack offsets in remote zone

func (*Replicator) Start

func (r *Replicator) Start(thriftService []thrift.TChanServer)

Start starts the replicator service

func (*Replicator) Stop

func (r *Replicator) Stop()

Stop stops the service

func (*Replicator) UpdateConsumerGroup

func (r *Replicator) UpdateConsumerGroup(ctx thrift.Context, updateRequest *shared.UpdateConsumerGroupRequest) (*shared.ConsumerGroupDescription, error)

UpdateConsumerGroup updates consumer group at local zone, expect to be called by replicator from authoritative zone

func (*Replicator) UpdateDestination

func (r *Replicator) UpdateDestination(ctx thrift.Context, updateRequest *shared.UpdateDestinationRequest) (*shared.DestinationDescription, error)

UpdateDestination updates destination at local zone, expect to be called by replicator from authoritative zone

func (*Replicator) UpdateRemoteConsumerGroup

func (r *Replicator) UpdateRemoteConsumerGroup(ctx thrift.Context, updateRequest *shared.UpdateConsumerGroupRequest) error

UpdateRemoteConsumerGroup propagate update to multiple remote zones, expect to be called only in authoritative zone

func (*Replicator) UpdateRemoteDestination

func (r *Replicator) UpdateRemoteDestination(ctx thrift.Context, updateRequest *shared.UpdateDestinationRequest) error

UpdateRemoteDestination propagates update to multiple remote zones, expect to be called only in authoritative zone

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL