Skip to content

Commit 97c3e51

Browse files
authored
DPL: add support for decompressing directly to shared memory (#13962)
This PR postpones the read operations which would usually populate an intermediate RecordBatch and it performs them directly on its subsequent shared memory serialization. Doing so avoids having the intermediate representation allocate most of the memory. For the moment this is only done for the TTree plugin. RNtuple support will come in a subsequent PR.
1 parent 28d9c76 commit 97c3e51

File tree

5 files changed

+542
-173
lines changed

5 files changed

+542
-173
lines changed

Framework/AnalysisSupport/src/RNTuplePlugin.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "Framework/RuntimeError.h"
1313
#include "Framework/RootArrowFilesystem.h"
1414
#include "Framework/Plugins.h"
15+
#include "Framework/FairMQResizableBuffer.h"
1516
#include <ROOT/RNTupleModel.hxx>
1617
#include <ROOT/RNTupleWriteOptions.hxx>
1718
#include <ROOT/RNTupleWriter.hxx>
@@ -852,7 +853,10 @@ struct RNTupleObjectReadingImplementation : public RootArrowFactoryPlugin {
852853
return new RootArrowFactory{
853854
.options = [context]() { return context->format->DefaultWriteOptions(); },
854855
.format = [context]() { return context->format; },
855-
};
856+
.deferredOutputStreamer = [](std::shared_ptr<arrow::dataset::FileFragment> fragment, const std::shared_ptr<arrow::ResizableBuffer>& buffer) -> std::shared_ptr<arrow::io::OutputStream> {
857+
auto treeFragment = std::dynamic_pointer_cast<RNTupleFileFragment>(fragment);
858+
return std::make_shared<FairMQOutputStream>(buffer);
859+
}};
856860
}
857861
};
858862

0 commit comments

Comments
 (0)