Documentation ¶
Index ¶
- type ClientFactory
- type MetadataReconciler
- type Replicator
- func (r *Replicator) CreateConsumerGroupUUID(ctx thrift.Context, createRequest *shared.CreateConsumerGroupUUIDRequest) (*shared.ConsumerGroupDescription, error)
- func (r *Replicator) CreateDestinationUUID(ctx thrift.Context, createRequest *shared.CreateDestinationUUIDRequest) (*shared.DestinationDescription, error)
- func (r *Replicator) CreateExtent(ctx thrift.Context, createRequest *shared.CreateExtentRequest) (*shared.CreateExtentResult_, error)
- func (r *Replicator) CreateRemoteConsumerGroupUUID(ctx thrift.Context, createRequest *shared.CreateConsumerGroupUUIDRequest) error
- func (r *Replicator) CreateRemoteDestinationUUID(ctx thrift.Context, createRequest *shared.CreateDestinationUUIDRequest) error
- func (r *Replicator) CreateRemoteExtent(ctx thrift.Context, createRequest *shared.CreateExtentRequest) error
- func (r *Replicator) DeleteConsumerGroup(ctx thrift.Context, deleteRequest *shared.DeleteConsumerGroupRequest) error
- func (r *Replicator) DeleteDestination(ctx thrift.Context, deleteRequest *shared.DeleteDestinationRequest) error
- func (r *Replicator) DeleteRemoteConsumerGroup(ctx thrift.Context, deleteRequest *shared.DeleteConsumerGroupRequest) error
- func (r *Replicator) DeleteRemoteDestination(ctx thrift.Context, deleteRequest *shared.DeleteDestinationRequest) error
- func (r *Replicator) ListDestinations(ctx thrift.Context, listRequest *shared.ListDestinationsRequest) (*shared.ListDestinationsResult_, error)
- func (r *Replicator) ListDestinationsByUUID(ctx thrift.Context, listRequest *shared.ListDestinationsByUUIDRequest) (*shared.ListDestinationsResult_, error)
- func (r *Replicator) ListExtentsStats(ctx thrift.Context, listRequest *shared.ListExtentsStatsRequest) (*shared.ListExtentsStatsResult_, error)
- func (r *Replicator) OpenReplicationReadStreamHandler(w http.ResponseWriter, req *http.Request)
- func (r *Replicator) OpenReplicationRemoteReadStreamHandler(w http.ResponseWriter, req *http.Request)
- func (r *Replicator) RegisterWSHandler() *http.ServeMux
- func (r *Replicator) Start(thriftService []thrift.TChanServer)
- func (r *Replicator) Stop()
- func (r *Replicator) UpdateConsumerGroup(ctx thrift.Context, updateRequest *shared.UpdateConsumerGroupRequest) (*shared.ConsumerGroupDescription, error)
- func (r *Replicator) UpdateDestination(ctx thrift.Context, updateRequest *shared.UpdateDestinationRequest) (*shared.DestinationDescription, error)
- func (r *Replicator) UpdateRemoteConsumerGroup(ctx thrift.Context, updateRequest *shared.UpdateConsumerGroupRequest) error
- func (r *Replicator) UpdateRemoteDestination(ctx thrift.Context, updateRequest *shared.UpdateDestinationRequest) error
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) }
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) ClientFactory
NewReplicatorClientFactory instantiates a ReplicatorClientFactory object
type MetadataReconciler ¶
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, clientFactory ClientFactory, config configure.CommonAppConfig) (*Replicator, []thrift.TChanServer)
NewReplicator is the constructor for 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 remote replicator
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 remote replicator
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) CreateRemoteConsumerGroupUUID ¶
func (r *Replicator) CreateRemoteConsumerGroupUUID(ctx thrift.Context, createRequest *shared.CreateConsumerGroupUUIDRequest) error
CreateRemoteConsumerGroupUUID propagate creation to multiple remote zones, expect to be called by local zone services
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 by local zone services
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 remote replicator
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 remote replicator
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 by local zone services
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 by local zone services
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) RegisterWSHandler ¶
func (r *Replicator) RegisterWSHandler() *http.ServeMux
RegisterWSHandler is the implementation of WSService interface
func (*Replicator) Start ¶
func (r *Replicator) Start(thriftService []thrift.TChanServer)
Start starts the replicator 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 remote replicator
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 remote replicator
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 by local zone services
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 by local zone services