Documentation
¶
Index ¶
- Variables
- func CheckCacheSentinelLocation() error
- func LaunchBrokerListener(ctx context.Context, egrp *errgroup.Group, engine *gin.Engine) (err error)
- func LaunchDirectorTestFileCleanup(ctx context.Context)
- func LaunchFedTokManager(ctx context.Context, egrp *errgroup.Group, cache server_structs.XRootDServer, ...)
- func LaunchRequestListener(ctx context.Context, egrp *errgroup.Group) error
- func RegisterCacheAPI(router *gin.Engine, ctx context.Context, egrp *errgroup.Group)
- type CacheServer
- func (server *CacheServer) CreateAdvertisement(name, id, originUrl, originWebUrl string, downtimes []server_structs.Downtime) (*server_structs.OriginAdvertiseV2, error)
- func (server *CacheServer) GetAdTokCfg(directorUrl string) (adTokCfg server_structs.AdTokCfg, err error)
- func (server *CacheServer) GetFedTokLocation() string
- func (server *CacheServer) GetNamespaceAdsFromDirector() error
- func (server *CacheServer) GetPids() (pids []int)
- func (server *CacheServer) GetServerType() server_structs.ServerType
- func (server *CacheServer) SetFilters()
- func (server *CacheServer) SetPids(pids []int)
- type Cinfo
- type Store
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
Launch a goroutine that listens for socket reversal requests from the XRootD daemon
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 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) SetFCheckSumCheck ¶
SetFCheckSumCheck sets the f_cksum_check value. val is expected to fit within 3 bits.