Skip to content

Translation

Classes

RSEDeterministicScopeTranslation

RSEDeterministicScopeTranslation(vo='def')

Translates a pfn dictionary into a scope and name

Functions

_module_init_ classmethod
_module_init_()

Registers the included scope extraction algorithms

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: Callable

name

Algorithm name used for registration.

TYPE: Optional[str] DEFAULT: None

_default staticmethod
_default(parsed_pfn)

Translate pfn to name/scope pair

PARAMETER DESCRIPTION
parsed_pfn

dictionary representing pfn containing: - path: str, - name: str

TYPE: Mapping[str, str]

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: None

rse_attributes

A dictionary of RSE-specific attributes for use in the translation.

DEFAULT: None

protocol_attributes

A dictionary of RSE/protocol-specific attributes.

DEFAULT: None

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 name is an algorithm supported by the translator class, False otherwise

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 lfn2pfn_callable.__name__ is used.

DEFAULT: None

__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.

_module_init_ classmethod
_module_init_()

Initialize the class object on first module load.

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