26constexpr int kDefaultBlockSize = 128 * 1024;
37 const auto ca_check_local_str =
gEnv->GetValue(
"Davix.GSI.CACheck", (
const char *)
"y");
38 bool ca_check_local =
isno(ca_check_local_str);
39 pars.setSSLCAcheck(ca_check_local);
74 Davix::DavixError *
err =
nullptr;
76 throw std::runtime_error(
"Cannot determine size of '" +
fUrl +
"', error: " +
err->getErrMsg());
83 Davix::DavixError *
err =
nullptr;
86 throw std::runtime_error(
"Cannot open '" +
fUrl +
"', error: " +
err->getErrMsg());
88 if (
fOptions.fBlockSize == ROptions::kUseDefaultBlockSize)
89 fOptions.fBlockSize = kDefaultBlockSize;
94 Davix::DavixError *
err =
nullptr;
97 throw std::runtime_error(
"Cannot read from '" +
fUrl +
"', error: " +
err->getErrMsg());
99 return static_cast<size_t>(retval);
104 Davix::DavixError *davixErr = NULL;
105 std::vector<Davix::DavIOVecInput> in(nReq);
106 std::vector<Davix::DavIOVecOuput> out(nReq);
108 for (
unsigned int i = 0; i < nReq; ++i) {
109 in[i].diov_buffer = ioVec[i].
fBuffer;
110 in[i].diov_offset = ioVec[i].
fOffset;
111 in[i].diov_size = ioVec[i].
fSize;
117 throw std::runtime_error(
"Cannot do vector read from '" +
fUrl +
"', error: " + davixErr->getErrMsg());
120 for (
unsigned int i = 0; i < nReq; ++i) {
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
std::unique_ptr< Internal::RDavixFileDes > fFileDes
void ReadVImpl(RIOVec *ioVec, unsigned int nReq) final
By default implemented as a loop of ReadAt calls but can be overwritten, e.g. XRootD or DAVIX impleme...
size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final
Derived classes should implement low-level reading without buffering.
std::unique_ptr< RRawFile > Clone() const final
Create a new RawFile that accesses the same resource. The file pointer is reset to zero.
RRawFileDavix(std::string_view url, RRawFile::ROptions options)
std::uint64_t GetSizeImpl() final
Derived classes should return the file size.
void OpenImpl() final
OpenImpl() is called at most once and before any call to either DoReadAt or DoGetSize.
RRawFile(std::string_view url, ROptions options)
bool isno(const char *str)
RDavixFileDes(const RDavixFileDes &)=delete
RDavixFileDes & operator=(const RDavixFileDes &)=delete
Davix::RequestParams pars
Used for vector reads from multiple offsets into multiple buffers.
std::size_t fOutBytes
The number of actually read bytes, set by ReadV().
std::size_t fSize
The number of desired bytes.
void * fBuffer
The destination for reading.
std::uint64_t fOffset
The file offset.
On construction, an ROptions parameter can customize the RRawFile behavior.