dmwm/AsyncStageout — pull request #4116 by AndresTanasijczuk (2014-02-28 19:22:32+00:00)
Title: Adding function to translate SE names into CMS site names

Added a function in AsyncStageOut __init__.py that takes as input a list of site names (the list can contain a mix of SE names and CMS site names) and returns another list of the same length and order preserved where the SE names were replaced by their corresponding CMS site names.
The translation is done using PhEDEx: the function creates a map (called se_site_map) with SEnames as keys and CMS site names as values and uses the map for the translation.
The function is used in two places:
1) in the TransferDaemon after getting the list of active sites, before creating the tfc_map (=> this means the tfc_map keeps CMS site names as keys);
2) in the TransferWorker before using the tfc_map (the tfc_map has CMS site names as keys while the site name in the worker is read from couch).

The connection to PhEDEx is done when creating/updating the se_site_map, and this is done:
A) in the TransferDaemon (once every 30 minutes);
B) in each TransferWorker instance (i.e. per user, per retry).
Notice, the TransferWorker creates its own se_site_map, it doesn't use the one created by the TransferDaemon. Maybe we can avoid this and use the map from the daemon? I didn't know how to do this, unless I pass the map as a new argument to the ftscp function so that it passes it then to the TransferWorker.