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() );
80 if (fOptions.fBlockSize == ROptions::kUseDefaultBlockSize)
89 throw std::runtime_error(
"Cannot read from '" + fUrl +
"', " +
90 st.ToString() +
"; " +
st.GetErrorMessage() );
98 for( std::size_t i = 0; i <
nReq; ++i )
101 XrdCl::VectorReadInfo *
info =
nullptr;
102 auto st = pImpl->file.VectorRead(
chunks,
nullptr,
info );
104 throw std::runtime_error(
"Cannot do vector read from '" + fUrl +
"', " +
105 st.ToString() +
"; " +
st.GetErrorMessage() );
107 XrdCl::ChunkList &
rsp =
info->GetChunks();
108 for( std::size_t i = 0; i <
nReq; ++i )
116 return *fIOVecLimits;
120 fIOVecLimits =
RIOVecLimits{1024, 2097136,
static_cast<std::uint64_t
>(-1)};
122#if XrdVNUMBER >= 40000
124 pImpl->file.GetProperty(
"LastURL",
strLastURL);
128 if (
lastURL.GetProtocol().compare(
"file") == 0 &&
lastURL.GetHostId().compare(
"localhost") == 0) {
130 Info(
"GetReadVLimits",
"Local redirect, using default values");
131 return *fIOVecLimits;
137 Info(
"GetReadVLimits",
"Cannot get DataServer property, using default values");
138 return *fIOVecLimits;
142 XrdCl::URL
dataServer(pImpl->file.GetDataServer());
147 XrdCl::Buffer *response =
nullptr;
148 arg.FromString(
"readv_ior_max readv_iov_max");
150 XrdCl::XRootDStatus status =
fs.Query(XrdCl::QueryCode::Config, arg, response);
151 if (!status.IsOK()) {
154 Info(
"GetReadVLimits",
"Cannot query readv limits, using default values");
155 return *fIOVecLimits;
165 Info(
"GetReadVLimits",
"unexpected response from querying readv limits, using default values");
166 return *fIOVecLimits;
172 if (val == 0x7FFFFFFF)
173 return *fIOVecLimits;
175 fIOVecLimits->fMaxReqs = val;
182 return *fIOVecLimits;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.
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.