Skip to content

Commit 722b86a

Browse files
committed
[ntuple] Rename RPageSink::CreateNewWithNewRNTuple -> DeriveFor
1 parent a1ef035 commit 722b86a

File tree

10 files changed

+16
-15
lines changed

10 files changed

+16
-15
lines changed

tree/ntuple/inc/ROOT/RPageNullSink.hxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ public:
106106
void CommitStagedClusters(std::span<RStagedCluster>) final {}
107107
void CommitClusterGroup() final {}
108108
void CommitDatasetImpl() final {}
109-
std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view) const final { return nullptr; }
109+
std::unique_ptr<RPageSink> DeriveFor(std::string_view, const ROOT::RNTupleWriteOptions &) const final
110+
{
111+
return nullptr;
112+
}
110113
};
111114

112115
} // namespace Internal

tree/ntuple/inc/ROOT/RPageSinkBuf.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ public:
149149

150150
RPage ReservePage(ColumnHandle_t columnHandle, std::size_t nElements) final;
151151

152-
std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view newName) const final
152+
std::unique_ptr<RPageSink> DeriveFor(std::string_view newName, const ROOT::RNTupleWriteOptions &opts) const final
153153
{
154-
return std::make_unique<RPageSinkBuf>(fInnerSink->CreateNewWithNewRNTuple(newName));
154+
return std::make_unique<RPageSinkBuf>(fInnerSink->DeriveFor(newName, opts));
155155
}
156156
}; // RPageSinkBuf
157157

tree/ntuple/inc/ROOT/RPageStorage.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public:
315315

316316
/// Creates a new RPageSink linked to the same underlying storage as this, writing to a new RNTuple called `newName`.
317317
/// The existing sink will stay valid. The existing sink and the new one must not write concurrently.
318-
virtual std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view newName) const = 0;
318+
virtual std::unique_ptr<RPageSink> DeriveFor(std::string_view newName, const RNTupleWriteOptions &opts) const = 0;
319319

320320
/// Physically creates the storage container to hold the ntuple (e.g., a keys a TFile or an S3 bucket)
321321
/// Init() associates column handles to the columns referenced by the model

tree/ntuple/inc/ROOT/RPageStorageDaos.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public:
142142
RPageSinkDaos(std::string_view ntupleName, std::string_view uri, const ROOT::RNTupleWriteOptions &options);
143143
~RPageSinkDaos() override;
144144

145-
std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view) const final;
145+
std::unique_ptr<RPageSink> DeriveFor(std::string_view, const ROOT::RNTupleWriteOptions &) const final;
146146
}; // class RPageSinkDaos
147147

148148
// clang-format off

tree/ntuple/inc/ROOT/RPageStorageFile.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public:
9999
RPageSinkFile &operator=(RPageSinkFile &&) = default;
100100
~RPageSinkFile() override;
101101

102-
std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view) const final;
102+
std::unique_ptr<RPageSink> DeriveFor(std::string_view newName, const ROOT::RNTupleWriteOptions &opts) const final;
103103

104104
ROOT::Internal::RNTupleFileWriter *GetUnderlyingWriter() const { return fWriter.get(); }
105105
}; // class RPageSinkFile

tree/ntuple/src/RNTupleParallelWriter.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ class RPageSynchronizingSink : public RPageSink {
111111
{
112112
throw ROOT::RException(R__FAIL("should never commit dataset via RPageSynchronizingSink"));
113113
}
114-
std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view) const final
114+
std::unique_ptr<RPageSink> DeriveFor(std::string_view, const ROOT::RNTupleWriteOptions &) const final
115115
{
116-
throw ROOT::RException(R__FAIL("CreateNewWithNewRNTuple unavailable for RPageSynchronizingSink"));
116+
throw ROOT::RException(R__FAIL("DeriveFor unavailable for RPageSynchronizingSink"));
117117
}
118118

119119
RSinkGuard GetSinkGuard() final { return RSinkGuard(fMutex); }

tree/ntuple/src/RPageStorageDaos.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ void ROOT::Experimental::Internal::RPageSinkDaos::WriteNTupleAnchor()
484484
}
485485

486486
std::unique_ptr<ROOT::Internal::RPageSink>
487-
ROOT::Experimental::Internal::RPageSinkDaos::CreateNewWithNewRNTuple(std::string_view) const
487+
ROOT::Experimental::Internal::RPageSinkDaos::DeriveFor(std::string_view, const ROOT::RNTupleWriteOptions &) const
488488
{
489489
throw ROOT::RException(R__FAIL("this method is not available for the DAOS backend"));
490490
}

tree/ntuple/src/RPageStorageFile.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,13 @@ void ROOT::Internal::RPageSinkFile::CommitDatasetImpl(unsigned char *serializedF
253253
}
254254

255255
std::unique_ptr<ROOT::Internal::RPageSink>
256-
ROOT::Internal::RPageSinkFile::CreateNewWithNewRNTuple(std::string_view newName) const
256+
ROOT::Internal::RPageSinkFile::DeriveFor(std::string_view newName, const ROOT::RNTupleWriteOptions &opts) const
257257
{
258258
if (auto *dir = Internal::GetUnderlyingDirectory(*fWriter)) {
259-
auto opts = ROOT::RNTupleWriteOptions();
260-
opts.SetCompression(GetWriteOptions().GetCompression());
261259
return std::make_unique<ROOT::Internal::RPageSinkFile>(newName, *dir, opts);
262260
}
263261
// TODO: support this method also for non-TFile-based writers
264-
throw ROOT::RException(R__FAIL("cannot CreateNewWithNewRNTuple a non-TFile-based Sink."));
262+
throw ROOT::RException(R__FAIL("cannot call DeriveFor on a non-TFile-based Sink."));
265263
}
266264

267265
////////////////////////////////////////////////////////////////////////////////

tree/ntuple/test/ntuple_endian.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class RPageSinkMock : public RPageSink {
5959
void CommitStagedClusters(std::span<RStagedCluster>) final {}
6060
void CommitClusterGroup() final {}
6161
void CommitDatasetImpl() final {}
62-
std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view) const final
62+
std::unique_ptr<RPageSink> DeriveFor(std::string_view, const ROOT::RNTupleWriteOptions &) const final
6363
{
6464
R__ASSERT(false);
6565
return nullptr;

tree/ntuple/test/ntuple_storage.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class RPageSinkMock : public RPageSink {
5454
void CommitStagedClusters(std::span<RStagedCluster>) final {}
5555
void CommitClusterGroup() final {}
5656
void CommitDatasetImpl() final {}
57-
std::unique_ptr<RPageSink> CreateNewWithNewRNTuple(std::string_view) const final
57+
std::unique_ptr<RPageSink> DeriveFor(std::string_view, const ROOT::RNTupleWriteOptions &) const final
5858
{
5959
R__ASSERT(false);
6060
return nullptr;

0 commit comments

Comments
 (0)