replica

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_replica_v1_replica_proto protoreflect.FileDescriptor

Functions

func RegisterReplicationServer

func RegisterReplicationServer(s grpc.ServiceRegistrar, srv ReplicationServer)

Types

type ReplicationClient

type ReplicationClient interface {
	// During gossip, the initiating replica sends a randomly selected remote peer the
	// version vectors of all objects it currently stores. The remote peer should
	// respond with updates that correspond to more recent versions of the objects. The
	// remote peer can than also make a reciprocal request for updates by sending the
	// set of versions requested that were more recent on the initiating replica, and
	// use a partial flag to indicate that it is requesting specific versions. This
	// mechanism implements bilateral anti-entropy: a push and pull gossip.
	Gossip(ctx context.Context, in *VersionVectors, opts ...grpc.CallOption) (*Updates, error)
}

ReplicationClient is the client API for Replication service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type ReplicationServer

type ReplicationServer interface {
	// During gossip, the initiating replica sends a randomly selected remote peer the
	// version vectors of all objects it currently stores. The remote peer should
	// respond with updates that correspond to more recent versions of the objects. The
	// remote peer can than also make a reciprocal request for updates by sending the
	// set of versions requested that were more recent on the initiating replica, and
	// use a partial flag to indicate that it is requesting specific versions. This
	// mechanism implements bilateral anti-entropy: a push and pull gossip.
	Gossip(context.Context, *VersionVectors) (*Updates, error)
	// contains filtered or unexported methods
}

ReplicationServer is the server API for Replication service. All implementations must embed UnimplementedReplicationServer for forward compatibility

type UnimplementedReplicationServer

type UnimplementedReplicationServer struct {
}

UnimplementedReplicationServer must be embedded to have forward compatible implementations.

func (UnimplementedReplicationServer) Gossip

type UnsafeReplicationServer

type UnsafeReplicationServer interface {
	// contains filtered or unexported methods
}

UnsafeReplicationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ReplicationServer will result in compilation errors.

type Updates

type Updates struct {
	Objects []*object.Object `protobuf:"bytes,1,rep,name=objects,proto3" json:"objects,omitempty"`
	// contains filtered or unexported fields
}

Updates returns data to repair entropy (e.g. to repair the divergence caused by updates). Updates should only contain the objects that have later versions and the objects should have their data fields populated.

func (*Updates) Descriptor deprecated

func (*Updates) Descriptor() ([]byte, []int)

Deprecated: Use Updates.ProtoReflect.Descriptor instead.

func (*Updates) GetObjects

func (x *Updates) GetObjects() []*object.Object

func (*Updates) ProtoMessage

func (*Updates) ProtoMessage()

func (*Updates) ProtoReflect

func (x *Updates) ProtoReflect() protoreflect.Message

func (*Updates) Reset

func (x *Updates) Reset()

func (*Updates) String

func (x *Updates) String() string

type VersionVectors

type VersionVectors struct {

	// Version vectors of objects without data.
	Objects []*object.Object `protobuf:"bytes,1,rep,name=objects,proto3" json:"objects,omitempty"`
	// A request to consider only the objects specified in the version vector and not
	// the entire namespace (e.g. ignore objects that are not specified).
	Partial bool `protobuf:"varint,2,opt,name=partial,proto3" json:"partial,omitempty"`
	// Limit the comparison only to the specified namespace(s). If not set or empty,
	// then all namespaces are considered.
	Namespaces []string `protobuf:"bytes,3,rep,name=namespaces,proto3" json:"namespaces,omitempty"`
	// contains filtered or unexported fields
}

VersionVectors initiate a Gossip RPC by passing along the current state of the namespace of objects on the initiating replica. Objects should not have data populated in this message, only metadata. If the partial flag is set, that indicates that the replica only wants to consider the objects described rather than the entire namespace (e.g. objects that may have been created outside the set of objects described). The partial flag is typically used as a mechanism to fetch specific objects that are known to be later from the remote replica. The namespaces array specifies which namespaces should be considered in gossip allowing for partial replication by namespace if necessary. If the namespaces array is empty, then all namespaces are considered during Gossip.

func (*VersionVectors) Descriptor deprecated

func (*VersionVectors) Descriptor() ([]byte, []int)

Deprecated: Use VersionVectors.ProtoReflect.Descriptor instead.

func (*VersionVectors) GetNamespaces

func (x *VersionVectors) GetNamespaces() []string

func (*VersionVectors) GetObjects

func (x *VersionVectors) GetObjects() []*object.Object

func (*VersionVectors) GetPartial

func (x *VersionVectors) GetPartial() bool

func (*VersionVectors) ProtoMessage

func (*VersionVectors) ProtoMessage()

func (*VersionVectors) ProtoReflect

func (x *VersionVectors) ProtoReflect() protoreflect.Message

func (*VersionVectors) Reset

func (x *VersionVectors) Reset()

func (*VersionVectors) String

func (x *VersionVectors) String() string

Jump to

Keyboard shortcuts

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