Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandType ¶
type CommandType uint8
CommandType is the type of raft command in log entry.
const ( // MemberUpsert is the command to update or insert new or existing member info. MemberUpsert CommandType = 0 // MemberRemove is the command to remove member from actor host member state. MemberRemove CommandType = 1 // TableDisseminate is the reserved command for dissemination loop. TableDisseminate CommandType = 100 )
type DaprHostMember ¶
type DaprHostMember struct { // Name is the unique name of Dapr runtime host. Name string // AppID is Dapr runtime app ID. AppID string // Entities is the list of Actor Types which this Dapr runtime supports. Entities []string // UpdatedAt is the last time when this host member info is updated. UpdatedAt int64 }
DaprHostMember represents Dapr runtime actor host member which serve actor types.
type DaprHostMemberState ¶
type DaprHostMemberState struct {
// contains filtered or unexported fields
}
DaprHostMemberState is the state to store Dapr runtime host and consistent hashing tables.
func (*DaprHostMemberState) Index ¶
func (s *DaprHostMemberState) Index() uint64
func (*DaprHostMemberState) Members ¶
func (s *DaprHostMemberState) Members() map[string]*DaprHostMember
func (*DaprHostMemberState) TableGeneration ¶
func (s *DaprHostMemberState) TableGeneration() uint64
type DaprHostMemberStateData ¶ added in v1.4.0
type DaprHostMemberStateData struct { // Index is the index number of raft log. Index uint64 // Members includes Dapr runtime hosts. Members map[string]*DaprHostMember // TableGeneration is the generation of hashingTableMap. // This is increased whenever hashingTableMap is updated. TableGeneration uint64 // contains filtered or unexported fields }
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
FSM implements a finite state machine that is used along with Raft to provide strong consistency. We implement this outside the Server to avoid exposing this outside the package.
func (*FSM) PlacementState ¶
func (c *FSM) PlacementState() *v1pb.PlacementTables
PlacementState returns the current placement tables.
func (*FSM) Restore ¶
func (c *FSM) Restore(old io.ReadCloser) error
Restore streams in the snapshot and replaces the current state store with a new one based on the snapshot if all goes OK during the restore.
func (*FSM) Snapshot ¶
func (c *FSM) Snapshot() (raft.FSMSnapshot, error)
Snapshot is used to support log compaction. This call should return an FSMSnapshot which can be used to save a point-in-time snapshot of the FSM.
func (*FSM) State ¶
func (c *FSM) State() *DaprHostMemberState
State is used to return a handle to the current state.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is Raft server implementation.
func (*Server) ApplyCommand ¶
func (s *Server) ApplyCommand(cmdType CommandType, data DaprHostMember) (bool, error)
ApplyCommand applies command log to state machine to upsert or remove members.