Documentation
¶
Index ¶
- Variables
- func RegisterChordServer(s *grpc.Server, srv ChordServer)
- type ChordClient
- type ChordServer
- type CoordinatorMsg
- func (*CoordinatorMsg) Descriptor() ([]byte, []int)deprecated
- func (x *CoordinatorMsg) GetNewLeaderId() []byte
- func (x *CoordinatorMsg) GetOldLeaderId() []byte
- func (*CoordinatorMsg) ProtoMessage()
- func (x *CoordinatorMsg) ProtoReflect() protoreflect.Message
- func (x *CoordinatorMsg) Reset()
- func (x *CoordinatorMsg) String() string
- type Empty
- type KV
- type KVs
- type Key
- type Node
- type PeerID
- type ReplicaMsg
- type SuccessorList
- type UnimplementedChordServer
- func (*UnimplementedChordServer) CheckPredecessor(context.Context, *Empty) (*Empty, error)
- func (*UnimplementedChordServer) FindSuccessor(context.Context, *PeerID) (*Node, error)
- func (*UnimplementedChordServer) Get(context.Context, *Key) (*Value, error)
- func (*UnimplementedChordServer) GetKeys(context.Context, *PeerID) (*KVs, error)
- func (*UnimplementedChordServer) GetPredecessor(context.Context, *Empty) (*Node, error)
- func (*UnimplementedChordServer) GetSuccessorList(context.Context, *Empty) (*SuccessorList, error)
- func (*UnimplementedChordServer) Locate(context.Context, *Key) (*Node, error)
- func (*UnimplementedChordServer) Notify(context.Context, *Node) (*Empty, error)
- func (*UnimplementedChordServer) Put(context.Context, *KV) (*Empty, error)
- func (*UnimplementedChordServer) RecvCoordinatorMsg(context.Context, *CoordinatorMsg) (*Empty, error)
- func (*UnimplementedChordServer) RemoveReplicas(context.Context, *ReplicaMsg) (*Empty, error)
- func (*UnimplementedChordServer) SendReplicas(context.Context, *ReplicaMsg) (*Empty, error)
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var File_github_com_cdesiniotis_chord_chordpb_chord_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChordServer ¶
func RegisterChordServer(s *grpc.Server, srv ChordServer)
Types ¶
type ChordClient ¶
type ChordClient interface { // Find the successor of the given ID FindSuccessor(ctx context.Context, in *PeerID, opts ...grpc.CallOption) (*Node, error) // Get the current predecessor of a node GetPredecessor(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Node, error) // A Node thinks it is our predecessor and it is notifying us! Notify(ctx context.Context, in *Node, opts ...grpc.CallOption) (*Empty, error) // Check if predecessor is still alive CheckPredecessor(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) // Get successor list of a node GetSuccessorList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SuccessorList, error) // Receive coordinator messages from nodes who are the cooridinators // for replica groups around the chord ring RecvCoordinatorMsg(ctx context.Context, in *CoordinatorMsg, opts ...grpc.CallOption) (*Empty, error) // Get keys we are responsible for from a node (typically a new node calls this on their successor) GetKeys(ctx context.Context, in *PeerID, opts ...grpc.CallOption) (*KVs, error) // Receive replica KV pairs from the leader of the replica group SendReplicas(ctx context.Context, in *ReplicaMsg, opts ...grpc.CallOption) (*Empty, error) // Remove replica KV pairs RemoveReplicas(ctx context.Context, in *ReplicaMsg, opts ...grpc.CallOption) (*Empty, error) // Get a value Get(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Value, error) // Create a new key-value pair Put(ctx context.Context, in *KV, opts ...grpc.CallOption) (*Empty, error) // Locate the node containing a key Locate(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Node, error) }
ChordClient is the client API for Chord service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewChordClient ¶
func NewChordClient(cc grpc.ClientConnInterface) ChordClient
type ChordServer ¶
type ChordServer interface { // Find the successor of the given ID FindSuccessor(context.Context, *PeerID) (*Node, error) // Get the current predecessor of a node GetPredecessor(context.Context, *Empty) (*Node, error) // A Node thinks it is our predecessor and it is notifying us! Notify(context.Context, *Node) (*Empty, error) // Check if predecessor is still alive CheckPredecessor(context.Context, *Empty) (*Empty, error) // Get successor list of a node GetSuccessorList(context.Context, *Empty) (*SuccessorList, error) // Receive coordinator messages from nodes who are the cooridinators // for replica groups around the chord ring RecvCoordinatorMsg(context.Context, *CoordinatorMsg) (*Empty, error) // Get keys we are responsible for from a node (typically a new node calls this on their successor) GetKeys(context.Context, *PeerID) (*KVs, error) // Receive replica KV pairs from the leader of the replica group SendReplicas(context.Context, *ReplicaMsg) (*Empty, error) // Remove replica KV pairs RemoveReplicas(context.Context, *ReplicaMsg) (*Empty, error) // Get a value Get(context.Context, *Key) (*Value, error) // Create a new key-value pair Put(context.Context, *KV) (*Empty, error) // Locate the node containing a key Locate(context.Context, *Key) (*Node, error) }
ChordServer is the server API for Chord service.
type CoordinatorMsg ¶
type CoordinatorMsg struct { OldLeaderId []byte `protobuf:"bytes,1,opt,name=oldLeaderId,proto3" json:"oldLeaderId,omitempty"` NewLeaderId []byte `protobuf:"bytes,2,opt,name=newLeaderId,proto3" json:"newLeaderId,omitempty"` // contains filtered or unexported fields }
func (*CoordinatorMsg) Descriptor
deprecated
func (*CoordinatorMsg) Descriptor() ([]byte, []int)
Deprecated: Use CoordinatorMsg.ProtoReflect.Descriptor instead.
func (*CoordinatorMsg) GetNewLeaderId ¶
func (x *CoordinatorMsg) GetNewLeaderId() []byte
func (*CoordinatorMsg) GetOldLeaderId ¶
func (x *CoordinatorMsg) GetOldLeaderId() []byte
func (*CoordinatorMsg) ProtoMessage ¶
func (*CoordinatorMsg) ProtoMessage()
func (*CoordinatorMsg) ProtoReflect ¶
func (x *CoordinatorMsg) ProtoReflect() protoreflect.Message
func (*CoordinatorMsg) Reset ¶
func (x *CoordinatorMsg) Reset()
func (*CoordinatorMsg) String ¶
func (x *CoordinatorMsg) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type KV ¶
type KV struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*KV) Descriptor
deprecated
func (*KV) ProtoMessage ¶
func (*KV) ProtoMessage()
func (*KV) ProtoReflect ¶
func (x *KV) ProtoReflect() protoreflect.Message
type KVs ¶
type KVs struct { Kvs []*KV `protobuf:"bytes,1,rep,name=kvs,proto3" json:"kvs,omitempty"` // contains filtered or unexported fields }
func (*KVs) Descriptor
deprecated
func (*KVs) ProtoMessage ¶
func (*KVs) ProtoMessage()
func (*KVs) ProtoReflect ¶
func (x *KVs) ProtoReflect() protoreflect.Message
type Key ¶
type Key struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // contains filtered or unexported fields }
func (*Key) Descriptor
deprecated
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) ProtoReflect ¶
func (x *Key) ProtoReflect() protoreflect.Message
type Node ¶
type Node struct { Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` // contains filtered or unexported fields }
func (*Node) Descriptor
deprecated
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
type PeerID ¶
type PeerID struct { Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*PeerID) Descriptor
deprecated
func (*PeerID) ProtoMessage ¶
func (*PeerID) ProtoMessage()
func (*PeerID) ProtoReflect ¶
func (x *PeerID) ProtoReflect() protoreflect.Message
type ReplicaMsg ¶
type ReplicaMsg struct { LeaderId []byte `protobuf:"bytes,1,opt,name=leaderId,proto3" json:"leaderId,omitempty"` Kv []*KV `protobuf:"bytes,2,rep,name=kv,proto3" json:"kv,omitempty"` // contains filtered or unexported fields }
func (*ReplicaMsg) Descriptor
deprecated
func (*ReplicaMsg) Descriptor() ([]byte, []int)
Deprecated: Use ReplicaMsg.ProtoReflect.Descriptor instead.
func (*ReplicaMsg) GetKv ¶
func (x *ReplicaMsg) GetKv() []*KV
func (*ReplicaMsg) GetLeaderId ¶
func (x *ReplicaMsg) GetLeaderId() []byte
func (*ReplicaMsg) ProtoMessage ¶
func (*ReplicaMsg) ProtoMessage()
func (*ReplicaMsg) ProtoReflect ¶
func (x *ReplicaMsg) ProtoReflect() protoreflect.Message
func (*ReplicaMsg) Reset ¶
func (x *ReplicaMsg) Reset()
func (*ReplicaMsg) String ¶
func (x *ReplicaMsg) String() string
type SuccessorList ¶
type SuccessorList struct { Successors []*Node `protobuf:"bytes,1,rep,name=successors,proto3" json:"successors,omitempty"` // contains filtered or unexported fields }
func (*SuccessorList) Descriptor
deprecated
func (*SuccessorList) Descriptor() ([]byte, []int)
Deprecated: Use SuccessorList.ProtoReflect.Descriptor instead.
func (*SuccessorList) GetSuccessors ¶
func (x *SuccessorList) GetSuccessors() []*Node
func (*SuccessorList) ProtoMessage ¶
func (*SuccessorList) ProtoMessage()
func (*SuccessorList) ProtoReflect ¶
func (x *SuccessorList) ProtoReflect() protoreflect.Message
func (*SuccessorList) Reset ¶
func (x *SuccessorList) Reset()
func (*SuccessorList) String ¶
func (x *SuccessorList) String() string
type UnimplementedChordServer ¶
type UnimplementedChordServer struct { }
UnimplementedChordServer can be embedded to have forward compatible implementations.
func (*UnimplementedChordServer) CheckPredecessor ¶
func (*UnimplementedChordServer) FindSuccessor ¶
func (*UnimplementedChordServer) GetPredecessor ¶
func (*UnimplementedChordServer) GetSuccessorList ¶
func (*UnimplementedChordServer) GetSuccessorList(context.Context, *Empty) (*SuccessorList, error)
func (*UnimplementedChordServer) RecvCoordinatorMsg ¶
func (*UnimplementedChordServer) RecvCoordinatorMsg(context.Context, *CoordinatorMsg) (*Empty, error)
func (*UnimplementedChordServer) RemoveReplicas ¶
func (*UnimplementedChordServer) RemoveReplicas(context.Context, *ReplicaMsg) (*Empty, error)
func (*UnimplementedChordServer) SendReplicas ¶
func (*UnimplementedChordServer) SendReplicas(context.Context, *ReplicaMsg) (*Empty, error)
type Value ¶
type Value struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Value) Descriptor
deprecated
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.