Filesystem Provider
Implementation of the data provider layer for the local filesystem.
This implementation supports both the old uncompressed and new compressed (Zstandard) formats.
This implementation stores the data in files, in directories named after the job id (8 digits zero-padded).
Classes:
Name | Description |
---|---|
- FSDataEntry |
Filesystem data entry implementation. |
- FSDictEntry |
Filesystem dictionary entry implementation. |
- FSJobEntry |
Filesystem job entry implementation. |
- FSDataProvider |
Filesystem data provider implementation. |
- FSDictProvider |
Filesystem dictionary provider implementation. |
FSDataEntry
Bases: DataEntry
Filesystem data entry implementation.
This implementation supports both the old uncompressed and new compressed (Zstandard) formats.
Source code in src/lhcbdirac_log/providers/filesystem/accessors.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
__init__(path, job, *, compressed, readonly)
[Internal] Initialize the data entry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
PathLike[str] | str
|
the data file path |
required |
job |
int
|
the job id |
required |
compressed |
bool
|
indicate whether the underlying data is compressed or not (in Zstandard) |
required |
readonly |
bool
|
indicate weather the data is read-only or not |
required |
Source code in src/lhcbdirac_log/providers/filesystem/accessors.py
44 45 46 47 48 49 50 51 52 53 54 |
|
FSDataProvider
Bases: DataProvider[FSJobEntry]
Filesystem data provider implementation.
This implementation supports both the old uncompressed and new compressed (Zstandard) formats.
Source code in src/lhcbdirac_log/providers/filesystem/providers.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
folder: Path
property
Get the folder path.
Returns:
Type | Description |
---|---|
Path
|
the folder path |
__init__(folder, dict_provider=None, *, readonly=False)
Initialize the data provider.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder |
PathLike[str] | str
|
the folder path |
required |
dict_provider |
DictProvider | None
|
the dict provider associated to the data (default is None), specifying this implies that the provided data are compressed |
None
|
readonly |
bool
|
indicate weather the provider is read-only or not (default: False) |
False
|
Source code in src/lhcbdirac_log/providers/filesystem/providers.py
106 107 108 109 110 111 112 113 114 115 116 |
|
FSDictEntry
Bases: DictEntry
Filesystem dictionary entry implementation.
Source code in src/lhcbdirac_log/providers/filesystem/accessors.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
__init__(path, config, data=None, zstd_id=None)
[Internal] Initialize the dictionary entry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
PathLike[str] | str
|
the dictionary file path |
required |
config |
Config
|
the configuration to use for precomputing the dictionary |
required |
data |
bytes | None
|
the dictionary data (create a new dict if not None) |
None
|
zstd_id |
int | None
|
the zstd dictionary id (None for unknown) |
None
|
Source code in src/lhcbdirac_log/providers/filesystem/accessors.py
87 88 89 90 91 92 93 94 95 96 97 |
|
FSDictProvider
Bases: DictProvider[FSDictEntry]
Filesystem dictionary provider implementation.
Source code in src/lhcbdirac_log/providers/filesystem/providers.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
folder: Path
property
Get the folder path.
Returns:
Type | Description |
---|---|
Path
|
the folder path |
__init__(folder, config=DEFAULT_CONFIG, *, readonly=False)
Initialize the dictionary provider.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder |
PathLike[str] | str
|
the folder path, where to store the dictionaries |
required |
config |
Config
|
the configuration to use for precomputing the dictionaries (default: DEFAULT_CONFIG) |
DEFAULT_CONFIG
|
readonly |
bool
|
indicate weather the provider is read-only or not (default: False) |
False
|
Source code in src/lhcbdirac_log/providers/filesystem/providers.py
40 41 42 43 44 45 46 47 48 49 50 |
|
FSJobEntry
Bases: JobEntry[FSDataEntry]
Filesystem job entry implementation.
This implementation supports both the old uncompressed and new compressed (Zstandard) formats.
Source code in src/lhcbdirac_log/providers/filesystem/accessors.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|
folder: Path
property
Get the job folder path.
Returns:
Type | Description |
---|---|
Path
|
the job folder path |
__init__(folder, job, *, compressed, readonly, create=True, exists_ok=True)
[Internal] Initialize the job entry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder |
Path
|
the production folder path (parent of the job folders) |
required |
job |
int
|
the job id |
required |
compressed |
bool
|
indicate whether the underlying data is compressed or not (in Zstandard) |
required |
readonly |
bool
|
indicate weather the job is read-only or not |
required |
create |
bool
|
create the job folder if it doesn't exist, otherwise raise an error |
True
|
exists_ok |
bool
|
ignore the error if the job folder already exists |
True
|
Raises:
Type | Description |
---|---|
JobExistsError
|
if the job folder already exists and exists_ok is False |
JobNotExistsError
|
if the job folder doesn't exist and create is False |
Source code in src/lhcbdirac_log/providers/filesystem/accessors.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|