Skip to content

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

name

Algorithm name used for registration.

TYPE: Optional[str] DEFAULT: None

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.

TYPE: Optional[str] DEFAULT: None

rse_attributes

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

TYPE: Optional[RSESettingsDict] DEFAULT: None

protocol_attributes

A dictionary of RSE/protocol-specific attributes.

TYPE: Optional[dict[str, Any]] DEFAULT: None

Functions

supports classmethod
supports(name)

Check to see if a specific algorithm is supported.

PARAMETER DESCRIPTION
name

Name of the deterministic algorithm.

TYPE: str

RETURNS DESCRIPTION
bool

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.

TYPE: Callable

name

Algorithm name used for registration. If None, then lfn2pfn_callable.__name__ is used.

TYPE: Optional[str] 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.

TYPE: str

name

File name of the LFN.

TYPE: str

rse

RSE for PFN (ignored)

TYPE: str

rse_attrs

RSE attributes for PFN (ignored)

TYPE: dict[str, Any]

protocol_attrs

RSE protocol attributes for PFN (ignored)

TYPE: dict[str, Any]

RETURNS DESCRIPTION
str

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.

TYPE: str

name

File name of the LFN.

TYPE: str

rse

RSE for PFN (ignored)

TYPE: str

rse_attrs

RSE attributes for PFN (ignored)

TYPE: dict[str, Any]

protocol_attrs

RSE protocol attributes for PFN (ignored)

TYPE: dict[str, Any]

RETURNS DESCRIPTION
str

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

TYPE: str

RETURNS DESCRIPTION
str

RSE specific URI of the physical file