multiraftpb

package
v3.0.0-...-c8eabd8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_multiraft_proto protoreflect.FileDescriptor
View Source
var NodehostAPI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "multiraftpb.NodehostAPI",
	HandlerType: (*NodehostAPIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSession",
			Handler:    _NodehostAPI_GetSession_Handler,
		},
		{
			MethodName: "CloseSession",
			Handler:    _NodehostAPI_CloseSession_Handler,
		},
		{
			MethodName: "Propose",
			Handler:    _NodehostAPI_Propose_Handler,
		},
		{
			MethodName: "Read",
			Handler:    _NodehostAPI_Read_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "multiraft.proto",
}

NodehostAPI_ServiceDesc is the grpc.ServiceDesc for NodehostAPI service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterNodehostAPIServer

func RegisterNodehostAPIServer(s grpc.ServiceRegistrar, srv NodehostAPIServer)

Types

type NodehostAPIClient

type NodehostAPIClient interface {
	// GetSession returns a new Session object ready to be used for
	// making new proposals.
	GetSession(ctx context.Context, in *SessionRequest, opts ...grpc.CallOption) (*Session, error)
	// CloseSession closes the specified Session object and removes
	// it from the associated Raft cluster. The Completed boolean field in
	// the returned SessionResponse object indicates whether the
	// Session object is successfully closed.
	CloseSession(ctx context.Context, in *Session, opts ...grpc.CallOption) (*SessionResponse, error)
	// Propose makes a proposal. When there is no error, the Result field of the
	// returned RaftResponse is the uint64 value returned by the Update function
	// of the associated IDataStore instance.
	Propose(ctx context.Context, in *RaftProposal, opts ...grpc.CallOption) (*RaftResponse, error)
	// Read makes a new linearizable read on the specified cluster. When there is
	// no error, the Data field of the returned RaftResponse is the returned
	// query result generated by the Lookup function of the associated IDataStore
	// instance.
	Read(ctx context.Context, in *RaftReadIndex, opts ...grpc.CallOption) (*RaftResponse, error)
}

NodehostAPIClient is the client API for NodehostAPI 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 NodehostAPIServer

type NodehostAPIServer interface {
	// GetSession returns a new Session object ready to be used for
	// making new proposals.
	GetSession(context.Context, *SessionRequest) (*Session, error)
	// CloseSession closes the specified Session object and removes
	// it from the associated Raft cluster. The Completed boolean field in
	// the returned SessionResponse object indicates whether the
	// Session object is successfully closed.
	CloseSession(context.Context, *Session) (*SessionResponse, error)
	// Propose makes a proposal. When there is no error, the Result field of the
	// returned RaftResponse is the uint64 value returned by the Update function
	// of the associated IDataStore instance.
	Propose(context.Context, *RaftProposal) (*RaftResponse, error)
	// Read makes a new linearizable read on the specified cluster. When there is
	// no error, the Data field of the returned RaftResponse is the returned
	// query result generated by the Lookup function of the associated IDataStore
	// instance.
	Read(context.Context, *RaftReadIndex) (*RaftResponse, error)
	// contains filtered or unexported methods
}

NodehostAPIServer is the server API for NodehostAPI service. All implementations must embed UnimplementedNodehostAPIServer for forward compatibility

type RaftProposal

type RaftProposal struct {
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	Data    []byte   `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

RaftProposal is the message used to describe the proposal to be made on the selected raft cluster.

func (*RaftProposal) Descriptor deprecated

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

Deprecated: Use RaftProposal.ProtoReflect.Descriptor instead.

func (*RaftProposal) GetData

func (x *RaftProposal) GetData() []byte

func (*RaftProposal) GetSession

func (x *RaftProposal) GetSession() *Session

func (*RaftProposal) ProtoMessage

func (*RaftProposal) ProtoMessage()

func (*RaftProposal) ProtoReflect

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

func (*RaftProposal) Reset

func (x *RaftProposal) Reset()

func (*RaftProposal) String

func (x *RaftProposal) String() string

type RaftReadIndex

type RaftReadIndex struct {
	ShardId uint64 `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
	Data    []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

RaftReadIndex is the message used to describe the input to the ReadIndex protocol. The ReadIndex protocol is used for making linearizable read on the selected raft cluster.

func (*RaftReadIndex) Descriptor deprecated

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

Deprecated: Use RaftReadIndex.ProtoReflect.Descriptor instead.

func (*RaftReadIndex) GetData

func (x *RaftReadIndex) GetData() []byte

func (*RaftReadIndex) GetShardId

func (x *RaftReadIndex) GetShardId() uint64

func (*RaftReadIndex) ProtoMessage

func (*RaftReadIndex) ProtoMessage()

func (*RaftReadIndex) ProtoReflect

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

func (*RaftReadIndex) Reset

func (x *RaftReadIndex) Reset()

func (*RaftReadIndex) String

func (x *RaftReadIndex) String() string

type RaftResponse

type RaftResponse struct {
	Result uint64 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	Data   []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

RaftResponse is the message used to describe the response produced by the Update or Lookup function of the IDataStore instance.

func (*RaftResponse) Descriptor deprecated

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

Deprecated: Use RaftResponse.ProtoReflect.Descriptor instead.

func (*RaftResponse) GetData

func (x *RaftResponse) GetData() []byte

func (*RaftResponse) GetResult

func (x *RaftResponse) GetResult() uint64

func (*RaftResponse) ProtoMessage

func (*RaftResponse) ProtoMessage()

func (*RaftResponse) ProtoReflect

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

func (*RaftResponse) Reset

func (x *RaftResponse) Reset()

func (*RaftResponse) String

func (x *RaftResponse) String() string

type Session

type Session struct {
	ShardID     uint64 `protobuf:"varint,1,opt,name=ShardID,proto3" json:"ShardID,omitempty"`
	ClientID    uint64 `protobuf:"varint,2,opt,name=ClientID,proto3" json:"ClientID,omitempty"`
	SeriesID    uint64 `protobuf:"varint,3,opt,name=SeriesID,proto3" json:"SeriesID,omitempty"`
	RespondedTo uint64 `protobuf:"varint,4,opt,name=RespondedTo,proto3" json:"RespondedTo,omitempty"`
	// contains filtered or unexported fields
}

Session is the session object used to track proposals for the specified raft cluster. SeriesID is a sequential id used to identify proposals, RespondedTo is a sequential id used to track the last responded proposal.

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetClientID

func (x *Session) GetClientID() uint64

func (*Session) GetRespondedTo

func (x *Session) GetRespondedTo() uint64

func (*Session) GetSeriesID

func (x *Session) GetSeriesID() uint64

func (*Session) GetShardID

func (x *Session) GetShardID() uint64

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type SessionRequest

type SessionRequest struct {
	ShardId uint64 `protobuf:"varint,1,opt,name=shard_id,json=shardId,proto3" json:"shard_id,omitempty"`
	// contains filtered or unexported fields
}

SessionRequest is the message used to specified the interested raft cluster.

func (*SessionRequest) Descriptor deprecated

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

Deprecated: Use SessionRequest.ProtoReflect.Descriptor instead.

func (*SessionRequest) GetShardId

func (x *SessionRequest) GetShardId() uint64

func (*SessionRequest) ProtoMessage

func (*SessionRequest) ProtoMessage()

func (*SessionRequest) ProtoReflect

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

func (*SessionRequest) Reset

func (x *SessionRequest) Reset()

func (*SessionRequest) String

func (x *SessionRequest) String() string

type SessionResponse

type SessionResponse struct {
	Completed bool `protobuf:"varint,1,opt,name=completed,proto3" json:"completed,omitempty"`
	// contains filtered or unexported fields
}

SessionResponse is the message used to indicate whether the Session object is successfully closed.

func (*SessionResponse) Descriptor deprecated

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

Deprecated: Use SessionResponse.ProtoReflect.Descriptor instead.

func (*SessionResponse) GetCompleted

func (x *SessionResponse) GetCompleted() bool

func (*SessionResponse) ProtoMessage

func (*SessionResponse) ProtoMessage()

func (*SessionResponse) ProtoReflect

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

func (*SessionResponse) Reset

func (x *SessionResponse) Reset()

func (*SessionResponse) String

func (x *SessionResponse) String() string

type UnimplementedNodehostAPIServer

type UnimplementedNodehostAPIServer struct {
}

UnimplementedNodehostAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedNodehostAPIServer) CloseSession

func (UnimplementedNodehostAPIServer) GetSession

func (UnimplementedNodehostAPIServer) Propose

func (UnimplementedNodehostAPIServer) Read

type UnsafeNodehostAPIServer

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

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

Jump to

Keyboard shortcuts

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