lib

package
v0.0.0-...-50d199f Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationInfo

type ApplicationInfo struct {
	AppID string

	IPs       []string
	Ports     []string
	CType     string
	Mutex     *sync.Mutex
	Cond      *sync.Cond
	WriteLock bool
	// contains filtered or unexported fields
}

type CargoComm

type CargoComm struct {
	cargoToMgr.UnimplementedRpcCargoToMgrServer
	// contains filtered or unexported fields
}

func (*CargoComm) AcquireWriteLock

func (cc *CargoComm) AcquireWriteLock(ctx context.Context, appInfo *cargoToMgr.AppInfo) (*cargoToMgr.LockAck, error)

func (*CargoComm) GetReplicaInfo

func (cc *CargoComm) GetReplicaInfo(ctx context.Context, appInfo *cargoToMgr.AppInfo) (*cargoToMgr.ReplicaInfo, error)

func (*CargoComm) RegisterToMgr

func (cc *CargoComm) RegisterToMgr(ctx context.Context, cargoInfo *cargoToMgr.CargoInfo) (*cargoToMgr.Ack, error)

func (*CargoComm) ReleaseWriteLock

func (cc *CargoComm) ReleaseWriteLock(ctx context.Context, appInfo *cargoToMgr.AppInfo) (*cargoToMgr.ReleaseAck, error)

type CargoMgrInfo

type CargoMgrInfo struct {
	Port    string
	CC      CargoComm
	TCM     TaskComm
	Cargos  map[string]CargoNode
	AppInfo map[string]*ApplicationInfo
}

func Init

func Init(port string) *CargoMgrInfo

func (*CargoMgrInfo) ListenRoutine

func (cargoMgrInfo *CargoMgrInfo) ListenRoutine(wg *sync.WaitGroup)

type CargoNode

type CargoNode struct {
	IP    string
	Port  string
	ID    string // <geohash + uuid>
	Lat   float64
	Lon   float64
	TSize float64
	RSize float64
}

type TaskComm

type TaskComm struct {
	taskToCargoMgr.UnimplementedRpcTaskToCargoMgrServer
	// contains filtered or unexported fields
}

func (*TaskComm) RequestCargo

func (tcm *TaskComm) RequestCargo(ctx context.Context, requesterInfo *taskToCargoMgr.RequesterInfo) (*taskToCargoMgr.Cargos, error)

Jump to

Keyboard shortcuts

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