dynamic

package
v0.0.0-...-24eec3b Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package dynamic is a generated protocol buffer package.

It is generated from these files:

dynamicpaxos.proto

It has these top-level messages:

Command
Timestamp
PaxosProposeReq
PaxosProposeReply
FpProposeReq
FpProposeReply
ProbeReq
ProbeReply
ProbeTimeReply
ReplicaProbeReply
ReplicaMsg
EmptyReply
TestReq
TestReply

Index

Constants

View Source
const (
	INVALID_FP_IDX = -1
	INVALID_SHARD  = -1
)
View Source
const (
	REPLICA_MSG_HEART_BEAT         = 0
	REPLICA_MSG_PAXOS_ACCEPT_REQ   = 1
	REPLICA_MSG_PAXOS_ACCEPT_REPLY = 2
	REPLICA_MSG_PAXOS_COMMIT_REQ   = 3
	//REPLICA_MSG_PAXOS_COMMIT_REPLY = 4
	REPLICA_MSG_FP_VOTE         = 11
	REPLICA_MSG_FP_ACCEPT_REQ   = 12
	REPLICA_MSG_FP_ACCEPT_REPLY = 13
	REPLICA_MSG_FP_COMMIT_REQ   = 14
)

Message types for communications among replicas

View Source
const (
	ENTRY_STAT_COMMITTED         = 1
	ENTRY_STAT_LEADER_ACCEPTED   = 2
	ENTRY_STAT_ACCEPTOR_ACCEPTED = 3 // the fast path in Fast Paxos
)
View Source
const (
	Msg_Type_PaxosProposeReq uint8 = iota
	Msg_Type_PaxosProposeReply
	Msg_Type_FpProposeReq
	Msg_Type_FpProposeReply
	Msg_Type_ReplicaMsg
	//Msg_Type_EmptyReply
	Msg_Type_TestReq
	Msg_Type_TestReply
)
View Source
const (
	DEFAULT_CHANNEL_BUFFER_SIZE = 10240 * 8
)
View Source
const (
	// Time to wait for other servers to init before sending the first heart beat
	DEFAULT_FIRST_HEART_BEAT_DELAY = 5 * 1000 * 1000 * 1000 // ns
)
View Source
const (
	DEFAULT_PAXOS_LOG_INIT_SIZE = 1024 * 32
)
View Source
const (
	NO_OP_ID = "NO_OP_ID"
)

Variables

This section is empty.

Functions

func CompareTime

func CompareTime(t1, t2 *Timestamp) int

Returns 0 if t1 == t2 Returns -1 if t1 < t2 Returns 1 if t1 > t2

func RegisterDynamicPaxosServer

func RegisterDynamicPaxosServer(s *grpc.Server, srv DynamicPaxosServer)

Types

type Client

type Client interface {
	// Returns isCommitted, the accepted time slot, execRet
	PaxosPropose(c *Command, leader string) (bool, string)

	// Returns isCommitted, isFast, the accepted time slot, execRet
	FastPaxosPropose(
		c *Command, shard int32, leader string, followerList []string, t int64,
	) (bool, bool, string)

	// Fast Paxos all leaners, for reducing execution latency
	ExecFastPaxosPropose(
		c *Command, shard int32, leader, execReplica string, replicaList []string, t int64,
	) (bool, bool, string)

	// Latency monitoring
	// Returns the queuing delay in ns and Paxos latency in ms
	Probe(addr string) (int64, int32)
	ProbeTime(addr string) (int64, int32)

	InitConn(addrList []string)

	// Shuts down
	Close()

	// Testing
	Test(addrList []string)
}

func NewDynamicClient

func NewDynamicClient(
	replicaNum, fastQuorum int,
	isWaitExec, isFpLeaderUsePaxos, isGrpc bool,
) Client

type ClientFastIo

type ClientFastIo struct {
	// contains filtered or unexported fields
}

func (*ClientFastIo) BcstFpProposeToFollowers

func (fIo *ClientFastIo) BcstFpProposeToFollowers(
	addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, wg *sync.WaitGroup,
)

Non-blocking

func (*ClientFastIo) InitConn

func (fIo *ClientFastIo) InitConn(addrList []string)

func (*ClientFastIo) SendFpProposeToExecReplica

func (io *ClientFastIo) SendFpProposeToExecReplica(
	addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup,
)

Non-blocking

func (*ClientFastIo) SendFpProposeToLeader

func (fIo *ClientFastIo) SendFpProposeToLeader(
	leader string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup,
)

Non-blocking

func (*ClientFastIo) SendPaxosProposeReq

func (fIo *ClientFastIo) SendPaxosProposeReq(addr string, cmd *Command) *PaxosProposeReply

Blocking

func (*ClientFastIo) SendProbeReq

func (fIo *ClientFastIo) SendProbeReq(addr string) *ProbeReply

func (*ClientFastIo) SendProbeTimeReq

func (fIo *ClientFastIo) SendProbeTimeReq(addr string) *ProbeTimeReply

func (*ClientFastIo) SendTestReq

func (fIo *ClientFastIo) SendTestReq(addr string)

type ClientGrpc

type ClientGrpc struct {
	// contains filtered or unexported fields
}

func (*ClientGrpc) BcstFpProposeToFollowers

func (gIo *ClientGrpc) BcstFpProposeToFollowers(
	addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, wg *sync.WaitGroup,
)

Non-blocking

func (*ClientGrpc) InitConn

func (gIo *ClientGrpc) InitConn(addrList []string)

func (*ClientGrpc) SendFpProposeToExecReplica

func (gIo *ClientGrpc) SendFpProposeToExecReplica(
	addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup,
)

Non-blocking

func (*ClientGrpc) SendFpProposeToLeader

func (gIo *ClientGrpc) SendFpProposeToLeader(
	leaderAddr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup,
)

Non-blocking

func (*ClientGrpc) SendPaxosProposeReq

func (gIo *ClientGrpc) SendPaxosProposeReq(
	addr string, cmd *Command,
) *PaxosProposeReply

func (*ClientGrpc) SendProbeReq

func (gIo *ClientGrpc) SendProbeReq(addr string) *ProbeReply

//////// RPCs for clients ///////////////

func (*ClientGrpc) SendProbeTimeReq

func (gIo *ClientGrpc) SendProbeTimeReq(addr string) *ProbeTimeReply

func (*ClientGrpc) SendTestReq

func (gIo *ClientGrpc) SendTestReq(addr string)

Testing

type ClientIo

type ClientIo interface {
	InitConn(addrList []string)
	// Paxos, blocking RPC function
	SendPaxosProposeReq(addr string, cmd *Command) *PaxosProposeReply

	// Fast Paxos, non-blocking RPC functions
	BcstFpProposeToFollowers(addrList []string, req *FpProposeReq, fastC chan<- *FpProposeReply, wg *sync.WaitGroup)
	SendFpProposeToLeader(addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup)
	// Fast Paxos with all replicas as learners, non-blocking RPC functions
	SendFpProposeToExecReplica(addr string, req *FpProposeReq, fastC, slowC chan<- *FpProposeReply, wg *sync.WaitGroup)

	// Latency monitoring
	SendProbeReq(addr string) *ProbeReply
	SendProbeTimeReq(addr string) *ProbeTimeReply

	// Testing
	SendTestReq(addr string)
}

func NewClientFastIo

func NewClientFastIo(wg *sync.WaitGroup) ClientIo

func NewClientGrpc

func NewClientGrpc() ClientIo

type CmdEntry

type CmdEntry struct {
	Cmd    *Command
	T      *Timestamp
	Status int
}

func (*CmdEntry) GetCmd

func (e *CmdEntry) GetCmd() *Command

func (*CmdEntry) GetStatus

func (e *CmdEntry) GetStatus() int

func (*CmdEntry) GetT

func (e *CmdEntry) GetT() *Timestamp

func (*CmdEntry) SetStatus

func (e *CmdEntry) SetStatus(s int)

type CommManager

type CommManager struct {
	// contains filtered or unexported fields
}

Server communication table

func NewCommManager

func NewCommManager() *CommManager

func (*CommManager) BuildConnection

func (cm *CommManager) BuildConnection(addr string) *grpc.ClientConn

func (*CommManager) BuildRpcStub

func (cm *CommManager) BuildRpcStub(addr string) DynamicPaxosClient

Builds an RPC stub if not exists. Otherwise, returns the existing one

func (*CommManager) GetConnection

func (cm *CommManager) GetConnection(addr string) (*grpc.ClientConn, bool)

func (*CommManager) GetRpcStub

func (cm *CommManager) GetRpcStub(addr string) (DynamicPaxosClient, bool)

Returns the RPC stub on file

func (*CommManager) NewRpcStub

func (cm *CommManager) NewRpcStub(addr string) DynamicPaxosClient

type Command

type Command struct {
	Id   string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
	Key  string `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"`
	Val  string `protobuf:"bytes,4,opt,name=val" json:"val,omitempty"`
}

func (*Command) Descriptor

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

func (*Command) GetId

func (m *Command) GetId() string

func (*Command) GetKey

func (m *Command) GetKey() string

func (*Command) GetType

func (m *Command) GetType() string

func (*Command) GetVal

func (m *Command) GetVal() string

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) Reset

func (m *Command) Reset()

func (*Command) String

func (m *Command) String() string

type DynamicClient

type DynamicClient struct {

	// If the Fast Paxos leader uses Paxos to accept commonds that arerejected in
	// Fast Paxos instances
	IsFpLeaderUsePaxos bool
	// contains filtered or unexported fields
}

func (*DynamicClient) Close

func (c *DynamicClient) Close()

func (*DynamicClient) ExecFastPaxosPropose

func (c *DynamicClient) ExecFastPaxosPropose(
	cmd *Command, shard int32, leader, execReplica string, replicaList []string, t int64,
) (bool, bool, string)

func (*DynamicClient) FastPaxosPropose

func (c *DynamicClient) FastPaxosPropose(
	cmd *Command, shard int32, leader string, followerList []string, t int64,
) (bool, bool, string)

Proposes a command to the given Fast Paxos instance

func (*DynamicClient) InitConn

func (c *DynamicClient) InitConn(addrList []string)

func (*DynamicClient) PaxosPropose

func (c *DynamicClient) PaxosPropose(cmd *Command, addr string) (bool, string)

Proposes a command to the given Paxos instance

func (*DynamicClient) Probe

func (c *DynamicClient) Probe(addr string) (int64, int32)

Returns server-side queuing delay in ns

func (*DynamicClient) ProbeTime

func (c *DynamicClient) ProbeTime(addr string) (int64, int32)

func (*DynamicClient) Test

func (c *DynamicClient) Test(addrList []string)

Testing

type DynamicPaxos

type DynamicPaxos struct {

	//Replica info
	ReplicaNum int
	Majority   int
	FastQuorum int

	// Network I/O swtich
	IsGrpc     bool // If using gRPC
	IsSyncSend bool // If doing server network I/O and computation in the same thread
	// contains filtered or unexported fields
}

func (*DynamicPaxos) DelFpCmdSlowConsRet

func (dp *DynamicPaxos) DelFpCmdSlowConsRet(t int64)

func (*DynamicPaxos) EnablePaxosFutureTime

func (dp *DynamicPaxos) EnablePaxosFutureTime(s *Server)

Enables Paxos to assign a request with a future time indicating when the replicaiton would complete. This is used to reduce execution latency.

func (*DynamicPaxos) FpReplicaAccept

func (dp *DynamicPaxos) FpReplicaAccept(cmd *Command, fpT *Timestamp) bool

func (*DynamicPaxos) FpWaitConsensus

func (dp *DynamicPaxos) FpWaitConsensus(t int64, cmdId string) (bool, bool)

Blocking until the consensus result is known

func (*DynamicPaxos) GetCurFpShard

func (dp *DynamicPaxos) GetCurFpShard() int32

func (*DynamicPaxos) GetCurPaxosShard

func (dp *DynamicPaxos) GetCurPaxosShard() int32

func (*DynamicPaxos) GetExecCh

func (dp *DynamicPaxos) GetExecCh() <-chan Entry

func (*DynamicPaxos) GetIo

func (dp *DynamicPaxos) GetIo() ReplicaIo

func (*DynamicPaxos) MarkFpCmdSlowConsRet

func (dp *DynamicPaxos) MarkFpCmdSlowConsRet(t int64, cmdIdMap map[string]bool)

func (*DynamicPaxos) PaxosLeaderAccept

func (dp *DynamicPaxos) PaxosLeaderAccept(cmd *Command) bool

func (*DynamicPaxos) Probe

func (dp *DynamicPaxos) Probe() time.Duration

func (*DynamicPaxos) ProcessReplicaMsg

func (dp *DynamicPaxos) ProcessReplicaMsg(msg *ReplicaMsg)

func (*DynamicPaxos) SetFpCmdConsRet

func (dp *DynamicPaxos) SetFpCmdConsRet(t int64, cmdId string, isAccept, isFast bool)

func (*DynamicPaxos) SetFpCmdConsRetExecT

func (dp *DynamicPaxos) SetFpCmdConsRetExecT(t int64)

func (*DynamicPaxos) Start

func (dp *DynamicPaxos) Start(hbDelay time.Duration)

Non-blocking

func (*DynamicPaxos) Test

func (dp *DynamicPaxos) Test()

// Testing

type DynamicPaxosClient

type DynamicPaxosClient interface {
	// Multi-Paxos for clients
	PaxosPropose(ctx context.Context, in *PaxosProposeReq, opts ...grpc.CallOption) (*PaxosProposeReply, error)
	// Fast Paxos for clients
	FpPropose(ctx context.Context, in *FpProposeReq, opts ...grpc.CallOption) (DynamicPaxos_FpProposeClient, error)
	// Communication between replicas
	// Heart beat
	// Paxos Accept & Commit
	// Fast Paxos Vote
	// Fast Paxos Accept & Commit
	// Any above message should piggyback a commit timestamp message for the shard.
	// This commit timestamp indicates that the replica guarantees that it will
	// not accept/commit any operation before the timestamp
	DeliverReplicaMsg(ctx context.Context, opts ...grpc.CallOption) (DynamicPaxos_DeliverReplicaMsgClient, error)
	// // Network Latency Monitoring
	// For clients
	Probe(ctx context.Context, in *ProbeReq, opts ...grpc.CallOption) (*ProbeReply, error)
	ProbeTime(ctx context.Context, in *ProbeReq, opts ...grpc.CallOption) (*ProbeTimeReply, error)
	// For replica servers
	ReplicaProbe(ctx context.Context, in *ProbeReq, opts ...grpc.CallOption) (*ReplicaProbeReply, error)
	// Testing
	Test(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestReply, error)
}

func NewDynamicPaxosClient

func NewDynamicPaxosClient(cc *grpc.ClientConn) DynamicPaxosClient

type DynamicPaxosServer

type DynamicPaxosServer interface {
	// Multi-Paxos for clients
	PaxosPropose(context.Context, *PaxosProposeReq) (*PaxosProposeReply, error)
	// Fast Paxos for clients
	FpPropose(*FpProposeReq, DynamicPaxos_FpProposeServer) error
	// Communication between replicas
	// Heart beat
	// Paxos Accept & Commit
	// Fast Paxos Vote
	// Fast Paxos Accept & Commit
	// Any above message should piggyback a commit timestamp message for the shard.
	// This commit timestamp indicates that the replica guarantees that it will
	// not accept/commit any operation before the timestamp
	DeliverReplicaMsg(DynamicPaxos_DeliverReplicaMsgServer) error
	// // Network Latency Monitoring
	// For clients
	Probe(context.Context, *ProbeReq) (*ProbeReply, error)
	ProbeTime(context.Context, *ProbeReq) (*ProbeTimeReply, error)
	// For replica servers
	ReplicaProbe(context.Context, *ProbeReq) (*ReplicaProbeReply, error)
	// Testing
	Test(context.Context, *TestReq) (*TestReply, error)
}

type DynamicPaxos_DeliverReplicaMsgClient

type DynamicPaxos_DeliverReplicaMsgClient interface {
	Send(*ReplicaMsg) error
	CloseAndRecv() (*EmptyReply, error)
	grpc.ClientStream
}

type DynamicPaxos_DeliverReplicaMsgServer

type DynamicPaxos_DeliverReplicaMsgServer interface {
	SendAndClose(*EmptyReply) error
	Recv() (*ReplicaMsg, error)
	grpc.ServerStream
}

type DynamicPaxos_FpProposeClient

type DynamicPaxos_FpProposeClient interface {
	Recv() (*FpProposeReply, error)
	grpc.ClientStream
}

type DynamicPaxos_FpProposeServer

type DynamicPaxos_FpProposeServer interface {
	Send(*FpProposeReply) error
	grpc.ServerStream
}

type EmptyReply

type EmptyReply struct {
}

func (*EmptyReply) Descriptor

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

func (*EmptyReply) ProtoMessage

func (*EmptyReply) ProtoMessage()

func (*EmptyReply) Reset

func (m *EmptyReply) Reset()

func (*EmptyReply) String

func (m *EmptyReply) String() string

type Entry

type Entry interface {
	GetT() *Timestamp
	GetCmd() *Command
	GetStatus() int
	SetStatus(int)
}

type ExecManager

type ExecManager struct {
	// contains filtered or unexported fields
}

func NewExecmanager

func NewExecmanager() *ExecManager

func (*ExecManager) DelExecRet

func (em *ExecManager) DelExecRet(cmdId string)

func (*ExecManager) GetExecRet

func (em *ExecManager) GetExecRet(cmdId string) *ExecRet

func (*ExecManager) Size

func (em *ExecManager) Size() int

func (*ExecManager) WaitExecRet

func (em *ExecManager) WaitExecRet(cmdId string) string

Waits for execution result to be ready Blocks until execution result is available

type ExecRet

type ExecRet struct {
	C chan string
}

func NewExecRet

func NewExecRet() *ExecRet

type FastIo

type FastIo struct {
	PeerAddrList []string
	PeerNetIo    []NetIo
	Id           int // replica Id starting from 0
	N            int // number of replicas
	Listener     net.Listener
	// contains filtered or unexported fields
}

func NewFastIo

func NewFastIo(isSyncSend bool, id string, num int, nodeAddrList []string, p Paxos) *FastIo

func (*FastIo) BcstReplicaMsg

func (io *FastIo) BcstReplicaMsg(addrList []string, msg *ReplicaMsg)

func (*FastIo) InitConn

func (fIo *FastIo) InitConn(addrList []string, streamBufSize int)

Mimic the implementation of EPaxos RPC

func (*FastIo) SendReplicaMsg

func (io *FastIo) SendReplicaMsg(addr string, msg *ReplicaMsg)

func (*FastIo) SendReplicaProbeReq

func (fIo *FastIo) SendReplicaProbeReq(addr string) *ReplicaProbeReply

func (*FastIo) SetServer

func (fIo *FastIo) SetServer(s *Server)

func (*FastIo) WaitForClientConn

func (fIo *FastIo) WaitForClientConn()

////////////////////////////////////// Handles client RPCs

type FpCmdCons

type FpCmdCons struct {
	// contains filtered or unexported fields
}

func NewFpCmdCons

func NewFpCmdCons() *FpCmdCons

type FpCmdConsRet

type FpCmdConsRet struct {
	T        int64
	CmdId    string
	IsAccept bool
	IsFast   bool
}

type FpCmdConsRetManager

type FpCmdConsRetManager struct {
	// contains filtered or unexported fields
}

func NewFpCmdConsRetManager

func NewFpCmdConsRetManager(size int) *FpCmdConsRetManager

func (*FpCmdConsRetManager) Test

func (m *FpCmdConsRetManager) Test()

type FpCmdSlowConsRet

type FpCmdSlowConsRet struct {
	T        int64
	CmdIdMap map[string]bool
}

type FpCons

type FpCons struct {
	// contains filtered or unexported fields
}

Fast Paxos consensus instance

func NewFpCons

func NewFpCons(t int64) *FpCons

func (*FpCons) Accept

func (cons *FpCons) Accept(cmd *Command) int

func (*FpCons) ChooseCmd

func (cons *FpCons) ChooseCmd(cmd *Command)

func (*FpCons) GetAcceptN

func (cons *FpCons) GetAcceptN() int

Returns the number of accepted commands

func (*FpCons) GetCmdIdMap

func (cons *FpCons) GetCmdIdMap() map[string]bool

func (*FpCons) GetRejectCmdIdList

func (cons *FpCons) GetRejectCmdIdList() []string

func (*FpCons) GetT

func (cons *FpCons) GetT() int64

func (*FpCons) IsCmdChosen

func (cons *FpCons) IsCmdChosen() bool

func (*FpCons) IsSetFpCmdConsRet

func (cons *FpCons) IsSetFpCmdConsRet(cmdId string) bool

func (*FpCons) SelectCmd

func (cons *FpCons) SelectCmd(majority int) *Command

func (*FpCons) SetFpCmdConsRet

func (cons *FpCons) SetFpCmdConsRet(cmdId string)

type FpConsManager

type FpConsManager struct {
	// contains filtered or unexported fields
}

Fast Paxos shard consensus instance manager

func NewFpConsManager

func NewFpConsManager(initSize int) *FpConsManager

func (*FpConsManager) AddSlowFpCons

func (m *FpConsManager) AddSlowFpCons(cons *FpCons)

func (*FpConsManager) DelSlowFpCons

func (m *FpConsManager) DelSlowFpCons(t int64)

func (*FpConsManager) GetFpCons

func (m *FpConsManager) GetFpCons(t int64) *FpCons

func (*FpConsManager) GetSlowFpCons

func (m *FpConsManager) GetSlowFpCons(t int64) *FpCons

func (*FpConsManager) PeekCons

func (m *FpConsManager) PeekCons() (*FpCons, bool)

func (*FpConsManager) PopCons

func (m *FpConsManager) PopCons() *FpCons

func (*FpConsManager) Test

func (m *FpConsManager) Test()

Testing

type FpExecTimeManager

type FpExecTimeManager struct {
	// contains filtered or unexported fields
}

Fast Paxos shard execution time manager

func NewFpExecTimeManager

func NewFpExecTimeManager(rN int, fastQuorum int, rIdList []string) *FpExecTimeManager

func (*FpExecTimeManager) GetExecT

func (tm *FpExecTimeManager) GetExecT() int64

func (*FpExecTimeManager) GetFastNonAcceptT

func (tm *FpExecTimeManager) GetFastNonAcceptT(rId string) int64

func (*FpExecTimeManager) GetFastQuorumNonAcceptT

func (tm *FpExecTimeManager) GetFastQuorumNonAcceptT() (int64, string)

func (*FpExecTimeManager) GetMinNonAcceptT

func (tm *FpExecTimeManager) GetMinNonAcceptT() (int64, string)

func (*FpExecTimeManager) Test

func (tm *FpExecTimeManager) Test()

func (*FpExecTimeManager) UpdateExecT

func (tm *FpExecTimeManager) UpdateExecT(t int64)

func (*FpExecTimeManager) UpdateNonAcceptTime

func (tm *FpExecTimeManager) UpdateNonAcceptTime(rId string, nat int64)

type FpLog

type FpLog struct {
	// contains filtered or unexported fields
}

func (*FpLog) Del

func (l *FpLog) Del(t int64)

func (*FpLog) Get

func (l *FpLog) Get(t int64) (Entry, bool)

func (*FpLog) IsFpLog

func (l *FpLog) IsFpLog() bool

func (*FpLog) PeekMin

func (l *FpLog) PeekMin() (Entry, bool)

func (*FpLog) PopMin

func (l *FpLog) PopMin() (Entry, bool)

func (*FpLog) Put

func (l *FpLog) Put(t int64, e Entry)

func (*FpLog) Test

func (l *FpLog) Test()

type FpProposal

type FpProposal struct {
	Cmd  *Command
	FpT  *Timestamp
	RetC chan bool
}

type FpProposeReply

type FpProposeReply struct {
	IsAccept bool   `protobuf:"varint,1,opt,name=isAccept" json:"isAccept,omitempty"`
	IsFast   bool   `protobuf:"varint,2,opt,name=isFast" json:"isFast,omitempty"`
	ExecRet  string `protobuf:"bytes,3,opt,name=execRet" json:"execRet,omitempty"`
	CmdId    string `protobuf:"bytes,4,opt,name=cmdId" json:"cmdId,omitempty"`
}

func (*FpProposeReply) Descriptor

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

func (*FpProposeReply) GetCmdId

func (m *FpProposeReply) GetCmdId() string

func (*FpProposeReply) GetExecRet

func (m *FpProposeReply) GetExecRet() string

func (*FpProposeReply) GetIsAccept

func (m *FpProposeReply) GetIsAccept() bool

func (*FpProposeReply) GetIsFast

func (m *FpProposeReply) GetIsFast() bool

func (*FpProposeReply) ProtoMessage

func (*FpProposeReply) ProtoMessage()

func (*FpProposeReply) Reset

func (m *FpProposeReply) Reset()

func (*FpProposeReply) String

func (m *FpProposeReply) String() string

type FpProposeReq

type FpProposeReq struct {
	Cmd         *Command   `protobuf:"bytes,1,opt,name=cmd" json:"cmd,omitempty"`
	Time        *Timestamp `protobuf:"bytes,2,opt,name=time" json:"time,omitempty"`
	IsExecReply bool       `protobuf:"varint,3,opt,name=isExecReply" json:"isExecReply,omitempty"`
}

func (*FpProposeReq) Descriptor

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

func (*FpProposeReq) GetCmd

func (m *FpProposeReq) GetCmd() *Command

func (*FpProposeReq) GetIsExecReply

func (m *FpProposeReq) GetIsExecReply() bool

func (*FpProposeReq) GetTime

func (m *FpProposeReq) GetTime() *Timestamp

func (*FpProposeReq) ProtoMessage

func (*FpProposeReq) ProtoMessage()

func (*FpProposeReq) Reset

func (m *FpProposeReq) Reset()

func (*FpProposeReq) String

func (m *FpProposeReq) String() string

type FpReply

type FpReply struct {
	// contains filtered or unexported fields
}

type GrpcIo

type GrpcIo struct {
	// contains filtered or unexported fields
}

///////////////////////////////// gRPC streaming implementation

func (*GrpcIo) BcstReplicaMsg

func (io *GrpcIo) BcstReplicaMsg(addrList []string, msg *ReplicaMsg)

func (*GrpcIo) InitConn

func (io *GrpcIo) InitConn(addrList []string, streamBufSize int)

func (*GrpcIo) SendReplicaMsg

func (io *GrpcIo) SendReplicaMsg(addr string, msg *ReplicaMsg)

func (*GrpcIo) SendReplicaProbeReq

func (io *GrpcIo) SendReplicaProbeReq(addr string) *ReplicaProbeReply

Synchoronous I/O

type LatInfo

type LatInfo struct {
	// contains filtered or unexported fields
}

type LatReq

type LatReq struct {
	RetC chan bool
}

type Log

type Log interface {
	PeekMin() (Entry, bool)
	PopMin() (Entry, bool)

	Put(t int64, e Entry)
	Get(t int64) (Entry, bool)

	Del(t int64)

	IsFpLog() bool

	// Testing
	Test()
}

func NewFpLog

func NewFpLog() Log

Fast Paxos log

func NewPaxosLog

func NewPaxosLog() Log

type LogManager

type LogManager interface {
	//Updates the min execution time among all Paxos and Fast Paxos shards
	UpdatePaxosMinExecT(t *Timestamp)
	UpdateFpMinExecT(t *Timestamp) bool

	// Paxos
	PaxosAcceptCmd(t *Timestamp, cmd *Command)
	PaxosCommitCmd(t *Timestamp, cmdId string)

	// Fast Paxos
	// Fast-path accept a client's command
	FpFastAcceptCmd(t *Timestamp, cmd *Command) bool
	// Slow-path accept a command
	FpAcceptCmd(t *Timestamp, cmd *Command)
	// Fast-path / slow-path commit a command
	FpCommitCmd(t *Timestamp, cmd *Command, isFast bool)

	// Preapres a shard for execution
	PrepareShardExec(shard int32)

	// Execution
	Exec()
	GetExecCh() <-chan Entry

	// Testing
	Test()
}

func NewSimpleLogManager

func NewSimpleLogManager(
	pShardList []int32,
	fpShardList []int32,
	execChSize int,
) LogManager

type NetIo

type NetIo interface {
	SendMsg(msgType uint8, msg interface{}) error
	RecvMsg() (msgType uint8, msg interface{}, err error)
	SendByte(b uint8) error
	RecvByte() (uint8, error)
	Close() error
}

func NewNetIo

func NewNetIo(conn net.Conn) NetIo

type Paxos

type Paxos interface {
	// Paxos assignes a request with a future time when the replication completes
	EnablePaxosFutureTime(s *Server)

	Start(hbDelay time.Duration)

	// Probing message for latency monitoring
	// Returns the queuing (i.e., processing delay)
	Probe() time.Duration

	// Returns isCommitted
	PaxosLeaderAccept(cmd *Command) bool

	// Returns isAccepted (A cmd gets rejected if the timestamp passes the current time)
	FpReplicaAccept(cmd *Command, fpT *Timestamp) bool

	// Processes messages between replicas
	ProcessReplicaMsg(msg *ReplicaMsg)

	// Fast Paxos shard leader waits for consensus result
	FpWaitConsensus(t int64, cmdId string) (bool, bool)

	// Returns the Paxos shard ID that this replica is the leader
	GetCurPaxosShard() int32

	// Returns the Fast Paxos shard ID that this replica is the leader
	GetCurFpShard() int32

	// Returns the command execution channel for applications
	GetExecCh() <-chan Entry

	// Returns RPC I/O handle TODO Decouples I/O from Paxos module
	GetIo() ReplicaIo

	// Testing
	Test()
}

func NewDynamicPaxos

func NewDynamicPaxos(
	replicaId string,
	replicaIdAddrMap map[string]string,
	rIdList, nodeAddrList []string,
	pShard, fpShard int32,
	pShardLeaderIdMap, fpShardLeaderIdMap map[int32]string,
	followerAddrList []string,
	hbInterval time.Duration,
	cmdChSize int,
	execChSize int,
	isGrpc, isSyncSend bool,
	isFpLeaderLearner bool,
) Paxos

type PaxosCons

type PaxosCons struct {
	// contains filtered or unexported fields
}

Paxos consenus instance

func NewPaxosCons

func NewPaxosCons(c chan bool) *PaxosCons

func (*PaxosCons) GetRetC

func (info *PaxosCons) GetRetC() chan bool

func (*PaxosCons) VoteAccept

func (info *PaxosCons) VoteAccept() int

type PaxosLog

type PaxosLog struct {
	// contains filtered or unexported fields
}

func (*PaxosLog) Del

func (l *PaxosLog) Del(t int64)

func (*PaxosLog) Get

func (l *PaxosLog) Get(t int64) (Entry, bool)

func (*PaxosLog) IsFpLog

func (l *PaxosLog) IsFpLog() bool

func (*PaxosLog) PeekMin

func (l *PaxosLog) PeekMin() (Entry, bool)

Assuming that all entries are added in the increasing order of the time

func (*PaxosLog) PopMin

func (l *PaxosLog) PopMin() (Entry, bool)

func (*PaxosLog) Put

func (l *PaxosLog) Put(t int64, e Entry)

Puts the cmd to the Paxos shard log, where cmds are ordered by the timestamps. NOTE: this function should be called in the order of the timestamp assignment.

func (*PaxosLog) Test

func (l *PaxosLog) Test()

type PaxosProposal

type PaxosProposal struct {
	Cmd  *Command
	RetC chan bool
}

type PaxosProposeReply

type PaxosProposeReply struct {
	IsCommit bool   `protobuf:"varint,1,opt,name=isCommit" json:"isCommit,omitempty"`
	ExecRet  string `protobuf:"bytes,2,opt,name=execRet" json:"execRet,omitempty"`
	CmdId    string `protobuf:"bytes,3,opt,name=cmdId" json:"cmdId,omitempty"`
}

func (*PaxosProposeReply) Descriptor

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

func (*PaxosProposeReply) GetCmdId

func (m *PaxosProposeReply) GetCmdId() string

func (*PaxosProposeReply) GetExecRet

func (m *PaxosProposeReply) GetExecRet() string

func (*PaxosProposeReply) GetIsCommit

func (m *PaxosProposeReply) GetIsCommit() bool

func (*PaxosProposeReply) ProtoMessage

func (*PaxosProposeReply) ProtoMessage()

func (*PaxosProposeReply) Reset

func (m *PaxosProposeReply) Reset()

func (*PaxosProposeReply) String

func (m *PaxosProposeReply) String() string

type PaxosProposeReq

type PaxosProposeReq struct {
	Cmd *Command `protobuf:"bytes,1,opt,name=cmd" json:"cmd,omitempty"`
}

func (*PaxosProposeReq) Descriptor

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

func (*PaxosProposeReq) GetCmd

func (m *PaxosProposeReq) GetCmd() *Command

func (*PaxosProposeReq) ProtoMessage

func (*PaxosProposeReq) ProtoMessage()

func (*PaxosProposeReq) Reset

func (m *PaxosProposeReq) Reset()

func (*PaxosProposeReq) String

func (m *PaxosProposeReq) String() string

type ProbeReply

type ProbeReply struct {
	QueuingDelay int64 `protobuf:"varint,1,opt,name=queuingDelay" json:"queuingDelay,omitempty"`
	PaxosLat     int32 `protobuf:"varint,2,opt,name=paxosLat" json:"paxosLat,omitempty"`
}

func (*ProbeReply) Descriptor

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

func (*ProbeReply) GetPaxosLat

func (m *ProbeReply) GetPaxosLat() int32

func (*ProbeReply) GetQueuingDelay

func (m *ProbeReply) GetQueuingDelay() int64

func (*ProbeReply) ProtoMessage

func (*ProbeReply) ProtoMessage()

func (*ProbeReply) Reset

func (m *ProbeReply) Reset()

func (*ProbeReply) String

func (m *ProbeReply) String() string

type ProbeReq

type ProbeReq struct {
}

func (*ProbeReq) Descriptor

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

func (*ProbeReq) ProtoMessage

func (*ProbeReq) ProtoMessage()

func (*ProbeReq) Reset

func (m *ProbeReq) Reset()

func (*ProbeReq) String

func (m *ProbeReq) String() string

type ProbeTimeReply

type ProbeTimeReply struct {
	ProcessTime int64 `protobuf:"varint,1,opt,name=processTime" json:"processTime,omitempty"`
	PaxosLat    int32 `protobuf:"varint,2,opt,name=paxosLat" json:"paxosLat,omitempty"`
}

func (*ProbeTimeReply) Descriptor

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

func (*ProbeTimeReply) GetPaxosLat

func (m *ProbeTimeReply) GetPaxosLat() int32

func (*ProbeTimeReply) GetProcessTime

func (m *ProbeTimeReply) GetProcessTime() int64

func (*ProbeTimeReply) ProtoMessage

func (*ProbeTimeReply) ProtoMessage()

func (*ProbeTimeReply) Reset

func (m *ProbeTimeReply) Reset()

func (*ProbeTimeReply) String

func (m *ProbeTimeReply) String() string

type ReplicaIo

type ReplicaIo interface {
	InitConn(addrList []string, streamBufSize int)

	// A replica broadcasts heart beat to others
	BcstHb(addrList []string, nat int64, rId string, fpExecT *Timestamp)

	// Paxos shard leader
	BcstPaxosAcceptReq(addrList []string, t *Timestamp, cmd *Command, rId string, fpExecT *Timestamp)
	BcstPaxosFutureAcceptReq(addrList []string, t *Timestamp, cmd *Command, rId string, nat int64, fpExecT *Timestamp)
	// Piggybacks current commit time
	BcstPaxosCommitReq(addrList []string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp)

	// Paxos shard follower
	// Piggybacks current commit time
	SendPaxosAcceptReply(addr string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp)

	// Fast Paxos shard leader
	BcstFpAccept(addrList []string, t *Timestamp, cmd *Command, execT *Timestamp, nat int64, rId string)
	BcstFpCommit(addrList []string, t *Timestamp, cmd *Command, isFast bool, execT *Timestamp, nat int64, rId string)

	// Fast Paxos all learners
	BcstFpFastVote(addrList []string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, rId string)

	// Fast Paxos shard follower
	SendFpFastVote(addr string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, rId string)
	SendFpAcceptReply(addr string, t *Timestamp, cmdId string, nat int64, rId string)

	// Blocking
	// Synchronous I/O Latency probing
	// TODO to be piggybacked on the heart beat message
	SyncSendReplicaProbeReq(addr string) *ReplicaProbeReply
}

func NewStreamIo

func NewStreamIo(
	isGrpc, isSyncSend bool, id string, num int, nodeAddrList []string, p Paxos,
) ReplicaIo

type ReplicaLatInfo

type ReplicaLatInfo struct {
	// contains filtered or unexported fields
}

type ReplicaMsg

type ReplicaMsg struct {
	Type       int32      `protobuf:"varint,1,opt,name=type" json:"type,omitempty"`
	Cmd        *Command   `protobuf:"bytes,2,opt,name=cmd" json:"cmd,omitempty"`
	Time       *Timestamp `protobuf:"bytes,3,opt,name=time" json:"time,omitempty"`
	IsAccept   bool       `protobuf:"varint,4,opt,name=isAccept" json:"isAccept,omitempty"`
	NonAcceptT int64      `protobuf:"varint,5,opt,name=nonAcceptT" json:"nonAcceptT,omitempty"`
	ReplicaId  string     `protobuf:"bytes,6,opt,name=replicaId" json:"replicaId,omitempty"`
	FpExecT    *Timestamp `protobuf:"bytes,7,opt,name=fpExecT" json:"fpExecT,omitempty"`
}

func (*ReplicaMsg) Descriptor

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

func (*ReplicaMsg) GetCmd

func (m *ReplicaMsg) GetCmd() *Command

func (*ReplicaMsg) GetFpExecT

func (m *ReplicaMsg) GetFpExecT() *Timestamp

func (*ReplicaMsg) GetIsAccept

func (m *ReplicaMsg) GetIsAccept() bool

func (*ReplicaMsg) GetNonAcceptT

func (m *ReplicaMsg) GetNonAcceptT() int64

func (*ReplicaMsg) GetReplicaId

func (m *ReplicaMsg) GetReplicaId() string

func (*ReplicaMsg) GetTime

func (m *ReplicaMsg) GetTime() *Timestamp

func (*ReplicaMsg) GetType

func (m *ReplicaMsg) GetType() int32

func (*ReplicaMsg) ProtoMessage

func (*ReplicaMsg) ProtoMessage()

func (*ReplicaMsg) Reset

func (m *ReplicaMsg) Reset()

func (*ReplicaMsg) String

func (m *ReplicaMsg) String() string

type ReplicaProbeReply

type ReplicaProbeReply struct {
	QueuingDelay int64 `protobuf:"varint,1,opt,name=queuingDelay" json:"queuingDelay,omitempty"`
}

func (*ReplicaProbeReply) Descriptor

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

func (*ReplicaProbeReply) GetQueuingDelay

func (m *ReplicaProbeReply) GetQueuingDelay() int64

func (*ReplicaProbeReply) ProtoMessage

func (*ReplicaProbeReply) ProtoMessage()

func (*ReplicaProbeReply) Reset

func (m *ReplicaProbeReply) Reset()

func (*ReplicaProbeReply) String

func (m *ReplicaProbeReply) String() string

type RpcIo

type RpcIo interface {
	InitConn(addrList []string, streamBufSize int)

	// FIFO communication and processing between replicas
	BcstReplicaMsg(addrList []string, msg *ReplicaMsg)
	SendReplicaMsg(addr string, msg *ReplicaMsg)

	// Synchoronous I/O Latency probing (not FIFO processing)
	SendReplicaProbeReq(addr string) *ReplicaProbeReply
	// contains filtered or unexported methods
}

func NewGrpcIo

func NewGrpcIo(isSyncSend bool) RpcIo

type Server

type Server struct {
	IsExecReply bool // True if reply execution ret

	IsFpLeaderUsePaxos bool
	IsFpLeaderLearner  bool

	IsGrpc bool

	// Latency predictions
	IsLatPrediction bool
	// contains filtered or unexported fields
}

func NewServer

func NewServer(
	replicaId string,
	replicaIdAddrMap map[string]string,
	rIdList, nodeAddrList []string,
	pShard, fpShard int32,
	pShardLeaderMap, fpShardLeaderMap map[int32]string,
	followerAddrList []string,
	hbInterval time.Duration,
	cmdChSize int,
	execChSize int,
	isExecReply bool,
	isFpLeaderUsePaxos bool,
	isGrpc, isSyncSend bool,
	isFpLeaderLearner bool,
	isLatPrediction bool,
	probeInv time.Duration,
	windowLen time.Duration, windowSize int,
	predictPth float64,
	isPaxosFutureTime bool,
) *Server

func (*Server) DeliverReplicaMsg

func (s *Server) DeliverReplicaMsg(stream DynamicPaxos_DeliverReplicaMsgServer) error

func (*Server) FpPropose

func (s *Server) FpPropose(req *FpProposeReq, stream DynamicPaxos_FpProposeServer) error

func (*Server) GetExecCh

func (s *Server) GetExecCh() <-chan Entry

func (*Server) GetExecManager

func (s *Server) GetExecManager() *ExecManager

func (*Server) PaxosPropose

func (s *Server) PaxosPropose(ctx context.Context, req *PaxosProposeReq) (*PaxosProposeReply, error)

func (*Server) PredictPaxosLat

func (s *Server) PredictPaxosLat() int64

Predicts the Paxos latency (in ms) when this is the leader

func (*Server) Probe

func (s *Server) Probe(ctx context.Context, req *ProbeReq) (*ProbeReply, error)

Latency probe for clients

func (*Server) ProbeTime

func (s *Server) ProbeTime(ctx context.Context, req *ProbeReq) (*ProbeTimeReply, error)

Time offset probe for clients.

To consider the clock synchronization between clients and servers, a client predicts the time when its request can be processed on each server. Each server returns its clock time to the client, and the client can calculate the offset between its clock time and the server's clock time, which includes the network delay and queuing delay. The client will use the time offset to set its request timestamp.

func (*Server) ReplicaProbe

func (s *Server) ReplicaProbe(ctx context.Context, req *ProbeReq) (*ReplicaProbeReply, error)

func (*Server) Start

func (s *Server) Start(port string)

func (*Server) Test

func (s *Server) Test(ctx context.Context, req *TestReq) (*TestReply, error)

type SimpleLogManager

type SimpleLogManager struct {
	// contains filtered or unexported fields
}

func (*SimpleLogManager) Exec

func (lm *SimpleLogManager) Exec()

func (*SimpleLogManager) FpAcceptCmd

func (lm *SimpleLogManager) FpAcceptCmd(t *Timestamp, cmd *Command)

func (*SimpleLogManager) FpCommitCmd

func (lm *SimpleLogManager) FpCommitCmd(t *Timestamp, cmd *Command, isFast bool)

func (*SimpleLogManager) FpFastAcceptCmd

func (lm *SimpleLogManager) FpFastAcceptCmd(t *Timestamp, cmd *Command) bool

func (*SimpleLogManager) GetExecCh

func (lm *SimpleLogManager) GetExecCh() <-chan Entry

func (*SimpleLogManager) PaxosAcceptCmd

func (lm *SimpleLogManager) PaxosAcceptCmd(t *Timestamp, cmd *Command)

func (*SimpleLogManager) PaxosCommitCmd

func (lm *SimpleLogManager) PaxosCommitCmd(t *Timestamp, cmdId string)

func (*SimpleLogManager) PrepareShardExec

func (lm *SimpleLogManager) PrepareShardExec(shard int32)

func (*SimpleLogManager) Test

func (lm *SimpleLogManager) Test()

func (*SimpleLogManager) UpdateFpMinExecT

func (lm *SimpleLogManager) UpdateFpMinExecT(t *Timestamp) bool

func (*SimpleLogManager) UpdatePaxosMinExecT

func (lm *SimpleLogManager) UpdatePaxosMinExecT(t *Timestamp)

NOTE: for each Paxos shard, the execution time can only be updated to a future one.

type StreamIo

type StreamIo struct {
	// contains filtered or unexported fields
}

Not thread-safe

func (*StreamIo) BcstFpAccept

func (io *StreamIo) BcstFpAccept(
	addrList []string, t *Timestamp, cmd *Command, execT *Timestamp, nat int64, rId string,
)

// Fast Paxos A leader sends slow-path accept req to followers

func (*StreamIo) BcstFpCommit

func (io *StreamIo) BcstFpCommit(
	addrList []string, t *Timestamp, cmd *Command, isFast bool,
	execT *Timestamp, nat int64, rId string,
)

A leader sends fast-path/slow-path commit req to followers

func (*StreamIo) BcstFpFastVote

func (io *StreamIo) BcstFpFastVote(
	addrList []string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, rId string,
)

func (*StreamIo) BcstHb

func (io *StreamIo) BcstHb(
	addrList []string, nat int64, rId string, fpExecT *Timestamp,
)

Leader fo followers Shard leaders broadcast heartbeat to followers

func (*StreamIo) BcstPaxosAcceptReq

func (io *StreamIo) BcstPaxosAcceptReq(
	addrList []string, t *Timestamp, cmd *Command, rId string, fpExecT *Timestamp,
)

Shard leaders broadcast Paxos accept req to followers

func (*StreamIo) BcstPaxosCommitReq

func (io *StreamIo) BcstPaxosCommitReq(
	addrList []string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp,
)

Shard leaders broadcast Paxos commit req to followers

func (*StreamIo) BcstPaxosFutureAcceptReq

func (io *StreamIo) BcstPaxosFutureAcceptReq(
	addrList []string, t *Timestamp, cmd *Command, rId string, nat int64, fpExecT *Timestamp,
)

func (*StreamIo) InitConn

func (io *StreamIo) InitConn(addrList []string, streamBufSize int)

func (*StreamIo) SendFpAcceptReply

func (io *StreamIo) SendFpAcceptReply(
	addr string, t *Timestamp, cmdId string, nat int64, rId string,
)

func (*StreamIo) SendFpFastVote

func (io *StreamIo) SendFpFastVote(
	addr string, t *Timestamp, cmd *Command, isFastAccept bool, nat int64, rId string,
)

A Fast Paxos shard follower sends a fast-path vote to the leader

func (*StreamIo) SendPaxosAcceptReply

func (io *StreamIo) SendPaxosAcceptReply(
	addr string, t *Timestamp, cmdId string, nat int64, rId string, fpExecT *Timestamp,
)

Follower to leader A follower sends a Paxos accept reply to the shard leader

func (*StreamIo) SyncSendReplicaProbeReq

func (io *StreamIo) SyncSendReplicaProbeReq(addr string) *ReplicaProbeReply

Blocking

type SyncNetIo

type SyncNetIo struct {
	// contains filtered or unexported fields
}

func NewSyncNetIo

func NewSyncNetIo(netIo NetIo) *SyncNetIo

func (*SyncNetIo) SendMsg

func (n *SyncNetIo) SendMsg(msgType uint8, msg interface{}) error

type TestReply

type TestReply struct {
}

func (*TestReply) Descriptor

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

func (*TestReply) ProtoMessage

func (*TestReply) ProtoMessage()

func (*TestReply) Reset

func (m *TestReply) Reset()

func (*TestReply) String

func (m *TestReply) String() string

type TestReq

type TestReq struct {
}

func (*TestReq) Descriptor

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

func (*TestReq) ProtoMessage

func (*TestReq) ProtoMessage()

func (*TestReq) Reset

func (m *TestReq) Reset()

func (*TestReq) String

func (m *TestReq) String() string

type TimeManager

type TimeManager interface {
	GetCurrentTime() int64
	PrevT(t int64) int64
	NextT(t int64) int64
}

func NewRealClockTm

func NewRealClockTm() TimeManager

type Timestamp

type Timestamp struct {
	Time  int64 `protobuf:"varint,1,opt,name=time" json:"time,omitempty"`
	Shard int32 `protobuf:"varint,2,opt,name=shard" json:"shard,omitempty"`
}

func (*Timestamp) Descriptor

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

func (*Timestamp) GetShard

func (m *Timestamp) GetShard() int32

func (*Timestamp) GetTime

func (m *Timestamp) GetTime() int64

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) Reset

func (m *Timestamp) Reset()

func (*Timestamp) String

func (m *Timestamp) String() string

Jump to

Keyboard shortcuts

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