placement

package
v1.15.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostInfo added in v1.12.0

type HostInfo struct {
	Name       string   `json:"name,omitempty"`
	Namespace  string   `json:"namespace,omitempty"`
	AppID      string   `json:"appId,omitempty"`
	ActorTypes []string `json:"actorTypes,omitempty"`
	UpdatedAt  int64    `json:"updatedAt,omitempty"`
	APILevel   uint32   `json:"apiLevel"`
}

type PlacementTables

type PlacementTables struct {
	HostList     []HostInfo `json:"hostList,omitempty"`
	TableVersion uint64     `json:"tableVersion"`
	APILevel     uint32     `json:"apiLevel"`
}

type Service added in v0.2.0

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

Service updates the Dapr runtimes with distributed hash tables for stateful entities.

func NewPlacementService

func NewPlacementService(opts ServiceOpts) *Service

NewPlacementService returns a new placement service.

func (*Service) GetPlacementTables added in v1.12.0

func (p *Service) GetPlacementTables() (*PlacementTables, error)

GetPlacementTables returns the current placement host infos.

func (*Service) MonitorLeadership added in v1.0.0

func (p *Service) MonitorLeadership(parentCtx context.Context) error

MonitorLeadership is used to monitor if we acquire or lose our role as the leader in the Raft cluster. There is some work the leader is expected to do, so we must react to changes

reference: https://github.com/hashicorp/consul/blob/master/agent/consul/leader.go

func (*Service) ReportDaprStatus added in v0.2.0

func (p *Service) ReportDaprStatus(stream placementv1pb.Placement_ReportDaprStatusServer) error

ReportDaprStatus gets a heartbeat report from different Dapr hosts.

func (*Service) Start added in v1.14.0

func (p *Service) Start(ctx context.Context) error

Start starts the placement service gRPC server. Blocks until the service is closed and all connections are drained.

type ServiceOpts added in v1.15.0

type ServiceOpts struct {
	RaftNode           *raft.Server
	MaxAPILevel        *uint32
	MinAPILevel        uint32
	SecProvider        security.Provider
	Port               int
	ListenAddress      string
	Healthz            healthz.Healthz
	KeepAliveTime      time.Duration
	KeepAliveTimeout   time.Duration
	DisseminateTimeout time.Duration
}

ServiceOpts contains options for the NewPlacementService method.

Directories

Path Synopsis
Package placement is an implementation of Consistent Hashing and Consistent Hashing With Bounded Loads.
Package placement is an implementation of Consistent Hashing and Consistent Hashing With Bounded Loads.

Jump to

Keyboard shortcuts

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