ugm

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupTracker

type GroupTracker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*GroupTracker) GetGroupResourceUsageDAOInfo

func (gt *GroupTracker) GetGroupResourceUsageDAOInfo() *dao.GroupResourceUsageDAOInfo

type Manager

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

Manager implements tracker. A User Group Manager to track the usage for both user and groups. Holds object of both user and group trackers

func GetUserManager

func GetUserManager() *Manager

func (*Manager) ClearGroupTrackers

func (m *Manager) ClearGroupTrackers()

func (*Manager) ClearUserTrackers

func (m *Manager) ClearUserTrackers()

ClearUserTrackers only for tests

func (*Manager) DecreaseTrackedResource

func (m *Manager) DecreaseTrackedResource(queuePath string, applicationID string, usage *resources.Resource, user security.UserGroup, removeApp bool) error

DecreaseTrackedResource Decrease the resource usage for the given user group and queue path combination. As and when every allocation or asks release happens, corresponding user and group resource usage would be decreased against specific application. When the final asks release happens, removeApp should be set to true and application itself would be removed from the tracker and no more usage would be tracked further for that specific application.

func (*Manager) GetGroupResources

func (m *Manager) GetGroupResources(group string) *resources.Resource

func (*Manager) GetGroupTracker

func (m *Manager) GetGroupTracker(group string) *GroupTracker

func (*Manager) GetGroupsResources

func (m *Manager) GetGroupsResources() []*GroupTracker

func (*Manager) GetUserResources

func (m *Manager) GetUserResources(user security.UserGroup) *resources.Resource

func (*Manager) GetUserTracker

func (m *Manager) GetUserTracker(user string) *UserTracker

func (*Manager) GetUsersResources

func (m *Manager) GetUsersResources() []*UserTracker

func (*Manager) IncreaseTrackedResource

func (m *Manager) IncreaseTrackedResource(queuePath string, applicationID string, usage *resources.Resource, user security.UserGroup) error

IncreaseTrackedResource Increase the resource usage for the given user group and queue path combination. As and when every allocation or asks requests fulfilled on application, corresponding user and group resource usage would be increased against specific application.

type QueueTracker

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

type Tracker

type Tracker interface {
	GetUserResources(user security.UserGroup) *resources.Resource
	GetGroupResources(group string) *resources.Resource

	GetUsersResources() []*UserTracker
	GetGroupsResources() []*GroupTracker

	IncreaseTrackedResource(queuePath, applicationID string, usage *resources.Resource, user security.UserGroup) error
	DecreaseTrackedResource(queuePath, applicationID string, usage *resources.Resource, user security.UserGroup, removeApp bool) error
}

Tracker Defines a set of interfaces to track and retrieve the user group resource usage

type UserTracker

type UserTracker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*UserTracker) GetUserResourceUsageDAOInfo

func (ut *UserTracker) GetUserResourceUsageDAOInfo() *dao.UserResourceUsageDAOInfo

Jump to

Keyboard shortcuts

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