Documentation
¶
Index ¶
- Variables
- func RegisterReplicationServer(s grpc.ServiceRegistrar, srv ReplicationServer)
- type ReplicationClient
- type ReplicationServer
- type Replication_GossipClient
- type Replication_GossipServer
- type Sync
- type Sync_Status
- func (Sync_Status) Descriptor() protoreflect.EnumDescriptor
- func (x Sync_Status) Enum() *Sync_Status
- func (Sync_Status) EnumDescriptor() ([]byte, []int)deprecated
- func (x Sync_Status) Number() protoreflect.EnumNumber
- func (x Sync_Status) String() string
- func (Sync_Status) Type() protoreflect.EnumType
- type UnimplementedReplicationServer
- type UnsafeReplicationServer
Constants ¶
This section is empty.
Variables ¶
var ( Sync_Status_name = map[int32]string{ 0: "UNKNOWN", 1: "CHECK", 2: "REPAIR", 3: "COMPLETE", 4: "ERROR", } Sync_Status_value = map[string]int32{ "UNKNOWN": 0, "CHECK": 1, "REPAIR": 2, "COMPLETE": 3, "ERROR": 4, } )
Enum value maps for Sync_Status.
var File_replica_v1_replica_proto protoreflect.FileDescriptor
var Replication_ServiceDesc = grpc.ServiceDesc{ ServiceName: "honu.replica.v1.Replication", HandlerType: (*ReplicationServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Gossip", Handler: _Replication_Gossip_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "replica/v1/replica.proto", }
Replication_ServiceDesc is the grpc.ServiceDesc for Replication service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterReplicationServer ¶
func RegisterReplicationServer(s grpc.ServiceRegistrar, srv ReplicationServer)
Types ¶
type ReplicationClient ¶
type ReplicationClient interface {
// Gossip implements biltateral anti-entropy: during a Gossip session the initiating
// replica pushes updates to the remote peer and pulls requested changes. Using
// bidirectional streaming, the initiating peer sends data-less sync messages with
// the versions of objects it stores locally. The remote replica then responds with
// data if its local version is later or sends a sync message back requesting the
// data from the initating replica if its local version is earlier (no exchange)
// occurs if both replicas have the same version. At the end of a gossip session,
// both replicas should have synchronized and have identical underlying data stores.
Gossip(ctx context.Context, opts ...grpc.CallOption) (Replication_GossipClient, 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.
func NewReplicationClient ¶
func NewReplicationClient(cc grpc.ClientConnInterface) ReplicationClient
type ReplicationServer ¶
type ReplicationServer interface {
// Gossip implements biltateral anti-entropy: during a Gossip session the initiating
// replica pushes updates to the remote peer and pulls requested changes. Using
// bidirectional streaming, the initiating peer sends data-less sync messages with
// the versions of objects it stores locally. The remote replica then responds with
// data if its local version is later or sends a sync message back requesting the
// data from the initating replica if its local version is earlier (no exchange)
// occurs if both replicas have the same version. At the end of a gossip session,
// both replicas should have synchronized and have identical underlying data stores.
Gossip(Replication_GossipServer) error
// contains filtered or unexported methods
}
ReplicationServer is the server API for Replication service. All implementations must embed UnimplementedReplicationServer for forward compatibility
type Replication_GossipClient ¶ added in v0.2.6
type Replication_GossipServer ¶ added in v0.2.6
type Sync ¶ added in v0.2.6
type Sync struct {
Status Sync_Status `protobuf:"varint,1,opt,name=status,proto3,enum=honu.replica.v1.Sync_Status" json:"status,omitempty"` // The status/type of sync messages
Object *object.Object `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` // The object being synchronized
Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` // Error information if the object failed to sync
// contains filtered or unexported fields
}
Sync messages allow replicas to exchange information in a bidirectional stream. Because Sync messages are sent in the stream, there are different synchronization types. A "check" synchronization sends only the version vector without data, requesting the remote peer to check if they have a later version, and if so, return it. A "repair" synchronization sends object data back if the sender's version is later. A "complete" synchronization indicates that the sender is fully synchronized, and an "error" synchronization message says that there was some failure repairing the specified version vector.
func (*Sync) Descriptor
deprecated
added in
v0.2.6
func (*Sync) GetStatus ¶ added in v0.2.6
func (x *Sync) GetStatus() Sync_Status
func (*Sync) ProtoMessage ¶ added in v0.2.6
func (*Sync) ProtoMessage()
func (*Sync) ProtoReflect ¶ added in v0.2.6
func (x *Sync) ProtoReflect() protoreflect.Message
type Sync_Status ¶ added in v0.2.6
type Sync_Status int32
Status indicates what state the synchronization is in between peers, allowing the replicas to coordinate between multiple sync messages in a grpc stream.
const ( Sync_UNKNOWN Sync_Status = 0 // Should not be used as a status Sync_CHECK Sync_Status = 1 // Sync contains version information only Sync_REPAIR Sync_Status = 2 // Sync contains object data information Sync_COMPLETE Sync_Status = 3 // Sync contains no object information, ready to end Gossip Sync_ERROR Sync_Status = 4 // Sync contains object-specific error information )
func (Sync_Status) Descriptor ¶ added in v0.2.6
func (Sync_Status) Descriptor() protoreflect.EnumDescriptor
func (Sync_Status) Enum ¶ added in v0.2.6
func (x Sync_Status) Enum() *Sync_Status
func (Sync_Status) EnumDescriptor
deprecated
added in
v0.2.6
func (Sync_Status) EnumDescriptor() ([]byte, []int)
Deprecated: Use Sync_Status.Descriptor instead.
func (Sync_Status) Number ¶ added in v0.2.6
func (x Sync_Status) Number() protoreflect.EnumNumber
func (Sync_Status) String ¶ added in v0.2.6
func (x Sync_Status) String() string
func (Sync_Status) Type ¶ added in v0.2.6
func (Sync_Status) Type() protoreflect.EnumType
type UnimplementedReplicationServer ¶
type UnimplementedReplicationServer struct {
}
UnimplementedReplicationServer must be embedded to have forward compatible implementations.
func (UnimplementedReplicationServer) Gossip ¶
func (UnimplementedReplicationServer) Gossip(Replication_GossipServer) error
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.