11#ifndef O2_FRAMEWORK_ROOT_ARROW_FILESYSTEM_H_
12#define O2_FRAMEWORK_ROOT_ARROW_FILESYSTEM_H_
14#include <TBufferFile.h>
15#include <arrow/buffer.h>
16#include <arrow/dataset/dataset.h>
17#include <arrow/dataset/type_fwd.h>
18#include <arrow/dataset/file_base.h>
19#include <arrow/filesystem/type_fwd.h>
20#include <arrow/type_fwd.h>
44 return std::unique_ptr<T>((T*)p);
46 std::shared_ptr<arrow::dataset::FileFormat>
format;
49 void* payload =
nullptr;
59 arrow::Result<arrow::fs::FileInfo>
GetFileInfo(
const std::string&
path)
override;
60 arrow::Result<arrow::fs::FileInfoVector>
GetFileInfo(
const arrow::fs::FileSelector&
select)
override;
64 return this->type_name() ==
other.type_name();
70 arrow::Status
CreateDir(
const std::string&
path,
bool recursive)
override;
74 arrow::Status
CopyFile(
const std::string&
src,
const std::string& dest)
override;
76 arrow::Status
Move(
const std::string&
src,
const std::string& dest)
override;
84 arrow::Result<std::shared_ptr<arrow::io::InputStream>>
OpenInputStream(
const std::string&
path)
override;
86 arrow::Result<std::shared_ptr<arrow::io::RandomAccessFile>>
OpenInputFile(
const std::string&
path)
override;
89 const std::string&
path,
90 const std::shared_ptr<const arrow::KeyValueMetadata>& metadata)
override;
93 const std::string&
path,
94 const std::shared_ptr<const arrow::KeyValueMetadata>& metadata)
override;
98 std::function<std::shared_ptr<arrow::dataset::FileWriteOptions>()>
options =
nullptr;
99 std::function<std::shared_ptr<arrow::dataset::FileFormat>()>
format =
nullptr;
102 std::function<std::shared_ptr<arrow::io::OutputStream>(std::shared_ptr<arrow::dataset::FileFragment>,
const std::shared_ptr<arrow::ResizableBuffer>&
buffer)>
deferredOutputStreamer =
nullptr;
122 std::function<
void*(std::shared_ptr<arrow::fs::FileSystem> fs, std::string
const&
path)>
getHandle;
147 arrow::Result<arrow::fs::FileInfo>
GetFileInfo(
const std::string&
path)
override;
155 return "TDirectoryFile";
163 const std::string&
path,
164 const std::shared_ptr<const arrow::KeyValueMetadata>& metadata)
override;
173 TDirectoryFile* mFile;
182 arrow::Result<arrow::fs::FileInfo>
GetFileInfo(
const std::string&
path)
override;
185 return "tbufferfile";
197 std::shared_ptr<VirtualRootFileSystemBase> mFilesystem;
210 arrow::Status
Close()
override;
212 arrow::Result<int64_t>
Tell()
const override;
214 arrow::Status
Write(
const void*
data, int64_t nbytes)
override;
216 bool closed()
const override;
224 TDirectoryFile* mDirectory;
arrow::Result< arrow::fs::FileInfo > GetFileInfo(const std::string &path) override
std::shared_ptr< RootObjectHandler > GetObjectHandler(arrow::dataset::FileSource source) override
bool CheckSupport(arrow::dataset::FileSource source) override
std::string type_name() const override
TBufferFile * GetBuffer()
TDirectoryFile * GetDirectory()
bool closed() const override
arrow::Result< int64_t > Tell() const override
arrow::Status Close() override
std::string type_name() const override
virtual std::shared_ptr< VirtualRootFileSystemBase > GetSubFilesystem(arrow::dataset::FileSource source)
~TFileFileSystem() override
bool CheckSupport(arrow::dataset::FileSource source) override
arrow::Result< arrow::fs::FileInfo > GetFileInfo(const std::string &path) override
arrow::Result< std::shared_ptr< arrow::io::OutputStream > > OpenOutputStream(const std::string &path, const std::shared_ptr< const arrow::KeyValueMetadata > &metadata) override
std::shared_ptr< RootObjectHandler > GetObjectHandler(arrow::dataset::FileSource source) override
TDirectoryFile * GetFile()
arrow::Status DeleteDir(const std::string &path) override
virtual std::shared_ptr< RootObjectHandler > GetObjectHandler(arrow::dataset::FileSource source)=0
arrow::Status Move(const std::string &src, const std::string &dest) override
arrow::Status DeleteFile(const std::string &path) override
bool Equals(const FileSystem &other) const override
arrow::Status DeleteDirContents(const std::string &path, bool missing_dir_ok) override
arrow::Status CreateDir(const std::string &path, bool recursive) override
arrow::Status CopyFile(const std::string &src, const std::string &dest) override
arrow::Result< arrow::fs::FileInfo > GetFileInfo(const std::string &path) override
arrow::Result< std::shared_ptr< arrow::io::OutputStream > > OpenOutputStream(const std::string &path, const std::shared_ptr< const arrow::KeyValueMetadata > &metadata) override
arrow::Result< std::shared_ptr< arrow::io::InputStream > > OpenInputStream(const std::string &path) override
arrow::Result< std::shared_ptr< arrow::io::OutputStream > > OpenAppendStream(const std::string &path, const std::shared_ptr< const arrow::KeyValueMetadata > &metadata) override
arrow::Status DeleteRootDirContents() override
virtual bool CheckSupport(arrow::dataset::FileSource source)=0
arrow::Result< std::shared_ptr< arrow::io::RandomAccessFile > > OpenInputFile(const std::string &path) override
GLuint const GLchar * name
GLsizei GLsizei GLchar * source
GLsizei const GLchar *const * path
GLint GLint GLsizei GLint GLenum format
Defining PrimaryVertex explicitly as messageable.
std::vector< InputSpec > select(char const *matcher="")
Defining DataPointCompositeObject explicitly as copiable.
virtual RootArrowFactory * create()=0
std::function< std::shared_ptr< arrow::dataset::FileWriteOptions >()> options
std::function< std::shared_ptr< arrow::io::OutputStream >(std::shared_ptr< arrow::dataset::FileFragment >, const std::shared_ptr< arrow::ResizableBuffer > &buffer)> deferredOutputStreamer
~RootObjectHandler() noexcept(false)
RootObjectHandler(void *p, std::shared_ptr< arrow::dataset::FileFormat > f)
std::unique_ptr< T > GetObjectAsOwner()
std::shared_ptr< arrow::dataset::FileFormat > format
virtual RootObjectReadingCapability * create()=0
std::function< RootArrowFactory &()> factory
std::function< bool(char const *)> checkSupport
std::function< std::string(std::string)> lfn2objectPath
std::function< void *(std::shared_ptr< arrow::fs::FileSystem > fs, std::string const &path)> getHandle
std::vector< RootObjectReadingCapability > capabilities
VectorOfTObjectPtrs other