Skip to content

Conversation

@ryuwd
Copy link
Contributor

@ryuwd ryuwd commented Jan 21, 2026

Summary

Adds ReplicaCatalog, a Pydantic model for mapping Logical File Names (LFNs) to their physical replicas across distributed storage elements.

Description

ReplicaCatalog provides a structured, validated representation of file replica information intended to be stored in JSON format. It serves as a more user-friendly replacement for Pool XML Catalog.

Key features:

  • LFN/PFN validation: Automatic stripping of LFN: and PFN: prefixes, with validation
  • Checksum support: Adler-32 (8 hex chars) and GUID (UUID format) checksums with format validation
  • Storage element tracking: Each replica is associated with a storage element identifier
  • Optional metadata: File size in bytes and checksum information

Example usage:

from diracx.core.replica_catalog import ReplicaCatalog

catalog = ReplicaCatalog(root={
    "/lhcb/MC/2024/file.dst": {
        "replicas": [
            {"url": "https://storage1.cern.ch/file.dst", "se": "CERN-DST"},
            {"url": "https://storage2.in2p3.fr/file.dst", "se": "IN2P3-DST"},
        ],
        "size_bytes": 1048576,
        "checksum": {"adler32": "788c5caa"},
    }
})

@ryuwd ryuwd changed the title feat (core): added replica catalog to core feat (core): added replica catalog Jan 21, 2026
@read-the-docs-community
Copy link

read-the-docs-community bot commented Jan 21, 2026

Documentation build overview

📚 diracx | 🛠️ Build #31090867 | 📁 Comparing 6693b87 against latest (6525e65)


🔍 Preview build

Show files changed (1 files in total): 📝 1 modified | ➕ 0 added | ➖ 0 deleted
File Status
admin/reference/values/index.html 📝 modified

test: add unit tests for replica catalog model

fix: forrmatting

docs: replica catalog explanations

fix: more linting messages, refactoring needed
@chrisburr
Copy link
Member

I think we need to decide on the layout of core as replica_catalogue feels to specific for the top level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants