13#ifndef ROOT_RPageStorageS3
14#define ROOT_RPageStorageS3
16#include <ROOT/RCurlConnection.hxx>
30namespace Experimental {
82 std::string
ToJSON()
const;
140 void PutObject(
const std::string &url,
const unsigned char *
data, std::size_t
size);
151 void InitImpl(
unsigned char *serializedHeader, std::uint32_t
length)
final;
208 void GetObject(ROOT::Internal::RCurlConnection &connection,
const std::string &url,
unsigned char *buffer,
212 std::size_t GetShortObject(ROOT::Internal::RCurlConnection &connection,
const std::string &url,
213 unsigned char *buffer, std::size_t
size);
223 void LoadPageListImpl(
const RNTupleLocator &locator,
unsigned char *buffer)
final;
225 void LoadStructureImpl() final;
228 std::unique_ptr<
RPageSource> CloneImpl() const final;
235 LoadClusters(std::span<
ROOT::Internal::
RCluster::RKey> clusterKeys) final;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Entry point for an RNTuple stored in S3-compatible object storage.
std::uint16_t GetVersionMinor() const
std::uint16_t fVersionMinor
std::uint32_t GetVersionAnchor() const
bool operator==(const RNTupleAnchorS3 &other) const
Field-by-field equality check across all data members.
std::uint64_t fHeaderObjId
Object ID and byte offset of the compressed header within the S3 object.
std::uint64_t GetFooterOffset() const
std::string fUrlTemplate
Pattern for resolving object IDs to full S3 URLs.
std::uint32_t fVersionAnchor
Allows evolving the anchor JSON schema in future versions.
std::uint16_t fVersionPatch
std::uint16_t fVersionEpoch
Version of the RNTuple binary format supported by the writer.
bool operator!=(const RNTupleAnchorS3 &other) const
std::uint16_t GetVersionMajor() const
std::uint64_t GetNBytesFooter() const
std::uint16_t GetVersionPatch() const
std::string fCloneTemplate
Pattern for resolving clone (attribute-set) names to base URLs.
std::uint64_t fNBytesHeader
Compressed and uncompressed sizes of the header envelope.
std::string ToJSON() const
Serialize the anchor to a JSON string suitable for storage at the base URL.
std::uint64_t fHeaderOffset
std::uint64_t fFooterOffset
std::uint64_t fNBytesFooter
Compressed and uncompressed sizes of the footer envelope.
std::uint64_t GetLenHeader() const
std::uint64_t GetHeaderOffset() const
RNTupleAnchorS3()=default
static RResult< RNTupleAnchorS3 > CreateFromJSON(const std::string &json)
Deserialize the anchor from a JSON string. Returns an error on malformed or incompatible input.
std::uint64_t fFooterObjId
Object ID and byte offset of the compressed footer within the S3 object.
std::uint16_t fVersionMajor
const std::string & GetCloneTemplate() const
const std::string & GetUrlTemplate() const
std::uint64_t GetFooterObjId() const
std::uint16_t GetVersionEpoch() const
std::uint64_t GetLenFooter() const
std::uint64_t GetHeaderObjId() const
std::uint64_t GetNBytesHeader() const
Storage provider that writes ntuple pages into S3-compatible object storage.
ROOT::Internal::RCurlConnection fConnection
One HTTP connection reused for every upload, so curl keeps it alive across objects on the same host i...
void InitImpl(unsigned char *serializedHeader, std::uint32_t length) final
std::uint64_t StageClusterImpl() final
Returns the number of bytes written to storage (excluding metadata)
RNTupleLocator CommitClusterGroupImpl(unsigned char *serializedPageList, std::uint32_t length) final
Returns the locator of the page list envelope of the given buffer that contains the serialized page l...
std::unique_ptr< ROOT::Internal::RPageSink > CloneAsHidden(std::string_view name, const ROOT::RNTupleWriteOptions &opts) const final
Creates a new sink with the same underlying storage as this but writing to a different RNTuple named ...
RNTupleAnchorS3 fAnchor
Anchor metadata populated during the write path and uploaded last in CommitDatasetImpl.
std::string MakeObjectUrl(std::uint64_t objId) const
Resolve a numeric object ID to its full HTTP URL.
std::string fBaseUrl
HTTP base URL for this ntuple (derived from the s3 scheme URI); never has a trailing slash.
RNTupleLocator CommitSealedPageImpl(ROOT::DescriptorId_t physicalColumnId, const RPageStorage::RSealedPage &sealedPage) final
std::uint64_t fNBytesCurrentCluster
Tracks the number of bytes committed to the current cluster (reset in StageClusterImpl)
RPageSinkS3(std::string_view ntupleName, std::string_view baseUrl, const ROOT::RNTupleWriteOptions &options, RFromBaseUrl)
Internal constructor used by CloneAsHidden: the public constructor derives the base URL by parsing an...
RNTupleLink CommitDatasetImpl() final
std::uint64_t fObjectId
Object ID counter; incremented for each object written.
void PutObject(const std::string &url, const unsigned char *data, std::size_t size)
Upload raw bytes to the given S3 URL via an HTTP PUT request.
Storage provider that reads ntuple pages from S3-compatible object storage.
ROOT::Internal::RCurlConnection fClusterConnection
Connection used exclusively by LoadClusters(), which the cluster pool calls on its own I/O thread.
RNTupleAnchorS3 fAnchor
Anchor metadata, fetched and parsed in LoadStructureImpl.
std::string fBaseUrl
HTTP base URL for this ntuple (derived from the s3 scheme URI); never has a trailing slash.
std::string fResolvedUrlTemplate
The anchor's URL template with ${baseurl} already substituted, so that resolving an object ID only ha...
ROOT::Internal::RNTupleDescriptorBuilder fDescriptorBuilder
Populated by LoadStructureImpl and AttachImpl, moved out at the end of AttachImpl.
ROOT::Internal::RCurlConnection fMainConnection
Connection used by everything that runs on the calling thread: the anchor, header and footer in LoadS...
An in-memory subset of the packed and compressed pages of a cluster.
A helper class for piece-wise construction of an RNTupleDescriptor.
Base class for a sink with a physical storage backend.
virtual void InitImpl(unsigned char *serializedHeader, std::uint32_t length)=0
Abstract interface to write data into an ntuple.
Abstract interface to read data from an ntuple.
The on-storage metadata of an RNTuple.
Generic information about the physical location of data.
Common user-tunable settings for reading RNTuples.
Common user-tunable settings for storing RNTuples.
static constexpr std::uint16_t kVersionPatch
static constexpr std::uint16_t kVersionMajor
static constexpr std::uint16_t kVersionEpoch
static constexpr std::uint16_t kVersionMinor
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
RResult< std::string > ParseS3Url(std::string_view uri)
Translate an ntpl+s3 URI into its plain HTTP(S) equivalent.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
Tag to select the internal constructor that takes an already-resolved base URL.
Tag to select the internal constructor that takes an already-resolved base URL.
A sealed page contains the bytes of a page as written to storage (packed & compressed).