chordpb

package
v0.0.0-...-1fed3d5 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use KV.ProtoReflect.Descriptor instead.

func (*KV) GetKey

func (x *KV) GetKey() string

func (*KV) GetValue

func (x *KV) GetValue() []byte

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) ProtoReflect

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

func (*KV) Reset

func (x *KV) Reset()

func (*KV) String

func (x *KV) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use KVs.ProtoReflect.Descriptor instead.

func (*KVs) GetKvs

func (x *KVs) GetKvs() []*KV

func (*KVs) ProtoMessage

func (*KVs) ProtoMessage()

func (*KVs) ProtoReflect

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

func (*KVs) Reset

func (x *KVs) Reset()

func (*KVs) String

func (x *KVs) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Key.ProtoReflect.Descriptor instead.

func (*Key) GetKey

func (x *Key) GetKey() string

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) ProtoReflect

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

func (*Key) Reset

func (x *Key) Reset()

func (*Key) String

func (x *Key) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetAddr

func (x *Node) GetAddr() string

func (*Node) GetId

func (x *Node) GetId() []byte

func (*Node) GetPort

func (x *Node) GetPort() uint32

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

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

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use PeerID.ProtoReflect.Descriptor instead.

func (*PeerID) GetId

func (x *PeerID) GetId() []byte

func (*PeerID) ProtoMessage

func (*PeerID) ProtoMessage()

func (*PeerID) ProtoReflect

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

func (*PeerID) Reset

func (x *PeerID) Reset()

func (*PeerID) String

func (x *PeerID) String() string

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) CheckPredecessor(context.Context, *Empty) (*Empty, error)

func (*UnimplementedChordServer) FindSuccessor

func (*UnimplementedChordServer) FindSuccessor(context.Context, *PeerID) (*Node, error)

func (*UnimplementedChordServer) Get

func (*UnimplementedChordServer) GetKeys

func (*UnimplementedChordServer) GetPredecessor

func (*UnimplementedChordServer) GetPredecessor(context.Context, *Empty) (*Node, error)

func (*UnimplementedChordServer) GetSuccessorList

func (*UnimplementedChordServer) Locate

func (*UnimplementedChordServer) Notify

func (*UnimplementedChordServer) Put

func (*UnimplementedChordServer) RecvCoordinatorMsg

func (*UnimplementedChordServer) RemoveReplicas

func (*UnimplementedChordServer) SendReplicas

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) Descriptor() ([]byte, []int)

Deprecated: Use Value.ProtoReflect.Descriptor instead.

func (*Value) GetValue

func (x *Value) GetValue() []byte

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) ProtoReflect

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

func (*Value) Reset

func (x *Value) Reset()

func (*Value) String

func (x *Value) String() string

Jump to

Keyboard shortcuts

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