61 pEnablePlugIns( enablePlugIns )
71 pEnablePlugIns( enablePlugIns )
79 File::File(
const std::string &url,
bool enablePlugIns): pPlugIn(0), pEnablePlugIns(enablePlugIns)
105 void File::InitPlugin(
const std::string &url) {
107 if (pEnablePlugIns && !pPlugIn) {
114 "Plug-in factory failed to produce a plug-in "
115 "for %s, continuing without one",
136 "Dup or Samefs options require a file template to be specified" );
142 return pPlugIn->Open( url, flags, mode, handler, timeout );
152 const std::string &url,
165 return pPlugIn->OpenUsingTemplate( rfile.GetFileTemplate().get(), url,
166 flags, mode, handler, timeout );
169 rfile.GetFileTemplate().get(), url, flags,
170 mode, handler, timeout );
194 const std::string &url,
214 return pPlugIn->Close( handler, timeout );
241 return pPlugIn->Stat( force, handler, timeout );
272 return pPlugIn->Read( offset, size, buffer, handler, timeout );
295 bytesRead = chunkInfo->
length;
311 return pPlugIn->PgRead( offset, size, buffer, handler, timeout );
322 std::vector<uint32_t> &cksums,
352 return pPlugIn->Write( offset, size, buffer, handler, timeout );
381 return pPlugIn->Write( offset, std::move( buffer ), handler, timeout );
413 return pPlugIn->Write( offset, size, fdoff, fd, handler, timeout );
442 std::vector<uint32_t> &cksums,
447 return pPlugIn->PgWrite( offset, size, buffer, cksums, handler, timeout );
458 std::vector<uint32_t> &cksums,
477 return pPlugIn->Sync( handler, timeout );
504 return pPlugIn->Truncate( size, handler, timeout );
532 return pPlugIn->PreRead( tracts, handler, timeout );
545 return PreRead( tracts, &handler, timeout );
558 return pPlugIn->VectorRead( chunks, buffer, handler, timeout );
587 return pPlugIn->VectorWrite( chunks, handler, timeout );
610 const struct iovec *
iov,
616 return pPlugIn->WriteV( offset,
iov, iovcnt, handler, timeout );
625 const struct iovec *
iov,
699 return pPlugIn->Fcntl( arg, handler, timeout );
731 return pPlugIn->Fcntl( queryCode, arg, handler, timeout );
759 return pPlugIn->Visa( handler, timeout );
795 std::vector<XAttrStatus> &result,
803 std::vector<XAttrStatus> *resp = 0;
805 if( resp ) result.swap( *resp );
828 std::vector<XAttr> &result,
836 std::vector<XAttr> *resp = 0;
838 if( resp ) result.swap( *resp );
861 std::vector<XAttrStatus> &result,
869 std::vector<XAttrStatus> *resp = 0;
871 if( resp ) result.swap( *resp );
900 std::vector<XAttr> *resp = 0;
902 if( resp ) result.swap( *resp );
924 XRootDStatus File::ChkptWrt( uint64_t offset,
927 ResponseHandler *handler,
940 const struct iovec *iov,
965 return pPlugIn->IsOpen();
967 return pImpl->pStateHandler->IsOpen();
977 return pImpl->pStateHandler->IsSecure();
986 return pPlugIn->SetProperty( name, value );
988 return pImpl->pStateHandler->SetProperty( name, value );
997 return pPlugIn->GetProperty( name, value );
999 return pImpl->pStateHandler->GetProperty( name, value );
1005 std::unique_ptr<ExportedFileTemplate> File::GetFileTemplate()
const
1019 return pPlugIn->Clone( locs, handler, timeout );
1021 return pImpl->pStateHandler->Clone( pImpl->pStateHandler, locs, handler, timeout );
Binary blob representation.
static PlugInManager * GetPlugInManager()
Get plug-in manager.
static Log * GetLog()
Get default log.
static PostMaster * GetPostMaster()
Get default post master.
An interface for file plug-ins.
virtual std::unique_ptr< ExportedFileTemplate > ExportTemplate() const
Handle the stateful operations.
static XRootDStatus TryOtherServer(std::shared_ptr< FileStateHandler > &self, time_t timeout)
Try other data server.
static XRootDStatus Read(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus SetXAttr(std::shared_ptr< FileStateHandler > &self, const std::vector< xattr_t > &attrs, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Visa(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Fcntl(std::shared_ptr< FileStateHandler > &self, QueryCode::Code queryCode, const Buffer &arg, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus ListXAttr(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Truncate(std::shared_ptr< FileStateHandler > &self, uint64_t size, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Checkpoint(std::shared_ptr< FileStateHandler > &self, kXR_char code, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus PgWrite(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, std::vector< uint32_t > &cksums, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Stat(std::shared_ptr< FileStateHandler > &self, bool force, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus ChkptWrt(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Write(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Close(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus ReadV(std::shared_ptr< FileStateHandler > &self, uint64_t offset, struct iovec *iov, int iovcnt, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus DelXAttr(std::shared_ptr< FileStateHandler > &self, const std::vector< std::string > &attrs, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Open(std::shared_ptr< FileStateHandler > &self, const std::string &url, OpenFlags::Flags flags, uint16_t mode, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus PgRead(std::shared_ptr< FileStateHandler > &self, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus OpenUsingTemplate(std::shared_ptr< FileStateHandler > &self, ExportedFileTemplate *templ, const std::string &url, OpenFlags::Flags flags, uint16_t mode, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus Sync(std::shared_ptr< FileStateHandler > &self, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus ChkptWrtV(std::shared_ptr< FileStateHandler > &self, uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus GetXAttr(std::shared_ptr< FileStateHandler > &self, const std::vector< std::string > &attrs, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus WriteV(std::shared_ptr< FileStateHandler > &self, uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus VectorRead(std::shared_ptr< FileStateHandler > &self, const ChunkList &chunks, void *buffer, ResponseHandler *handler, time_t timeout=0)
static XRootDStatus VectorWrite(std::shared_ptr< FileStateHandler > &self, const ChunkList &chunks, ResponseHandler *handler, time_t timeout=0)
bool IsSecure() const
Check if the file is using an encrypted connection.
XRootDStatus Open(const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus ReadV(uint64_t offset, struct iovec *iov, int iovcnt, ResponseHandler *handler, time_t timeout=0)
friend struct CloneLocations
XRootDStatus VectorRead(const ChunkList &chunks, void *buffer, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus PgRead(uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Sync(ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus WriteV(uint64_t offset, const struct iovec *iov, int iovcnt, ResponseHandler *handler, time_t timeout=0)
bool IsOpen() const
Check if the file is open.
XRootDStatus Fcntl(const Buffer &arg, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Clone(const CloneLocations &locs, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus OpenUsingTemplate(const File &rfile, const std::string &url, OpenFlags::Flags flags, Access::Mode mode, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus Visa(ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
Get access token to a file - async.
XRootDStatus TryOtherServer(time_t timeout=0)
XRootDStatus Truncate(uint64_t size, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus SetXAttr(const std::vector< xattr_t > &attrs, ResponseHandler *handler, time_t timeout=0)
bool GetProperty(const std::string &name, std::string &value) const
XRootDStatus ListXAttr(ResponseHandler *handler, time_t timeout=0)
XRootDStatus PreRead(const TractList &tracts, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
File(bool enablePlugIns=true)
XRootDStatus Read(uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus GetXAttr(const std::vector< std::string > &attrs, ResponseHandler *handler, time_t timeout=0)
virtual ~File()
Destructor.
XRootDStatus Close(ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
bool SetProperty(const std::string &name, const std::string &value)
XRootDStatus Stat(bool force, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus PgWrite(uint64_t offset, uint32_t size, const void *buffer, std::vector< uint32_t > &cksums, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus VectorWrite(const ChunkList &chunks, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
XRootDStatus DelXAttr(const std::vector< std::string > &attrs, ResponseHandler *handler, time_t timeout=0)
XRootDStatus Write(uint64_t offset, uint32_t size, const void *buffer, ResponseHandler *handler, time_t timeout=0) XRD_WARN_UNUSED_RESULT
void Error(uint64_t topic, const char *format,...)
Report an error.
static XrdCl::XRootDStatus WaitForResponse(SyncResponseHandler *handler, Type *&response)
Wait for the response.
static XRootDStatus WaitForStatus(SyncResponseHandler *handler)
Wait and return the status of the query.
virtual FilePlugIn * CreateFile(const std::string &url)=0
Create a file plug-in for the given URL.
PlugInFactory * GetFactory(const std::string url)
Handle an async response.
Synchronize the response.
uint32_t GetSize() const
Get Size.
const uint16_t stError
An error occurred that could potentially be retried.
const uint16_t suAlreadyDone
std::vector< TractInfo > TractList
List of Tracts.
const uint16_t errInvalidArgs
std::vector< ChunkInfo > ChunkList
List of chunks.
const uint16_t errNotSupported
Describe a data chunk for vector read.
uint32_t length
offset in the file
FileImpl(FilePlugIn *plugin)
FileImpl(bool useVirtRedirector, FilePlugIn *plugin)
std::shared_ptr< FileStateHandler > pStateHandler
Flags
Open flags, may be or'd when appropriate.
@ Samefs
Open file on the same filesystem as another.
@ Dup
Open file duplicating content from another.
std::vector< uint32_t > & GetCksums()
Get the checksums.
uint32_t GetLength() const
Get the data length.
Code
XRootD query request codes.
@ OpaqueQ
Implementation dependent.
uint16_t code
Error type, or additional hints on what to do.
bool IsOK() const
We're fine.