Translation
Classes¶
RSEDeterministicScopeTranslation ¶
RSEDeterministicScopeTranslation(vo='def')
Translates a pfn dictionary into a scope and name
Functions¶
register
classmethod
¶
register(pfn2lfn_callable, name=None)
Provided a callable function, register it as one of the valid PFN2LFN algorithms.
PARAMETER | DESCRIPTION |
---|---|
pfn2lfn_callable
|
Callable function to use.
TYPE:
|
name
|
Algorithm name used for registration.
TYPE:
|
_default
staticmethod
¶
_default(parsed_pfn)
Translate pfn to name/scope pair
PARAMETER | DESCRIPTION |
---|---|
parsed_pfn
|
dictionary representing pfn containing: - path: str, - name: str
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[str, str]
|
tuple containing name, scope |
RSEDeterministicTranslation ¶
RSEDeterministicTranslation(
rse=None, rse_attributes=None, protocol_attributes=None
)
Execute the logic for translating a LFN to a path.
Initialize a translator object from the RSE, its attributes, and the protocol-specific attributes.
PARAMETER | DESCRIPTION |
---|---|
rse
|
Name of RSE for this translation.
DEFAULT:
|
rse_attributes
|
A dictionary of RSE-specific attributes for use in the translation.
DEFAULT:
|
protocol_attributes
|
A dictionary of RSE/protocol-specific attributes.
DEFAULT:
|
Functions¶
supports
classmethod
¶
supports(name)
Check to see if a specific algorithm is supported.
PARAMETER | DESCRIPTION |
---|---|
name
|
Name of the deterministic algorithm.
|
RETURNS | DESCRIPTION |
---|---|
True if |
register
classmethod
¶
register(lfn2pfn_callable, name=None)
Provided a callable function, register it as one of the valid LFN2PFN algorithms.
The callable will receive five arguments: - scope: Scope of the LFN. - name: LFN's path name - rse: RSE name the translation is being done for. - rse_attributes: Attributes of the RSE. - protocol_attributes: Attributes of the RSE's protocol The return value should be the last part of the PFN - it will be appended to the rest of the URL.
PARAMETER | DESCRIPTION |
---|---|
lfn2pfn_callable
|
Callable function to use for generating paths.
|
name
|
Algorithm name used for registration. If None, then
DEFAULT:
|
__hash
staticmethod
¶
__hash(scope, name, rse, rse_attrs, protocol_attrs)
Given a LFN, turn it into a sub-directory structure using a hash function.
This takes the MD5 of the LFN and uses the first four characters as a subdirectory name.
PARAMETER | DESCRIPTION |
---|---|
scope
|
Scope of the LFN.
|
name
|
File name of the LFN.
|
rse
|
RSE for PFN (ignored)
|
rse_attrs
|
RSE attributes for PFN (ignored)
|
protocol_attrs
|
RSE protocol attributes for PFN (ignored)
|
RETURNS | DESCRIPTION |
---|---|
Path for use in the PFN generation. |
__identity
staticmethod
¶
__identity(scope, name, rse, rse_attrs, protocol_attrs)
Given a LFN, convert it directly to a path using the mapping:
scope:path -> scope/path
PARAMETER | DESCRIPTION |
---|---|
scope
|
Scope of the LFN.
|
name
|
File name of the LFN.
|
rse
|
RSE for PFN (ignored)
|
rse_attrs
|
RSE attributes for PFN (ignored)
|
protocol_attrs
|
RSE protocol attributes for PFN (ignored)
|
RETURNS | DESCRIPTION |
---|---|
Path for use in the PFN generation. |
path ¶
path(scope, name)
Transforms the logical file name into a PFN's path.
PARAMETER | DESCRIPTION |
---|---|
lfn
|
filename
|
scope
|
scope
|
RETURNS | DESCRIPTION |
---|---|
RSE specific URI of the physical file |