TXNetFile Class Reference

#include <TXNetFile.h>

Inheritance diagram for TXNetFile:

TNetFile TFile TFile TDirectoryFile TDirectoryFile TDirectoryFile TDirectoryFile TDirectory TDirectory TDirectory TDirectory TDirectory TDirectory TDirectory TDirectory TAlienFile List of all members.

Public Member Functions

 TXNetFile ()
 TXNetFile (const char *url, Option_t *option="", const char *fTitle="", Int_t compress=1, Int_t netopt=0, Bool_t parallelopen=kFALSE, const char *logicalurl=0)
virtual ~TXNetFile ()
virtual void Close (const Option_t *opt="")
virtual void ResetCache ()
virtual void Flush ()
virtual Int_t GetBytesToPrefetch () const
virtual Bool_t ReadBufferAsync (Long64_t offs, Int_t len)
virtual TFile::EAsyncOpenStatus GetAsyncOpenStatus ()
virtual Bool_t IsOpen () const
virtual void Print (Option_t *option="") const
virtual Bool_t ReadBuffer (char *buf, Int_t len)
virtual Bool_t ReadBuffer (char *buf, Long64_t pos, Int_t len)
virtual Bool_t ReadBuffers (char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
virtual Int_t ReOpen (const Option_t *mode)
virtual Bool_t WriteBuffer (const char *buffer, Int_t BufferLength)

Private Member Functions

 TXNetFile (const TXNetFile &)
TXNetFileoperator= (const TXNetFile &)
void CreateXClient (const char *url, Option_t *option, Int_t netopt, Bool_t parallelopen)
Int_t ParseOptions (const char *opts, Int_t &cachesz, Int_t &readaheadsz, Int_t &rmpolicy, Int_t &mxredir, Int_t &rastrategy, Int_t &readtrimblksz)
void SynchronizeCacheSize ()
void Init (Bool_t create)
Bool_t Open (Option_t *option, Bool_t parallelopen)
Int_t SysStat (Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Int_t SysOpen (const char *pathname, Int_t flags, UInt_t mode)
Int_t SysClose (Int_t fd)

Static Private Member Functions

static void FormUrl (TUrl uut, TString &uu)
static Int_t GetRootdProtocol (TSocket *s)
static void SetEnv ()

Private Attributes

XrdClientfClient
Bool_t fIsRootd
XrdSysRecMutexfInitMtx

Static Private Attributes

static Bool_t fgInitDone
static Bool_t fgRootdBC
static TFileStagerfgFileStager

Friends

class TXNetSystem

Detailed Description

Definition at line 65 of file TXNetFile.h.


Constructor & Destructor Documentation

TXNetFile::TXNetFile ( const TXNetFile  )  [private]

TXNetFile::TXNetFile (  )  [inline]

Definition at line 108 of file TXNetFile.h.

TXNetFile::TXNetFile ( const char *  url,
Option_t option = "",
const char *  fTitle = "",
Int_t  compress = 1,
Int_t  netopt = 0,
Bool_t  parallelopen = kFALSE,
const char *  logicalurl = 0 
)

Definition at line 75 of file TXNetFile.cxx.

References CreateXClient(), EnvPutInt, fgInitDone, fInitMtx, TFile::fOpenPhases, gEnv, TUrl::GetOptions(), TUrl::GetUrl(), TEnv::GetValue(), TROOT::GetVersion(), gMonitoringWriter, gROOT, TObject::Info(), kFALSE, kTRUE, NAME_DEBUG, TVirtualMonitoringWriter::SendFileOpenProgress(), TUrl::SetAnchor(), SetEnv(), TCollection::SetOwner(), and XrdSysRecMutex.

TXNetFile::~TXNetFile (  )  [virtual]

Definition at line 154 of file TXNetFile.cxx.

References Close(), fClient, fInitMtx, IsOpen(), and SafeDelete.


Member Function Documentation

TXNetFile& TXNetFile::operator= ( const TXNetFile  )  [private]

void TXNetFile::CreateXClient ( const char *  url,
Option_t option,
Int_t  netopt,
Bool_t  parallelopen 
) [private]

Definition at line 246 of file TXNetFile.cxx.

References TSystem::Abort(), TNetFile::Create(), TObject::Error(), TFile::fAsyncOpenStatus, fClient, fgFileStager, fgRootdBC, fIsRootd, TNetFile::fNetopt, Form(), FormUrl(), TFile::fUrl, gDebug, gDirectory, gEnv, XrdClientAbs::GetClientConn(), XrdClientConn::GetCurrentUrl(), TFile::GetOnlyStaged(), XrdClientConn::GetOpenSockFD(), TFile::GetOpenTimeout(), GetRootdProtocol(), XrdClientConn::GetServerType(), TUrl::GetUrl(), TEnv::GetValue(), gROOT, gSystem, TObject::Info(), XrdClient::IsOpen_wait(), TFileStager::IsStaged(), TFile::kAOSFailure, TFile::kAOSInProgress, kFALSE, kNoBlock, TSocket::kROOTD, kSTRootd, kTRUE, TObject::MakeZombie(), TFileStager::Matches(), Open(), TFileStager::Open(), ParseOptions(), s, SafeDelete, XrdClient::SetBlockReadTrimming(), XrdClient::SetCacheParameters(), TSystem::Setenv(), XrdClientConn::SetMaxRedirCnt(), XrdClient::SetReadAheadStrategy(), and TObject::Warning().

Referenced by SysOpen(), and TXNetFile().

Int_t TXNetFile::ParseOptions ( const char *  opts,
Int_t cachesz,
Int_t readaheadsz,
Int_t rmpolicy,
Int_t mxredir,
Int_t rastrategy,
Int_t readtrimblksz 
) [private]

Definition at line 195 of file TXNetFile.cxx.

References gDebug, i, TObject::Info(), j, k, kNPOS, s, and val.

Referenced by CreateXClient().

void TXNetFile::SynchronizeCacheSize (  )  [private]

Definition at line 1361 of file TXNetFile.cxx.

References fClient, TDirectoryFile::GetBufferSize(), XrdClient::GetCacheInfo(), TFile::GetCacheRead(), XrdClientReadCache::kRmBlk_FIFO, Long64_t, TMath::Max(), XrdClient::SetCacheParameters(), size, TRUE, and XrdClient::UseCache().

Referenced by ReadBufferAsync(), and ReadBuffers().

void TXNetFile::Init ( Bool_t  create  )  [private, virtual]

Reimplemented from TNetFile.

Definition at line 898 of file TXNetFile.cxx.

References XrdOucString::c_str(), fClient, TFile::fD, TNetFile::fEndpointUrl, TFile::fInitDone, fInitMtx, fIsRootd, TFile::fOpenPhases, XrdClientConn::fRedirOpaque, TFile::fUrl, gDebug, gDirectory, XrdClientAbs::GetClientConn(), XrdClientConn::GetCurrentUrl(), TUrl::GetHostFQDN(), TUrl::GetPort(), XrdClientUrlInfo::GetUrl(), gMonitoringWriter, gROOT, TObject::Info(), TFile::Init(), TNetFile::Init(), XrdClient::IsOpen_wait(), kFALSE, TFile::kRedirected, kTRUE, XrdOucString::length(), m, TObject::MakeZombie(), SafeDelete, TObject::SetBit(), and XrdClient::UseCache().

Referenced by Open().

Bool_t TXNetFile::Open ( Option_t option,
Bool_t  parallelopen 
) [private]

Definition at line 471 of file TXNetFile.cxx.

References TSystem::AccessPathName(), TString::BeginsWith(), XrdClient::Close(), TObject::Error(), TFile::fAsyncOpenStatus, fClient, TFile::fOption, TFile::fUrl, TDirectoryFile::fWritable, gDebug, gEnv, TUrl::GetOptions(), TUrl::GetUrl(), TEnv::GetValue(), gSystem, TObject::Info(), Init(), TObject::IsZombie(), TFile::kAOSFailure, kFALSE, kFileExists, kTRUE, kWritePermission, kXR_delete, kXR_force, kXR_gr, kXR_mkpath, kXR_new, kXR_open_read, kXR_open_updt, kXR_or, kXR_ur, kXR_uw, XrdClient::Open(), p, read, TString::Remove(), TString::ToUpper(), and update().

Referenced by CreateXClient(), and SysOpen().

Int_t TXNetFile::SysStat ( Int_t  fd,
Long_t id,
Long64_t size,
Long_t flags,
Long_t modtime 
) [private, virtual]

Reimplemented from TNetFile.

Definition at line 1077 of file TXNetFile.cxx.

References TObject::Error(), fClient, fIsRootd, XrdClientStatInfo::flags, gDebug, XrdClientStatInfo::id, TObject::Info(), IsOpen(), TObject::IsZombie(), Long64_t, XrdClientStatInfo::modtime, XrdClientStatInfo::size, XrdClient::Stat(), and TNetFile::SysStat().

Int_t TXNetFile::SysOpen ( const char *  pathname,
Int_t  flags,
UInt_t  mode 
) [private, virtual]

Reimplemented from TNetFile.

Definition at line 1148 of file TXNetFile.cxx.

References CreateXClient(), TString::Data(), fClient, fIsRootd, TNetFile::fNetopt, TFile::fOption, TFile::fUrl, gDebug, TUrl::GetUrl(), TObject::Info(), IsOpen(), kFALSE, Open(), and TNetFile::SysOpen().

Int_t TXNetFile::SysClose ( Int_t  fd  )  [private, virtual]

Reimplemented from TNetFile.

Definition at line 1124 of file TXNetFile.cxx.

References XrdClient::Close(), TObject::Error(), fClient, fIsRootd, gDebug, TObject::Info(), IsOpen(), TObject::IsZombie(), and TNetFile::SysClose().

void TXNetFile::FormUrl ( TUrl  uut,
TString uu 
) [static, private]

Definition at line 166 of file TXNetFile.cxx.

References TUrl::GetHost(), TUrl::GetPort(), and TUrl::GetUser().

Referenced by TXNetSystem::Connect(), and CreateXClient().

Int_t TXNetFile::GetRootdProtocol ( TSocket s  )  [static, private]

Definition at line 415 of file TXNetFile.cxx.

References TObject::Error(), Form(), gDebug, TSocket::GetClientProtocol(), TObject::Info(), kROOTD_PROTOCOL, len, net2host(), and s.

Referenced by TXNetSystem::Connect(), and CreateXClient().

void TXNetFile::SetEnv (  )  [static, private]

Definition at line 1179 of file TXNetFile.cxx.

References TString::Data(), DFLT_CONNECTTIMEOUT, DFLT_DFLTTCPWINDOWSIZE, DFLT_FIRSTCONNECTMAXCNT, DFLT_MAXREDIRECTCOUNT, DFLT_MULTISTREAMCNT, DFLT_READAHEADSIZE, DFLT_READCACHESIZE, DFLT_RECONNECTWAIT, DFLT_REQUESTTIMEOUT, DFLT_TRANSACTIONTIMEOUT, EnvPutInt, EnvPutString, fgRootdBC, TString::Form(), gEnv, TSystem::Getenv(), TEnv::GetValue(), gSystem, TSystem::HomeDirectory(), TSystem::IgnoreSignal(), TString::IsNull(), kSigPipe, TString::Length(), NAME_CONNECTDOMAINALLOW_RE, NAME_CONNECTDOMAINDENY_RE, NAME_CONNECTTIMEOUT, NAME_DFLTTCPWINDOWSIZE, NAME_FIRSTCONNECTMAXCNT, NAME_KEEPSOCKOPENIFNOTXRD, NAME_MAXREDIRECTCOUNT, NAME_MULTISTREAMCNT, NAME_READAHEADSIZE, NAME_READCACHESIZE, NAME_RECONNECTWAIT, NAME_REDIRDOMAINALLOW_RE, NAME_REDIRDOMAINDENY_RE, NAME_REQUESTTIMEOUT, NAME_SOCKS4HOST, NAME_SOCKS4PORT, NAME_TRANSACTIONTIMEOUT, and TSystem::Setenv().

Referenced by TXNetSystem::InitXrdClient(), and TXNetFile().

void TXNetFile::Close ( const Option_t opt = ""  )  [virtual]

Definition at line 1015 of file TXNetFile.cxx.

References TFile::Close(), TNetFile::Close(), XrdClient::Close(), fClient, TFile::fD, fIsRootd, gDebug, TObject::Info(), IsOpen(), and kFALSE.

Referenced by ~TXNetFile().

void TXNetFile::ResetCache (  )  [virtual]

Definition at line 1394 of file TXNetFile.cxx.

References fClient, and XrdClient::RemoveAllDataFromCache().

Referenced by ReadBuffers().

void TXNetFile::Flush (  )  [virtual]

Reimplemented from TNetFile.

Definition at line 1040 of file TXNetFile.cxx.

References TObject::Error(), fClient, fIsRootd, TNetFile::Flush(), TFile::FlushWriteCache(), TDirectoryFile::fWritable, gDebug, TObject::Info(), IsOpen(), TObject::IsZombie(), and XrdClient::Sync().

Int_t TXNetFile::GetBytesToPrefetch (  )  const [virtual]

Reimplemented from TFile.

Definition at line 1403 of file TXNetFile.cxx.

References fClient, XrdClient::GetCacheInfo(), Long64_t, and size.

Bool_t TXNetFile::ReadBufferAsync ( Long64_t  offs,
Int_t  len 
) [virtual]

Reimplemented from TFile.

Definition at line 678 of file TXNetFile.cxx.

References TObject::Error(), TFile::fArchiveOffset, TFile::fBytesRead, fClient, TFile::fgBytesRead, TFile::fgReadCalls, TVirtualPerfStats::FileReadEvent(), fIsRootd, TFile::fReadCalls, gDebug, TFile::GetFileBytesRead(), TFile::GetFileReadCalls(), gPerfStats, TObject::Info(), IsOpen(), TObject::IsZombie(), kFALSE, kOK, kTRUE, XrdClient::Read_Async(), result(), TFile::SetFileBytesRead(), TFile::SetFileReadCalls(), start, and SynchronizeCacheSize().

TFile::EAsyncOpenStatus TXNetFile::GetAsyncOpenStatus (  )  [virtual]

Reimplemented from TFile.

Definition at line 980 of file TXNetFile.cxx.

References TFile::fAsyncOpenStatus, fClient, XrdClient::IsOpen(), XrdClient::IsOpen_inprogress(), TFile::kAOSFailure, TFile::kAOSInProgress, TFile::kAOSNotAsync, and TFile::kAOSSuccess.

Bool_t TXNetFile::IsOpen (  )  const [virtual]

Reimplemented from TNetFile.

Definition at line 962 of file TXNetFile.cxx.

References fClient, TFile::fInitDone, fIsRootd, gDebug, TObject::Info(), TNetFile::IsOpen(), XrdClient::IsOpen(), and kFALSE.

Referenced by Close(), Flush(), ReadBuffer(), ReadBufferAsync(), ReadBuffers(), SysClose(), SysOpen(), SysStat(), WriteBuffer(), TAlienFile::~TAlienFile(), and ~TXNetFile().

void TXNetFile::Print ( Option_t option = ""  )  const [virtual]

Reimplemented from TNetFile.

Definition at line 1420 of file TXNetFile.cxx.

References fClient, XrdClient::GetCacheInfo(), Long64_t, TFile::Print(), Printf(), and size.

Bool_t TXNetFile::ReadBuffer ( char *  buf,
Int_t  len 
) [virtual]

Reimplemented from TNetFile.

Definition at line 585 of file TXNetFile.cxx.

References TObject::Error(), TFile::fBytesRead, fClient, TFile::fgBytesRead, TFile::fgReadCalls, TVirtualPerfStats::FileReadEvent(), fIsRootd, TFile::fOffset, TFile::fReadCalls, gDebug, TFile::GetCacheRead(), TFile::GetFileBytesRead(), TFile::GetFileReadCalls(), gMonitoringWriter, gPerfStats, TObject::Info(), IsOpen(), TObject::IsZombie(), kFALSE, kTRUE, XrdClient::Read(), TNetFile::ReadBuffer(), TFile::ReadBufferViaCache(), result(), TVirtualMonitoringWriter::SendFileReadProgress(), TFile::SetFileBytesRead(), TFile::SetFileReadCalls(), and start.

Bool_t TXNetFile::ReadBuffer ( char *  buf,
Long64_t  pos,
Int_t  len 
) [virtual]

Reimplemented from TNetFile.

Definition at line 669 of file TXNetFile.cxx.

References TNetFile::ReadBuffer().

Bool_t TXNetFile::ReadBuffers ( char *  buf,
Long64_t pos,
Int_t len,
Int_t  nbuf 
) [virtual]

Reimplemented from TNetFile.

Definition at line 741 of file TXNetFile.cxx.

References TObject::Error(), TFile::fArchiveOffset, TFile::fBytesRead, fClient, TFile::fgBytesRead, TFile::fgReadCalls, TVirtualPerfStats::FileReadEvent(), fIsRootd, TFile::fOffset, TFile::fReadCalls, gDebug, TDirectoryFile::GetBufferSize(), TFile::GetCacheRead(), TFile::GetFileBytesRead(), TFile::GetFileReadCalls(), gMonitoringWriter, gPerfStats, i, TObject::Info(), IsOpen(), TObject::IsZombie(), kFALSE, kTRUE, Long64_t, TNetFile::ReadBuffers(), TFile::ReadBuffers(), XrdClient::ReadV(), ResetCache(), TVirtualMonitoringWriter::SendFileReadProgress(), TFile::SetFileBytesRead(), TFile::SetFileReadCalls(), start, and SynchronizeCacheSize().

Int_t TXNetFile::ReOpen ( const Option_t mode  )  [virtual]

Definition at line 1000 of file TXNetFile.cxx.

References fIsRootd, gDebug, TObject::Info(), TFile::ReOpen(), and TNetFile::ReOpen().

Bool_t TXNetFile::WriteBuffer ( const char *  buffer,
Int_t  BufferLength 
) [virtual]

Reimplemented from TNetFile.

Definition at line 838 of file TXNetFile.cxx.

References TObject::Error(), TFile::fBytesWrite, fClient, TFile::fgBytesWrite, fIsRootd, TFile::fOffset, TDirectoryFile::fWritable, gDebug, TFile::GetFileBytesWritten(), TObject::Info(), IsOpen(), TObject::IsZombie(), kFALSE, kTRUE, TFile::SetFileBytesWritten(), XrdClient::Write(), TNetFile::WriteBuffer(), and TFile::WriteBufferViaCache().


Friends And Related Function Documentation

friend class TXNetSystem [friend]

Definition at line 67 of file TXNetFile.h.


Member Data Documentation

XrdClient* TXNetFile::fClient [private]

Definition at line 71 of file TXNetFile.h.

Referenced by Close(), CreateXClient(), Flush(), GetAsyncOpenStatus(), GetBytesToPrefetch(), Init(), IsOpen(), Open(), Print(), ReadBuffer(), ReadBufferAsync(), ReadBuffers(), ResetCache(), SynchronizeCacheSize(), SysClose(), SysOpen(), SysStat(), WriteBuffer(), and ~TXNetFile().

Bool_t TXNetFile::fIsRootd [private]

Definition at line 72 of file TXNetFile.h.

Referenced by Close(), CreateXClient(), Flush(), Init(), IsOpen(), ReadBuffer(), ReadBufferAsync(), ReadBuffers(), ReOpen(), SysClose(), SysOpen(), SysStat(), and WriteBuffer().

Bool_t TXNetFile::fgInitDone [static, private]

Definition at line 75 of file TXNetFile.h.

Referenced by TXNetFile().

Bool_t TXNetFile::fgRootdBC [static, private]

Definition at line 76 of file TXNetFile.h.

Referenced by CreateXClient(), and SetEnv().

TFileStager * TXNetFile::fgFileStager [static, private]

Definition at line 77 of file TXNetFile.h.

Referenced by CreateXClient().

XrdSysRecMutex* TXNetFile::fInitMtx [private]

Definition at line 79 of file TXNetFile.h.

Referenced by Init(), TXNetFile(), and ~TXNetFile().


The documentation for this class was generated from the following files:
Generated on Tue Jul 5 16:49:53 2011 for ROOT_528-00b_version by  doxygen 1.5.1