concurrent_cache

package
v0.0.0-...-eec02a6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

Initialize resets global cache state. Exported for unit tests.

Types

type AutogrowPolicyResult

type AutogrowPolicyResult struct {
	Read   *storage.AutogrowPolicy
	Upsert func(*storage.AutogrowPolicy)
	Delete func()
}

type BackendDependent

type BackendDependent interface {
	GetBackendID() string
}

type BackendResult

type BackendResult struct {
	Read   storage.Backend
	Upsert func(storage.Backend)
	Delete func()
}

type GroupSnapshotResult

type GroupSnapshotResult struct {
	Read   *storage.GroupSnapshot
	Upsert func(*storage.GroupSnapshot)
	Delete func()
}

type NodeDependent

type NodeDependent interface {
	GetNodeID() string
}

type NodeResult

type NodeResult struct {
	Read   *models.Node
	Upsert func(*models.Node)
	Delete func()
}

type Result

type Result struct {
	Nodes              []*models.Node
	StorageClasses     []*storageclass.StorageClass
	Backends           []storage.Backend
	Volumes            []*storage.Volume
	SubordinateVolumes []*storage.Volume
	VolumePublications []*models.VolumePublication
	Snapshots          []*storage.Snapshot
	AutogrowPolicies   []*storage.AutogrowPolicy
	GroupSnapshots     []*storage.GroupSnapshot

	Node              NodeResult
	StorageClass      StorageClassResult
	Backend           BackendResult
	Volume            VolumeResult
	SubordinateVolume SubordinateVolumeResult
	VolumePublication VolumePublicationResult
	Snapshot          SnapshotResult
	AutogrowPolicy    AutogrowPolicyResult
	GroupSnapshot     GroupSnapshotResult
}

func Lock

func Lock(ctx context.Context, queries ...[]Subquery) (context.Context, []Result, func(), error)

Lock locks resources from queries. Returns a context that can be used with NestedLock.

func NestedLock

func NestedLock(ctx context.Context, queries ...[]Subquery) (context.Context, []Result, func(), error)

NestedLock extends locks held in ctx. New locks must not upgrade existing read locks, must sort after the last held lock, and must not include newKey. Returns an error otherwise.

type SmartCopier

type SmartCopier interface {
	SmartCopy() interface{}
}

SmartCopier is an interface for objects that can be copied for the cache. If the object implements interior mutability, it may be implemented as a shallow copy. If not, it is implemented as a deep copy.

type SnapshotResult

type SnapshotResult struct {
	Read   *storage.Snapshot
	Upsert func(*storage.Snapshot)
	Delete func()
}

type StorageClassResult

type StorageClassResult struct {
	Read   *storageclass.StorageClass
	Upsert func(*storageclass.StorageClass)
	Delete func()
}

type SubordinateVolumeResult

type SubordinateVolumeResult struct {
	Read   *storage.Volume
	Upsert func(*storage.Volume)
	Delete func()
}

type Subquery

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

func DeleteAutogrowPolicy

func DeleteAutogrowPolicy(id string) Subquery

func DeleteBackend

func DeleteBackend(id string) Subquery

func DeleteGroupSnapshot

func DeleteGroupSnapshot(id string) Subquery

func DeleteNode

func DeleteNode(id string) Subquery

func DeleteSnapshot

func DeleteSnapshot(id string) Subquery

func DeleteStorageClass

func DeleteStorageClass(id string) Subquery

func DeleteSubordinateVolume

func DeleteSubordinateVolume(id string) Subquery

func DeleteVolume

func DeleteVolume(id string) Subquery

func DeleteVolumePublication

func DeleteVolumePublication(volumeID, nodeID string) Subquery

func InconsistentReadAutogrowPolicy

func InconsistentReadAutogrowPolicy(id string) Subquery

func InconsistentReadBackend

func InconsistentReadBackend(id string) Subquery

func InconsistentReadBackendByName

func InconsistentReadBackendByName(name string) Subquery

func InconsistentReadGroupSnapshot

func InconsistentReadGroupSnapshot(id string) Subquery

func InconsistentReadNode

func InconsistentReadNode(id string) Subquery

func InconsistentReadSnapshot

func InconsistentReadSnapshot(id string) Subquery

func InconsistentReadStorageClass

func InconsistentReadStorageClass(id string) Subquery

func InconsistentReadSubordinateVolume

func InconsistentReadSubordinateVolume(id string) Subquery

func InconsistentReadVolume

func InconsistentReadVolume(id string) Subquery

func InconsistentReadVolumePublication

func InconsistentReadVolumePublication(volumeID, nodeID string) Subquery

func ListAutogrowPolicies

func ListAutogrowPolicies() Subquery

func ListBackends

func ListBackends() Subquery

func ListCloneVolumesBySnapshot

func ListCloneVolumesBySnapshot(snapshotName, internalSnapshotName string) Subquery

ListCloneVolumesBySnapshot returns all clone volumes created from a snapshot. A clone volume snapshot source can be the snapshot name or internal snapshot name. Both snapshot name and internal snapshot name must be provided. If either is empty, no clone volumes will be returned.

func ListGroupSnapshots

func ListGroupSnapshots() Subquery

func ListNodes

func ListNodes() Subquery

func ListReadOnlyCloneVolumes

func ListReadOnlyCloneVolumes() Subquery

func ListReadOnlyCloneVolumesForSources

func ListReadOnlyCloneVolumesForSources(sourceVolumeNames ...string) Subquery

ListReadOnlyCloneVolumesForSources returns all read-only clone volumes whose CloneSourceVolume matches any of the provided source volume names.

func ListSnapshots

func ListSnapshots() Subquery

func ListSnapshotsByInternalName

func ListSnapshotsByInternalName(internalName string) Subquery

func ListSnapshotsByName

func ListSnapshotsByName(snapshotName string) Subquery

func ListSnapshotsForGroup

func ListSnapshotsForGroup(groupName string) Subquery

func ListSnapshotsForVolume

func ListSnapshotsForVolume(volumeName string) Subquery

func ListStorageClasses

func ListStorageClasses() Subquery

func ListSubordinateVolumes

func ListSubordinateVolumes() Subquery

func ListSubordinateVolumesForAutogrowPolicy

func ListSubordinateVolumesForAutogrowPolicy(autogrowPolicyName string) Subquery

ListSubordinateVolumesForAutogrowPolicy returns all subordinate volumes using a specific autogrow policy

func ListSubordinateVolumesForAutogrowPolicyReevaluation

func ListSubordinateVolumesForAutogrowPolicyReevaluation(policyName string) Subquery

ListSubordinateVolumesForAutogrowPolicyReevaluation returns subordinate volumes that might need to use the given policy. This includes subordinate volumes that: 1. Have a volume-level autogrow policy matching the policy name (case-insensitive), OR 2. Have no volume-level autogrow policy (might inherit from StorageClass) AND are not already using the policy.

func ListSubordinateVolumesForStorageClass

func ListSubordinateVolumesForStorageClass(scName string) Subquery

ListSubordinateVolumesForStorageClass returns all subordinate volumes using a specific storage class

func ListSubordinateVolumesForStorageClassWithoutAutogrowOverride

func ListSubordinateVolumesForStorageClassWithoutAutogrowOverride(scName string) Subquery

ListSubordinateVolumesForStorageClassWithoutAutogrowOverride returns subordinate volumes using a specific storage class that have NO volume-level autogrow policy (i.e., they inherit from StorageClass)

func ListSubordinateVolumesForVolume

func ListSubordinateVolumesForVolume(volumeID string) Subquery

func ListVolumePublications

func ListVolumePublications() Subquery

func ListVolumePublicationsForNode

func ListVolumePublicationsForNode(nodeName string) Subquery

func ListVolumePublicationsForVolume

func ListVolumePublicationsForVolume(volumeName string) Subquery

func ListVolumes

func ListVolumes() Subquery

func ListVolumesByInternalName

func ListVolumesByInternalName(internalVolName string) Subquery

func ListVolumesForAutogrowPolicy

func ListVolumesForAutogrowPolicy(autogrowPolicyName string) Subquery

ListVolumesForAutogrowPolicy returns all volumes using a specific autogrow policy

func ListVolumesForAutogrowPolicyReevaluation

func ListVolumesForAutogrowPolicyReevaluation(policyName string) Subquery

ListVolumesForAutogrowPolicyReevaluation returns volumes that might need to use the given policy. This includes volumes that: 1. Have a volume-level autogrow policy matching the policy name (case-insensitive), OR 2. Have no volume-level autogrow policy (might inherit from StorageClass) AND are not already using the policy.

func ListVolumesForBackend

func ListVolumesForBackend(backendID string) Subquery

func ListVolumesForNode

func ListVolumesForNode(nodeName string) Subquery

func ListVolumesForStorageClass

func ListVolumesForStorageClass(scName string) Subquery

ListVolumesForStorageClass returns all volumes using a specific storage class

func ListVolumesForStorageClassWithoutAutogrowOverride

func ListVolumesForStorageClassWithoutAutogrowOverride(scName string) Subquery

ListVolumesForStorageClassWithoutAutogrowOverride returns volumes using a specific storage class that have NO volume-level autogrow policy (i.e., they inherit from StorageClass)

func LockCache

func LockCache() Subquery

LockCache takes a write lock on the cache root, which blocks all other operations.

func Query

func Query(query ...Subquery) []Subquery

func ReadAutogrowPolicy

func ReadAutogrowPolicy(id string) Subquery

func ReadBackend

func ReadBackend(id string) Subquery

func ReadBackendByName

func ReadBackendByName(name string) Subquery

func ReadGroupSnapshot

func ReadGroupSnapshot(id string) Subquery

func ReadNode

func ReadNode(id string) Subquery

func ReadSnapshot

func ReadSnapshot(id string) Subquery

func ReadStorageClass

func ReadStorageClass(id string) Subquery

func ReadSubordinateVolume

func ReadSubordinateVolume(id string) Subquery

func ReadVolume

func ReadVolume(id string) Subquery

func ReadVolumePublication

func ReadVolumePublication(volumeID, nodeID string) Subquery

func UpsertAutogrowPolicy

func UpsertAutogrowPolicy(id string) Subquery

func UpsertBackend

func UpsertBackend(id, name, newName string) Subquery

func UpsertGroupSnapshot

func UpsertGroupSnapshot(id string) Subquery

func UpsertNode

func UpsertNode(id string) Subquery

func UpsertSnapshot

func UpsertSnapshot(volumeID, id string) Subquery

func UpsertStorageClass

func UpsertStorageClass(id string) Subquery

func UpsertSubordinateVolume

func UpsertSubordinateVolume(id, volumeID string) Subquery

func UpsertVolume

func UpsertVolume(volumeName, backendID string) Subquery

func UpsertVolumeByBackendName

func UpsertVolumeByBackendName(volumeName, backendName string) Subquery

func UpsertVolumeByInternalName

func UpsertVolumeByInternalName(volumeName, internalVolumeName, newInternalVolumeName, backendID string) Subquery

func UpsertVolumePublication

func UpsertVolumePublication(volumeID, nodeID string) Subquery

type UniqueKey

type UniqueKey interface {
	GetUniqueKey() string
}

type VolumeDependent

type VolumeDependent interface {
	GetVolumeID() string
}

type VolumePublicationResult

type VolumePublicationResult struct {
	Read   *models.VolumePublication
	Upsert func(*models.VolumePublication)
	Delete func()
}

type VolumeResult

type VolumeResult struct {
	Read   *storage.Volume
	Upsert func(*storage.Volume)
	Delete func()
}

Jump to

Keyboard shortcuts

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