|
PACS System 0.1.0
PACS DICOM system library
|
#include <s3_storage.h>


Classes | |
| class | s3_client_interface |
| Abstract interface for S3 client operations. More... | |
Public Member Functions | |
| s3_storage (const cloud_storage_config &config) | |
| Construct S3 storage with configuration. | |
| ~s3_storage () override | |
| Destructor. | |
| s3_storage (const s3_storage &)=delete | |
| Non-copyable (contains mutex) | |
| s3_storage & | operator= (const s3_storage &)=delete |
| s3_storage (s3_storage &&)=delete | |
| Non-movable (contains mutex) | |
| s3_storage & | operator= (s3_storage &&)=delete |
| auto | store (const core::dicom_dataset &dataset) -> VoidResult override |
| Store a DICOM dataset to S3. | |
| auto | retrieve (std::string_view sop_instance_uid) -> Result< core::dicom_dataset > override |
| Retrieve a DICOM dataset by SOP Instance UID. | |
| auto | remove (std::string_view sop_instance_uid) -> VoidResult override |
| Remove a DICOM object from S3. | |
| auto | exists (std::string_view sop_instance_uid) const -> bool override |
| Check if a DICOM instance exists in S3. | |
| auto | find (const core::dicom_dataset &query) -> Result< std::vector< core::dicom_dataset > > override |
| Find DICOM datasets matching query criteria. | |
| auto | get_statistics () const -> storage_statistics override |
| Get storage statistics. | |
| auto | verify_integrity () -> VoidResult override |
| Verify storage integrity. | |
| auto | store_with_progress (const core::dicom_dataset &dataset, progress_callback callback) -> VoidResult |
| Store with progress tracking. | |
| auto | retrieve_with_progress (std::string_view sop_instance_uid, progress_callback callback) -> Result< core::dicom_dataset > |
| Retrieve with progress tracking. | |
| auto | get_object_key (std::string_view sop_instance_uid) const -> std::string |
| Get the S3 object key for a SOP Instance UID. | |
| auto | bucket_name () const -> const std::string & |
| Get the bucket name. | |
| auto | rebuild_index () -> VoidResult |
| Rebuild the local index from S3. | |
| auto | is_connected () const -> bool |
| Check S3 connectivity. | |
Public Member Functions inherited from kcenon::pacs::storage::storage_interface | |
| virtual | ~storage_interface ()=default |
| Virtual destructor for proper polymorphic destruction. | |
| virtual auto | store_batch (const std::vector< core::dicom_dataset > &datasets) -> VoidResult |
| Store multiple DICOM datasets in a single operation. | |
| virtual auto | retrieve_batch (const std::vector< std::string > &sop_instance_uids) -> Result< std::vector< core::dicom_dataset > > |
| Retrieve multiple DICOM datasets by their SOP Instance UIDs. | |
Private Member Functions | |
| auto | build_object_key (std::string_view study_uid, std::string_view series_uid, std::string_view sop_uid) const -> std::string |
| Build S3 object key for a dataset. | |
| auto | upload_multipart (const std::string &key, const std::vector< std::uint8_t > &data, progress_callback callback) -> VoidResult |
| Execute multipart upload for large files. | |
Static Private Member Functions | |
| static auto | sanitize_uid (std::string_view uid) -> std::string |
| Sanitize UID for use in S3 object key. | |
| static auto | matches_query (const core::dicom_dataset &dataset, const core::dicom_dataset &query) -> bool |
| Check if dataset matches query criteria. | |
Private Attributes | |
| cloud_storage_config | config_ |
| Storage configuration. | |
| std::unique_ptr< s3_client_interface > | client_ |
| S3 client (mock for testing, AWS SDK for production) | |
| std::unordered_map< std::string, s3_object_info > | index_ |
| Mapping from SOP Instance UID to S3 object info. | |
| std::shared_mutex | mutex_ |
| Mutex for thread-safe access. | |
Additional Inherited Members | |
Protected Member Functions inherited from kcenon::pacs::storage::storage_interface | |
| storage_interface ()=default | |
| Protected default constructor for derived classes. | |
| storage_interface (const storage_interface &)=delete | |
| Non-copyable. | |
| storage_interface & | operator= (const storage_interface &)=delete |
| storage_interface (storage_interface &&)=default | |
| Movable. | |
| storage_interface & | operator= (storage_interface &&)=default |
Definition at line 163 of file s3_storage.h.
|
explicit |
Construct S3 storage with configuration.
| config | Cloud storage configuration |
Definition at line 505 of file s3_storage.cpp.
|
overridedefault |
Destructor.
|
delete |
Non-copyable (contains mutex)
|
delete |
Non-movable (contains mutex)
|
nodiscard |
Get the bucket name.
Definition at line 768 of file s3_storage.cpp.
References kcenon::pacs::storage::cloud_storage_config::bucket_name, and config_.
|
nodiscardprivate |
Build S3 object key for a dataset.
| study_uid | Study Instance UID |
| series_uid | Series Instance UID |
| sop_uid | SOP Instance UID |
Definition at line 818 of file s3_storage.cpp.
|
nodiscardoverridevirtual |
Check if a DICOM instance exists in S3.
Uses S3 HeadObject to check existence without downloading.
| sop_instance_uid | The unique identifier to check |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 659 of file s3_storage.cpp.
|
nodiscardoverridevirtual |
Find DICOM datasets matching query criteria.
This operation requires scanning the local index. For large buckets, consider using the index_database instead.
| query | The query dataset containing search criteria |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 664 of file s3_storage.cpp.
References kcenon::pacs::core::dicom_file::from_bytes(), and uid.

|
nodiscard |
Get the S3 object key for a SOP Instance UID.
| sop_instance_uid | The SOP Instance UID |
Definition at line 758 of file s3_storage.cpp.
|
nodiscardoverridevirtual |
Get storage statistics.
Implements kcenon::pacs::storage::storage_interface.
Definition at line 697 of file s3_storage.cpp.
|
nodiscard |
Check S3 connectivity.
Definition at line 810 of file s3_storage.cpp.
References client_.
|
staticnodiscardprivate |
Check if dataset matches query criteria.
| dataset | The dataset to check |
| query | The query criteria |
Definition at line 851 of file s3_storage.cpp.
|
delete |
|
delete |
|
nodiscard |
Rebuild the local index from S3.
Lists all objects in the bucket and rebuilds the SOP UID mapping.
Definition at line 772 of file s3_storage.cpp.
References kcenon::pacs::core::dicom_file::from_bytes(), kcenon::pacs::core::tags::series_instance_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::core::tags::study_instance_uid.

|
nodiscardoverridevirtual |
Remove a DICOM object from S3.
| sop_instance_uid | The unique identifier for the instance to remove |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 638 of file s3_storage.cpp.
|
nodiscardoverridevirtual |
Retrieve a DICOM dataset by SOP Instance UID.
Downloads the object from S3 and deserializes to dicom_dataset.
| sop_instance_uid | The unique identifier for the instance |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 591 of file s3_storage.cpp.
|
nodiscard |
Retrieve with progress tracking.
| sop_instance_uid | The SOP Instance UID |
| callback | Progress callback function |
Definition at line 596 of file s3_storage.cpp.
References kcenon::pacs::core::dicom_file::from_bytes().

|
staticnodiscardprivate |
Sanitize UID for use in S3 object key.
| uid | The UID to sanitize |
Definition at line 828 of file s3_storage.cpp.
References uid.
|
nodiscardoverridevirtual |
Store a DICOM dataset to S3.
Serializes the dataset to DICOM Part 10 format and uploads to S3. Uses multipart upload for files exceeding multipart_threshold.
| dataset | The DICOM dataset to store |
Implements kcenon::pacs::storage::storage_interface.
Definition at line 521 of file s3_storage.cpp.
|
nodiscard |
Store with progress tracking.
| dataset | The DICOM dataset to store |
| callback | Progress callback function |
Definition at line 525 of file s3_storage.cpp.
References kcenon::pacs::core::dicom_file::create(), kcenon::pacs::encoding::transfer_syntax::explicit_vr_little_endian, kcenon::pacs::core::tags::series_instance_uid, kcenon::pacs::core::tags::sop_instance_uid, and kcenon::pacs::core::tags::study_instance_uid.

|
nodiscardprivate |
Execute multipart upload for large files.
| key | S3 object key |
| data | Data to upload |
| callback | Optional progress callback |
Definition at line 845 of file s3_storage.cpp.
|
nodiscardoverridevirtual |
Verify storage integrity.
Checks that all indexed objects exist in S3 and have valid ETags.
Implements kcenon::pacs::storage::storage_interface.
Definition at line 727 of file s3_storage.cpp.
References uid.
|
private |
S3 client (mock for testing, AWS SDK for production)
Definition at line 392 of file s3_storage.h.
Referenced by is_connected().
|
private |
|
private |
Mapping from SOP Instance UID to S3 object info.
Definition at line 395 of file s3_storage.h.
Referenced by get_statistics().
|
mutableprivate |
Mutex for thread-safe access.
Definition at line 398 of file s3_storage.h.
Referenced by get_statistics().