23#include <XrdCl/XrdClFile.hh>
24#include <XrdCl/XrdClFileSystem.hh>
25#include <XrdVersion.hh>
59 return std::make_unique<RRawFileNetXNG>( fUrl, fOptions );
64 XrdCl::StatInfo *
info =
nullptr;
65 auto st = pImpl->file.Stat(
true,
info );
67 throw std::runtime_error(
"Cannot determine size of '" + fUrl +
"', " +
68 st.ToString() +
"; " +
st.GetErrorMessage() );
69 std::uint64_t
ret =
info->GetSize();
76 auto st = pImpl->file.Open( fUrl, XrdCl::OpenFlags::Read );
78 throw std::runtime_error(
"Cannot open '" + fUrl +
"', " +
79 st.ToString() +
"; " +
st.GetErrorMessage() );
88 throw std::runtime_error(
"Cannot read from '" + fUrl +
"', " +
89 st.ToString() +
"; " +
st.GetErrorMessage() );
97 for( std::size_t i = 0; i <
nReq; ++i )
100 XrdCl::VectorReadInfo *
info =
nullptr;
101 auto st = pImpl->file.VectorRead(
chunks,
nullptr,
info );
103 throw std::runtime_error(
"Cannot do vector read from '" + fUrl +
"', " +
104 st.ToString() +
"; " +
st.GetErrorMessage() );
106 XrdCl::ChunkList &
rsp =
info->GetChunks();
107 for( std::size_t i = 0; i <
nReq; ++i )
115 return *fIOVecLimits;
119 fIOVecLimits =
RIOVecLimits{1024, 2097136,
static_cast<std::uint64_t
>(-1)};
121#if XrdVNUMBER >= 40000
123 pImpl->file.GetProperty(
"LastURL",
strLastURL);
127 if (
lastURL.GetProtocol().compare(
"file") == 0 &&
lastURL.GetHostId().compare(
"localhost") == 0) {
129 Info(
"GetReadVLimits",
"Local redirect, using default values");
130 return *fIOVecLimits;
136 Info(
"GetReadVLimits",
"Cannot get DataServer property, using default values");
137 return *fIOVecLimits;
141 XrdCl::URL
dataServer(pImpl->file.GetDataServer());
146 XrdCl::Buffer *response =
nullptr;
147 arg.FromString(
"readv_ior_max readv_iov_max");
149 XrdCl::XRootDStatus status =
fs.Query(XrdCl::QueryCode::Config, arg, response);
150 if (!status.IsOK()) {
153 Info(
"GetReadVLimits",
"Cannot query readv limits, using default values");
154 return *fIOVecLimits;
164 Info(
"GetReadVLimits",
"unexpected response from querying readv limits, using default values");
165 return *fIOVecLimits;
171 if (val == 0x7FFFFFFF)
172 return *fIOVecLimits;
174 fIOVecLimits->fMaxSingleSize = val;
181 return *fIOVecLimits;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
void OpenImpl() final
OpenImpl() is called at most once and before any call to either DoReadAt or DoGetSize.
RIOVecLimits GetReadVLimits() final
Returns the limits regarding the ioVec input to ReadV for this specific file; may open the file as a ...
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...
RRawFileNetXNG(std::string_view url, RRawFile::ROptions options)
std::unique_ptr< RRawFile > Clone() const final
Create a new RawFile that accesses the same resource. The file pointer is reset to zero.
size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final
Derived classes should implement low-level reading without buffering.
std::uint64_t GetSizeImpl() final
Derived classes should return the file size or kUnknownFileSize.
The RRawFile provides read-only access to local and remote files.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
RRawFileNetXNGImpl()=default
RRawFileNetXNGImpl & operator=(const RRawFileNetXNGImpl &)=delete
~RRawFileNetXNGImpl()=default
RRawFileNetXNGImpl(const RRawFileNetXNGImpl &)=delete
Implementations may enforce limits on the use of vector reads.
Used for vector reads from multiple offsets into multiple buffers.
On construction, an ROptions parameter can customize the RRawFile behavior.