ugm

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 13 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 {
	locking.RWMutex
	// contains filtered or unexported fields
}

func (*GroupTracker) GetGroupResourceUsageDAOInfo

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

func (*GroupTracker) IsQueuePathTrackedCompletely added in v1.4.0

func (gt *GroupTracker) IsQueuePathTrackedCompletely(hierarchy []string) bool

func (*GroupTracker) IsUnlinkRequired added in v1.4.0

func (gt *GroupTracker) IsUnlinkRequired(hierarchy []string) bool

func (*GroupTracker) UnlinkQT added in v1.4.0

func (gt *GroupTracker) UnlinkQT(hierarchy []string) bool

type LimitConfig added in v1.4.0

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

LimitConfig Holds limit settings of wild card user/group

type Manager

type Manager struct {
	locking.RWMutex
	// 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) CanRunApp added in v1.4.0

func (m *Manager) CanRunApp(queuePath, applicationID string, user security.UserGroup) bool

CanRunApp checks the maxApplications for this specific application that runs as the user and group.

func (*Manager) ClearConfigLimits added in v1.4.0

func (m *Manager) ClearConfigLimits()

ClearConfigLimits only for tests

func (*Manager) ClearGroupTrackers

func (m *Manager) ClearGroupTrackers()

ClearGroupTrackers only for tests

func (*Manager) ClearUserTrackers

func (m *Manager) ClearUserTrackers()

ClearUserTrackers only for tests

func (*Manager) DecreaseTrackedResource

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

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

GetGroupResources only for tests

func (*Manager) GetGroupTracker

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

GetGroupTracker returns the GroupTracker object if defined for the group and a nil otherwise.

func (*Manager) GetGroupsResources

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

func (*Manager) GetUserResources

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

GetUserResources only for tests

func (*Manager) GetUserTracker

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

GetUserTracker returns the UserTracker object if defined for the user and a nil otherwise.

func (*Manager) GetUsersResources

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

func (*Manager) Headroom added in v1.4.0

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

Headroom calculates the headroom for this specific application that runs as the user and group.

func (*Manager) IncreaseTrackedResource

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

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.

func (*Manager) UpdateConfig added in v1.4.0

func (m *Manager) UpdateConfig(config configs.QueueConfig, queuePath string) error

type QueueTracker

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

func (*QueueTracker) IsQueuePathTrackedCompletely added in v1.4.0

func (qt *QueueTracker) IsQueuePathTrackedCompletely(hierarchy []string) bool

IsQueuePathTrackedCompletely Traverse queue path upto the end queue through its linkage to confirm entire queuePath has been tracked completely or not

func (*QueueTracker) IsUnlinkRequired added in v1.4.0

func (qt *QueueTracker) IsUnlinkRequired(hierarchy []string) bool

IsUnlinkRequired Traverse queue path upto the leaf queue and decide whether linkage needs to be removed or not based on the running applications. If there are any running applications in end leaf queue, we should remove the linkage between the leaf and its parent queue using UnlinkQT method. Otherwise, we should leave as it is.

func (*QueueTracker) UnlinkQT added in v1.4.0

func (qt *QueueTracker) UnlinkQT(hierarchy []string) bool

UnlinkQT Traverse queue path upto the end queue. If end queue has any more child queue trackers, then goes upto each child queue and removes the linkage with its immediate parent

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) bool
	DecreaseTrackedResource(queuePath, applicationID string, usage *resources.Resource, user security.UserGroup, removeApp bool) bool
}

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

type UserTracker

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

func (*UserTracker) GetUserResourceUsageDAOInfo

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

func (*UserTracker) IsQueuePathTrackedCompletely added in v1.4.0

func (ut *UserTracker) IsQueuePathTrackedCompletely(hierarchy []string) bool

func (*UserTracker) IsUnlinkRequired added in v1.4.0

func (ut *UserTracker) IsUnlinkRequired(hierarchy []string) bool

func (*UserTracker) UnlinkQT added in v1.4.0

func (ut *UserTracker) UnlinkQT(hierarchy []string) bool

Jump to

Keyboard shortcuts

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