Yars::Tools -- various utility functions dealing with servers, hosts, etc
Just some useful functions here.
Refresh the configuration data cached in memory.
Given an md5 digest, calculate the root directory of this file. Undef is returned if this file does not belong on the current host.
Get a hash from disk to list of buckets for this server.
Given a disk root, return true unless the disk is marked down. A disk is down if the state file indicates it, or if it exists but is unwriteable.
Disk is not up.
Return true iff the disk is on this server.
Check to see if a remote server is up or down.
Mark a disk as up or down.
Given an md5, return the url for the server for this file.
Return a map from bucket prefix to server url.
Calculate the directory of an md5 on disk. Optionally pass a second parameter to force it onto a particular disk.
Find a server which is stashing this file, if one exists. Parameters : $c - controller $filename - filename $digest - digest
Find a local directory stashing this file, if one exists. Parameters : $filename - filename $digest - digest Returns : The directory or false.
Does this server exist?
Returns the url of the current server.
Return all the local directory roots, in a random order.
Return all the other urls, in a random order.
Given a direcory, traverse upwards until encountering a local disk root or a non-empty directory, and remove all empty dirs.
Count the number of files in a directory tree.
Given a size, format it like df -kh
Given a filename and an Asset, return true iff the content is the same for both.
Convert from hex to base 64.