xrootd
XrdRmc.hh
Go to the documentation of this file.
1 #ifndef __XRDRMC_HH__
2 #define __XRDRMC_HH__
3 /******************************************************************************/
4 /* */
5 /* X r d R m c . h h */
6 /* */
7 /* (c) 2019 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Department of Energy */
11 /* */
12 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #include "XrdOuc/XrdOucCache.hh"
34 
90 class XrdRmc
91 {
92 public:
93 
94 //-----------------------------------------------------------------------------
96 //-----------------------------------------------------------------------------
97 
98 struct Parms
99  {long long CacheSize;
100  int PageSize;
101  int Max2Cache;
102  int MaxFiles;
103  int Options;
104  short minPages;
105  short Reserve1;
106  int Reserve2;
107 
108  Parms() : CacheSize(104857600), PageSize(32768),
109  Max2Cache(0), MaxFiles(0), Options(0),
110  minPages(0), Reserve1(0), Reserve2(0) {}
111  };
112 
113 // Valid option values in Parms::Options
114 //
115 static const int
116 isServer = 0x0010;
117  // Appropriate internal optimizations will be used.
118 static const int
119 isStructured = 0x0020; // Optimize for structured files (e.g. root).
120 
121 static const int
122 canPreRead = 0x0040;
123 
124 static const int
125 logStats = 0x0080;
126 
127 static const int
128 Serialized = 0x0004;
129 
130 static const int
131 ioMTSafe = 0x0008;
132 
133 static const int
134 Debug = 0x0003;
135 
136 //-----------------------------------------------------------------------------
144 //-----------------------------------------------------------------------------
145 
146 static XrdOucCache *Create(Parms &Params, XrdOucCacheIO::aprParms *aprP=0);
147 
148  XrdRmc() {}
149  ~XrdRmc() {}
150 };
151 #endif
int MaxFiles
Maximum number of files (default 256 or 8K)
Definition: XrdRmc.hh:102
int Max2Cache
Largest read to cache (default PageSize)
Definition: XrdRmc.hh:101
int Reserve2
Reserved for future use.
Definition: XrdRmc.hh:106
int PageSize
Size of each page in bytes (default 32KB)
Definition: XrdRmc.hh:100
static const int logStats
Display statistics upon detach.
Definition: XrdRmc.hh:125
Parameters for a newly created memory cache.
Definition: XrdRmc.hh:98
Definition: XrdOucCache.hh:502
Definition: XrdOucCache.hh:295
long long CacheSize
Size of cache in bytes (default 100MB)
Definition: XrdRmc.hh:99
short minPages
Minimum number of pages (default 256)
Definition: XrdRmc.hh:104
Definition: XrdRmc.hh:90
static XrdOucCache * Create(Parms &Params, XrdOucCacheIO::aprParms *aprP=0)
static const int isServer
This is server application; not a user application.
Definition: XrdRmc.hh:116
static const int isStructured
Definition: XrdRmc.hh:119
Parms()
Definition: XrdRmc.hh:108
~XrdRmc()
Definition: XrdRmc.hh:149
static const int ioMTSafe
CacheIO object is MT-safe.
Definition: XrdRmc.hh:131
int Options
Options as defined below (default r/o cache)
Definition: XrdRmc.hh:103
static const int Debug
Produce some debug messages (levels 0, 1, 2, or 3)
Definition: XrdRmc.hh:134
static const int canPreRead
Enable pre-read operations (o/w ignored)
Definition: XrdRmc.hh:122
static const int Serialized
Caller ensures MRSW semantics.
Definition: XrdRmc.hh:128
short Reserve1
Reserved for future use.
Definition: XrdRmc.hh:105
XrdRmc()
Definition: XrdRmc.hh:148