allocator

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func New

func New(options Options, params Params) (*Manager, error)

func (*Manager) Allocate

func (m *Manager) Allocate(authInfo *srpc.AuthInformation,
	request proto.AllocateRequest) (proto.AllocateResponse, error)

Allocate issues an allocation request. It blocks until the allocator is ready.

func (*Manager) CancelAllocation

func (m *Manager) CancelAllocation(authInfo *srpc.AuthInformation,
	requestId proto.RequestId) error

CancelAllocation cancels an allocation request (that has not yet been completed/fulfilled). It blocks until the allocator is ready.

func (*Manager) GetUpdateQueue

func (*Manager) UpdateTopology

func (m *Manager) UpdateTopology(t *topology.Topology)

func (*Manager) WriteHtml

func (m *Manager) WriteHtml(writer io.Writer)

type Options

type Options struct {
	CreateDeadline   time.Duration
	MaximumQueueSize uint64
}

type Params

type Params struct {
	Logger             log.DebugLogger
	Storer             Storer
	UpdateChannelMaker UpdateChannelMaker
}

type Storer

type Storer interface {
	DeleteUpdate(position uint64) error
	DeleteUserRequest(username types.Username, reqId proto.RequestId) error
	ReadUpdates() (uint64, []proto.AllocationUpdateEntry, error)
	ReadUsersQueue() (usernames []types.Username, err error)
	ReadUserQueue(username types.Username) (
		requestIDs []proto.RequestId, err error)
	ReadUserRequest(username types.Username, requestId proto.RequestId) (
		proto.AllocateRequest, error)
	WriteUpdate(update proto.AllocationUpdateEntry, position uint64) error
	WriteUsersQueue(usernames []types.Username) error
	WriteUserQueue(username types.Username, requestIDs []proto.RequestId) error
	WriteUserRequest(username types.Username, reqId proto.RequestId,
		req proto.AllocateRequest) error
}

type UpdateChannelMaker

type UpdateChannelMaker interface {
	MakeUpdateChannel(proto.GetUpdatesRequest) <-chan proto.Update
	CloseUpdateChannel(<-chan proto.Update)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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