cache

package
v0.0.0-...-47a3e83 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinFedTokenTickerRate = 1 * time.Minute

Can use this mechanism to override the minimum for the sake of tests

Functions

func CheckCacheSentinelLocation

func CheckCacheSentinelLocation() error

Check for the sentinel file

func LaunchBrokerListener

func LaunchBrokerListener(ctx context.Context, egrp *errgroup.Group, engine *gin.Engine) (err error)

Launch goroutines that continuously poll the broker for requests.

This will allow the cache to receive connection reversals from director via the broker for its web API. It allows the cache to keep its web API behind a firewall, while still allowing the director to connect to it for functionality such as Prometheus metrics.

func LaunchDirectorTestFileCleanup

func LaunchDirectorTestFileCleanup(ctx context.Context)

Periodically scan the ${Cache.NamespaceLocation}/pelican/monitoring directory to clean up test files TODO: Director test files should be under /pelican/monitoring/directorTest and the file names should have director-test- as the prefix

func LaunchFedTokManager

func LaunchFedTokManager(ctx context.Context, egrp *errgroup.Group, cache server_structs.XRootDServer, copyToXrootdDir server_utils.FedTokCopyToXrootdFunc)

LaunchFedTokManager starts the federation token refresh loop. When Server.DropPrivileges is true, the token file is chown'ed to the xrootd user and group by xrdhttp-pelican plugin (via xrootd.FileCopyToXrootdDir(false, 9, file)); pass nil to skip (e.g. in tests).

func LaunchRequestListener

func LaunchRequestListener(ctx context.Context, egrp *errgroup.Group) error

Launch a goroutine that listens for socket reversal requests from the XRootD daemon

func RegisterCacheAPI

func RegisterCacheAPI(router *gin.Engine, ctx context.Context, egrp *errgroup.Group)

Types

type CacheServer

type CacheServer struct {
	server_structs.NamespaceHolder
	// contains filtered or unexported fields
}

func (*CacheServer) CreateAdvertisement

func (server *CacheServer) CreateAdvertisement(name, id, originUrl, originWebUrl string, downtimes []server_structs.Downtime) (*server_structs.OriginAdvertiseV2, error)

func (*CacheServer) GetAdTokCfg

func (server *CacheServer) GetAdTokCfg(directorUrl string) (adTokCfg server_structs.AdTokCfg, err error)

func (*CacheServer) GetFedTokLocation

func (server *CacheServer) GetFedTokLocation() string

func (*CacheServer) GetNamespaceAdsFromDirector

func (server *CacheServer) GetNamespaceAdsFromDirector() error

func (*CacheServer) GetPids

func (server *CacheServer) GetPids() (pids []int)

func (*CacheServer) GetServerType

func (server *CacheServer) GetServerType() server_structs.ServerType

func (*CacheServer) SetFilters

func (server *CacheServer) SetFilters()

func (*CacheServer) SetPids

func (server *CacheServer) SetPids(pids []int)

type Cinfo

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

func (*Cinfo) Serialize

func (info *Cinfo) Serialize() ([]byte, error)

type Store

type Store struct {
	BufferSize   int64
	FileSize     int64
	CreationTime int64 // Unix time in seconds
	NoCkSumTime  int64 // Unix time in seconds
	AccessCnt    uint64
	Status       uint32 // Checksum status
	AStatSize    int32  // Should always be unset (0) unless you know what you are doing
}

func (*Store) Serialize

func (st *Store) Serialize() ([]byte, error)

func (*Store) SetFCheckSumCheck

func (st *Store) SetFCheckSumCheck(val uint32)

SetFCheckSumCheck sets the f_cksum_check value. val is expected to fit within 3 bits.

Jump to

Keyboard shortcuts

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