resourcegroups

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package resourcegroups publishes the generated Trino resource-group document (#598) into the tables Trino's database resource group manager reads (#599). The write is idempotent (it replaces the environment's groups and selectors wholesale) and every write is a new revision, so a rollback re-applies an earlier one. Trino reloads the tables every second, so publishing is the reload: no coordinator restart is involved.

Index

Constants

This section is empty.

Variables

View Source
var ErrRevisionNotFound = errors.New("resource group revision not found")

ErrRevisionNotFound means the revision to roll back to does not exist.

Functions

This section is empty.

Types

type Store

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

Store writes resource groups through the GORM store.

func New

func New(db *gorm.DB) *Store

New builds a store writing through db.

func (*Store) Rollback

func (s *Store) Rollback(ctx context.Context, engineID db.UUID, environment string, revision int) error

Rollback re-publishes the configuration of an earlier revision as a new write, restoring the tables to that state.

func (*Store) Write

func (s *Store) Write(ctx context.Context, engineID db.UUID, environment string, doc workload.ResourceGroups) (int, error)

Write validates and publishes the document for one cluster's environment, recording a new revision. It returns the revision number.

Directories

Path Synopsis
Package publish writes the generated Trino resource-group document through the narrow Writer surface the store implements (ADR 0020).
Package publish writes the generated Trino resource-group document through the narrow Writer surface the store implements (ADR 0020).

Jump to

Keyboard shortcuts

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