33                                   std::unique_ptr<ROOT::Internal::RPageSink> 
sink)
 
   34   : fFillContext(std::
move(model), std::
move(
sink)), fMetrics(
"RNTupleWriter")
 
 
   57                                                                 std::unique_ptr<Internal::RPageSink> 
sink,
 
   60   if (model->GetRegisteredSubfieldNames().size() > 0) {
 
   61      throw RException(
R__FAIL(
"cannot create an RNTupleWriter from a model with registered subfields"));
 
   63   for (
const auto &
field : model->GetConstFieldZero()) {
 
   66            R__FAIL(
"creating a RNTupleWriter from a model containing emulated fields is currently unsupported."));
 
   69      sink = std::make_unique<Internal::RPageSinkBuf>(std::move(
sink));
 
   71   return std::unique_ptr<RNTupleWriter>(
new RNTupleWriter(std::move(model), std::move(
sink)));
 
 
   74std::unique_ptr<ROOT::RNTupleWriter>
 
   79   return Create(std::move(model), std::move(
sink), options);
 
 
   82std::unique_ptr<ROOT::RNTupleWriter>
 
   93      model->AddField(
field.Unwrap());
 
   95   return Create(std::move(model), std::move(
sink), options);
 
 
   98std::unique_ptr<ROOT::RNTupleWriter>
 
  104      throw RException(
R__FAIL(
"RNTupleWriter only supports writing to a ROOT file. Cannot write into a directory " 
  105                               "that is not backed by a file"));
 
  107   if (!file->IsBinary()) {
 
  108      throw RException(
R__FAIL(
"RNTupleWriter only supports writing to a ROOT file. Cannot write into " +
 
  109                               std::string(file->GetName())));
 
  113   return Create(std::move(model), std::move(
sink), options);
 
 
  118   if (GetNEntries() == fLastCommittedClusterGroup)
 
  120   fFillContext.fSink->CommitClusterGroup();
 
  121   fLastCommittedClusterGroup = GetNEntries();
 
 
  126   if (fFillContext.fModel->IsExpired()) {
 
  129   return *fFillContext.fModel;
 
 
  134   if (fFillContext.GetModel().IsExpired())
 
  137   CommitCluster(
true );
 
  138   fFillContext.fSink->CommitDataset();
 
  139   fFillContext.fModel->Expire();
 
 
  142std::unique_ptr<ROOT::RNTupleWriter>
 
  144                                    std::unique_ptr<ROOT::Internal::RPageSink> 
sink)
 
 
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
 
#define R__LOG_ERROR(...)
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
void ObserveMetrics(RNTupleMetrics &observee)
 
static std::unique_ptr< RPageSink > Create(std::string_view ntupleName, std::string_view location, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Guess the concrete derived page source from the location.
 
Base class for all ROOT issued exceptions.
 
const RError & GetError() const
 
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &typeName, const ROOT::RCreateFieldOptions &options, const ROOT::RNTupleDescriptor *desc, ROOT::DescriptorId_t fieldId)
Factory method to resurrect a field from the stored on-disk type information.
 
@ kTraitEmulatedField
This field is a user defined type that was missing dictionaries and was reconstructed from the on-dis...
 
std::unique_ptr< ROOT::Internal::RPageStorage::RTaskScheduler > fZipTasks
The page sink's parallel page compression scheduler if IMT is on.
 
std::unique_ptr< ROOT::Internal::RPageSink > fSink
 
The RNTupleModel encapulates the schema of an RNTuple.
 
static std::unique_ptr< RNTupleModel > Create()
 
Common user-tunable settings for storing RNTuples.
 
bool GetUseBufferedWrite() const
 
An RNTuple that gets filled with entries (data) and writes them to storage.
 
static std::unique_ptr< RNTupleWriter > Create(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Internal::RPageSink > sink, const ROOT::RNTupleWriteOptions &options)
Create a writer, potentially wrapping the sink in a RPageSinkBuf.
 
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< ROOT::RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Creates an RNTupleWriter backed by storage, overwriting it if one with the same URI exists.
 
Experimental::Detail::RNTupleMetrics fMetrics
 
RNTupleFillContext fFillContext
 
void CommitClusterGroup()
 
ROOT::RNTupleModel & GetUpdatableModel()
 
static std::unique_ptr< RNTupleWriter > Append(std::unique_ptr< ROOT::RNTupleModel > model, std::string_view ntupleName, TDirectory &fileOrDirectory, const ROOT::RNTupleWriteOptions &options=ROOT::RNTupleWriteOptions())
Creates an RNTupleWriter that writes into an existing TFile or TDirectory, without overwriting its co...
 
RNTupleWriter(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Internal::RPageSink > sink)
 
void CommitDataset()
Closes the underlying file (page sink) and expires the model.
 
Describe directory structure in memory.
 
ROOT::RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.
 
std::unique_ptr< RNTupleWriter > CreateRNTupleWriter(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Internal::RPageSink > sink)
 
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.