Yars::Tools - various utility functions dealing with servers, hosts, etc
Just some useful functions here.
Create a new instance of Yars::Tools
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.
This is the same as disk_is_up, but doesn't trust the operating system, and tries to write a file to the disk's temp directory and verify that the file is not of zero size.
Disk is not up.
Return true if 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 directory, traverse upwards until encountering a local disk root or a non-empty directory, and remove all empty directories.
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 if the content is the same for both.
Convert from hex to base 64.
Original author: Marty Brandon
Current maintainer: Graham Ollis <firstname.lastname@example.org>
This software is copyright (c) 2013 by NASA GSFC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.