Loading...
Searching...
No Matches
XrdPosixCache Class Reference

`#include <XrdPosixCache.hh>`

Collaboration diagram for XrdPosixCache:

## Public Member Functions

| XrdPosixCache ()
| Constructor and destructor.
| ~XrdPosixCache ()
int | CachePath (const char *url, char *buff, int blen)
int | CacheQuery (const char *url, bool hold=false)
int | Rename (const char *oldPath, const char *newPath)
int | Rmdir (const char *path)
int | Stat (const char *path, struct stat &sbuff)
void | Statistics (XrdOucCacheStats &Stats)
int | Truncate (const char *path, off_t size)
int | Unlink (const char *path)

## Detailed Description

Definition at line 35 of file XrdPosixCache.hh.

## Constructor & Destructor Documentation

## XrdPosixCache()

XrdPosixCache::XrdPosixCache | ( |  | ) |

inline

Constructor and destructor.

Definition at line 138 of file XrdPosixCache.hh.

{}

## ~XrdPosixCache()

XrdPosixCache::~XrdPosixCache | ( |  | ) |

inline

Definition at line 139 of file XrdPosixCache.hh.

{}

## Member Function Documentation

## CachePath()

int XrdPosixCache::CachePath | ( | const char * | url,
|  | char * | buff,
|  | int | blen )

Convert a logical path to the path of the corresonding entry in the cache.

Parameters

  url | -> url of the directory or file to be converted.
  buff | -> buffer to receive the result.
  blen | The length of the buffer (should be at least 1024).

Returns
  =0 Buffer holds the result.
  <0 Conversion failed, the return value is -errno.

Definition at line 50 of file XrdPosixCache.cc.

{
return theCache->LocalFilePath(url, buff, blen, XrdOucCache::ForPath);
}
XrdOucCache::ForPath
@ ForPath
Definition XrdOucCache.hh:570
XrdOucCache::LocalFilePath
virtual int LocalFilePath(const char *url, char *buff=0, int blen=0, LFP_Reason why=ForAccess, bool forall=false)
Definition XrdOucCache.hh:572
XrdPosixGlobals::theCache
XrdOucCache * theCache
Definition XrdPosixConfig.cc:77

References XrdOucCache::ForPath, and XrdPosixGlobals::theCache.

## CacheQuery()

int XrdPosixCache::CacheQuery | ( | const char * | url,
|  | bool | hold = false )

Check cache status of a file.

Parameters

  url | -> url of the logical file to be checked in the cache.
  hold | When true, the file purge time is extended to allow the file to be accessed before eligible for purging. When false (the default) only status information is returned.

Returns
  >0 The file is fully cached.
  =0 The file exists in the cache but is not fully cached.
  <0 The file does not exist in the cache.

Definition at line 59 of file XrdPosixCache.cc.

{
int rc = theCache->LocalFilePath(url, 0, 0,
(hold ? XrdOucCache::ForAccess
: XrdOucCache::ForInfo)
);
if (!rc) return 1;
if (rc == -EREMOTE) return 0;
return -1;
}
XrdOucCache::ForAccess
@ ForAccess
Definition XrdOucCache.hh:570
XrdOucCache::ForInfo
@ ForInfo
Definition XrdOucCache.hh:570

References XrdOucCache::ForAccess, XrdOucCache::ForInfo, and XrdPosixGlobals::theCache.

## Rename()

int XrdPosixCache::Rename | ( | const char * | oldPath,
|  | const char * | newPath )

Rename a file or directory in the cache.

Parameters

  oldPath | -> filepath of existing directory or file.
  newPath | -> filepath the directory or file is to have.

Returns
  0 This method is currently not supported.

Definition at line 82 of file XrdPosixCache.cc.

{return theCache->Rename(oldPath, newPath);}
XrdOucCache::Rename
virtual int Rename(const char *oldp, const char *newp)
Definition XrdOucCache.hh:610

References XrdPosixGlobals::theCache.

## Rmdir()

int XrdPosixCache::Rmdir | ( | const char * | path | ) |

Remove directory from the cache.

Parameters

  path | -> filepath of directory to be removed

Returns
  0 This method is currently not supported.

Definition at line 75 of file XrdPosixCache.cc.

{return theCache->Rmdir(path);}
XrdOucCache::Rmdir
virtual int Rmdir(const char *dirp)
Definition XrdOucCache.hh:622

References XrdPosixGlobals::theCache.

## Stat()

int XrdPosixCache::Stat | ( | const char * | path,
|  | struct stat & | sbuff )

Rename a file or directory in the cache.

Parameters

  path | -> filepath of existing directory or file. This is the actual path in the cache (see CachePath()).
  sbuff | Reference to the stat structure to hold the information.

Returns
  =0 The sbuff hold the information.
  !0 The file or direcory does not exist in the cache.

Definition at line 89 of file XrdPosixCache.cc.

{return theCache->Stat(path, sbuff);}
XrdOucCache::Stat
virtual int Stat(const char *url, struct stat &sbuff)
Definition XrdOucCache.hh:638

References stat, and XrdPosixGlobals::theCache.

## Statistics()

void XrdPosixCache::Statistics | ( | XrdOucCacheStats & | Stats | ) |

Rename a file or directory in the cache.

Parameters

  Stats | Reference to the statistics object to be filled in.

Definition at line 96 of file XrdPosixCache.cc.

{return theCache->Statistics.Get(Stats);}
XrdOucCacheStats::Get
void Get(XrdOucCacheStats &D)
Definition XrdOucCacheStats.hh:95
XrdOucCache::Statistics
XrdOucCacheStats Statistics
Definition XrdOucCache.hh:686
XrdPosixGlobals::Stats
XrdPosixStats Stats
Definition XrdPosixFile.cc:64

References XrdPosixGlobals::Stats, and XrdPosixGlobals::theCache.

## Truncate()

int XrdPosixCache::Truncate | ( | const char * | path,
|  | off_t | size )

Truncate a file in the cache.

Parameters

  path | -> filepath of file to be truncated.
  size | The size in bytes the file should have.

Returns
  0 This method is currently not supported.

Definition at line 103 of file XrdPosixCache.cc.

{return theCache->Truncate(path, size);}
XrdOucCache::Truncate
virtual int Truncate(const char *path, off_t size)
Definition XrdOucCache.hh:651

References XrdPosixGlobals::theCache.

## Unlink()

int XrdPosixCache::Unlink | ( | const char * | path | ) |

Remove a file from the cache.

Parameters

  path | -> filepath of file to be removed.

Returns
  =0 File was removed.
  !0 File could not be removed, because of one of the below: -EBUSY - the file is in use. -EAGAIN - file is currently subject to internal processing. -errno - file was not removed, filesystem unlink() failed.

Definition at line 110 of file XrdPosixCache.cc.

{return theCache->Unlink(path);}
XrdOucCache::Unlink
virtual int Unlink(const char *path)
Definition XrdOucCache.hh:663

References XrdPosixGlobals::theCache.

The documentation for this class was generated from the following files:

- XrdPosixCache.hh
- XrdPosixCache.cc