CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
TStorageFactoryFile Class Reference

#include <TStorageFactoryFile.h>

Inheritance diagram for TStorageFactoryFile:

Public Member Functions

 ClassDef (TStorageFactoryFile, 0)
 
virtual Bool_t ReadBuffer (char *buf, Int_t len)
 
virtual Bool_t ReadBuffer (char *buf, Long64_t pos, Int_t len)
 
virtual Bool_t ReadBufferAsync (Long64_t off, Int_t len)
 
virtual Bool_t ReadBuffers (char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
 
void ResetErrno (void) const
 
 TStorageFactoryFile (const char *name, Option_t *option, const char *ftitle, Int_t compress, Int_t netopt, Bool_t parallelopen=kFALSE)
 
 TStorageFactoryFile (const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1)
 
virtual Bool_t WriteBuffer (const char *buf, Int_t len)
 
 ~TStorageFactoryFile (void)
 

Protected Member Functions

virtual Int_t SysClose (Int_t fd)
 
virtual Int_t SysOpen (const char *pathname, Int_t flags, UInt_t mode)
 
virtual Long64_t SysSeek (Int_t fd, Long64_t offset, Int_t whence)
 
virtual Int_t SysStat (Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
 
virtual Int_t SysSync (Int_t fd)
 

Private Member Functions

void Initialize (const char *name, Option_t *option="")
 
Bool_t ReadBuffersSync (char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
 
void releaseStorage ()
 
 TStorageFactoryFile (void)
 

Private Attributes

edm::propagate_const
< std::unique_ptr< Storage > > 
storage_
 

Detailed Description

TFile wrapper around StorageFactory and Storage.

Definition at line 16 of file TStorageFactoryFile.h.

Constructor & Destructor Documentation

TStorageFactoryFile::TStorageFactoryFile ( const char *  name,
Option_t *  option,
const char *  ftitle,
Int_t  compress,
Int_t  netopt,
Bool_t  parallelopen = kFALSE 
)

Definition at line 108 of file TStorageFactoryFile.cc.

TStorageFactoryFile::TStorageFactoryFile ( const char *  name,
Option_t *  option = "",
const char *  ftitle = "",
Int_t  compress = 1 
)

Definition at line 124 of file TStorageFactoryFile.cc.

TStorageFactoryFile::~TStorageFactoryFile ( void  )

Definition at line 225 of file TStorageFactoryFile.cc.

TStorageFactoryFile::TStorageFactoryFile ( void  )
private

Definition at line 97 of file TStorageFactoryFile.cc.

Member Function Documentation

TStorageFactoryFile::ClassDef ( TStorageFactoryFile  ,
 
)
void TStorageFactoryFile::Initialize ( const char *  name,
Option_t *  option = "" 
)
private

Definition at line 139 of file TStorageFactoryFile.cc.

Bool_t TStorageFactoryFile::ReadBuffer ( char *  buf,
Int_t  len 
)
virtual

Definition at line 244 of file TStorageFactoryFile.cc.

Bool_t TStorageFactoryFile::ReadBuffer ( char *  buf,
Long64_t  pos,
Int_t  len 
)
virtual

Definition at line 235 of file TStorageFactoryFile.cc.

Bool_t TStorageFactoryFile::ReadBufferAsync ( Long64_t  off,
Int_t  len 
)
virtual

Definition at line 311 of file TStorageFactoryFile.cc.

Bool_t TStorageFactoryFile::ReadBuffers ( char *  buf,
Long64_t *  pos,
Int_t *  len,
Int_t  nbuf 
)
virtual

Definition at line 432 of file TStorageFactoryFile.cc.

Bool_t TStorageFactoryFile::ReadBuffersSync ( char *  buf,
Long64_t *  pos,
Int_t *  len,
Int_t  nbuf 
)
private

Most storage systems are not prepared for the onslaught of small reads that ROOT will perform, even if they implement a vectored read interface.

Typically, on the server side, the loop is unrolled and the reads are issued sequentially - giving the OS no hint that you're about to read a very close-by byte in the near future. Normally, OS read-ahead takes care of such situations; because the storage server has so many clients, and ROOT reads look random to the OS, the read-ahead becomes disabled.

Hence, this function will repack the application-layer request into an optimized storage-layer request. The resulting request to the storage layer typically has a slightly larger number of bytes, but far less individual reads.

On average, the server's disks see a smaller number of overall reads, the number of bytes transferred over the network increases modestly (around 10%), and the single application request becomes one-to-two I/O transactions. A clear win for all cases except high-latency WAN.

Definition at line 365 of file TStorageFactoryFile.cc.

void TStorageFactoryFile::releaseStorage ( )
inlineprivate

Definition at line 56 of file TStorageFactoryFile.h.

References edm::get_underlying_safe(), and storage_.

56 {get_underlying_safe(storage_).release();}
edm::propagate_const< std::unique_ptr< Storage > > storage_
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
void TStorageFactoryFile::ResetErrno ( void  ) const

Definition at line 625 of file TStorageFactoryFile.cc.

Int_t TStorageFactoryFile::SysClose ( Int_t  fd)
protectedvirtual

Definition at line 574 of file TStorageFactoryFile.cc.

Int_t TStorageFactoryFile::SysOpen ( const char *  pathname,
Int_t  flags,
UInt_t  mode 
)
protectedvirtual

Definition at line 543 of file TStorageFactoryFile.cc.

Long64_t TStorageFactoryFile::SysSeek ( Int_t  fd,
Long64_t  offset,
Int_t  whence 
)
protectedvirtual

Definition at line 589 of file TStorageFactoryFile.cc.

Int_t TStorageFactoryFile::SysStat ( Int_t  fd,
Long_t *  id,
Long64_t *  size,
Long_t *  flags,
Long_t *  modtime 
)
protectedvirtual

Definition at line 611 of file TStorageFactoryFile.cc.

Int_t TStorageFactoryFile::SysSync ( Int_t  fd)
protectedvirtual

Definition at line 602 of file TStorageFactoryFile.cc.

Bool_t TStorageFactoryFile::WriteBuffer ( const char *  buf,
Int_t  len 
)
virtual

Definition at line 480 of file TStorageFactoryFile.cc.

Member Data Documentation

edm::propagate_const<std::unique_ptr<Storage> > TStorageFactoryFile::storage_
private

Definition at line 60 of file TStorageFactoryFile.h.

Referenced by releaseStorage().