xrootd
Main Page
Namespaces
Classes
Files
File List
File Members
src
XrdFrm
XrdFrmFiles.hh
Go to the documentation of this file.
1
#ifndef __FRMFILES__HH
2
#define __FRMFILES__HH
3
/******************************************************************************/
4
/* */
5
/* X r d F r m F i l e s . h h */
6
/* */
7
/* (c) 2009 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 <string.h>
34
#include <sys/types.h>
35
36
#include "
XrdFrc/XrdFrcXAttr.hh
"
37
#include "
XrdOss/XrdOssPath.hh
"
38
#include "
XrdOuc/XrdOucHash.hh
"
39
#include "
XrdOuc/XrdOucNSWalk.hh
"
40
#include "
XrdOuc/XrdOucXAttr.hh
"
41
42
class
XrdOucTList
;
43
44
/******************************************************************************/
45
/* C l a s s X r d F r m F i l e s e t */
46
/******************************************************************************/
47
48
class
XrdFrmFileset
49
{
50
public
:
51
friend
class
XrdFrmFiles
;
52
53
// The following are the extended attributes describing file characteristics
54
//
55
XrdOucXAttr<XrdFrcXAttrCpy>
cpyInfo
;
// Last copy time
56
XrdOucXAttr<XrdFrcXAttrPin>
pinInfo
;
// Pin information
57
58
// These are inline function to return most common file information
59
//
60
inline
XrdOucNSWalk::NSEnt
*
baseFile
() {
return
File
[
XrdOssPath::isBase
];}
61
const
char
*
basePath
() {
return
Mkfn
(
baseFile
());}
62
inline
XrdOucNSWalk::NSEnt
*
failFile
() {
return
File
[
XrdOssPath::isFail
];}
63
const
char
*
failPath
() {
return
Mkfn
(
failFile
());}
64
inline
XrdOucNSWalk::NSEnt
*
lockFile
() {
return
File
[
XrdOssPath::isLock
];}
65
const
char
*
lockPath
() {
return
Mkfn
(
lockFile
());}
66
inline
XrdOucNSWalk::NSEnt
*
pfnFile
() {
return
File
[
XrdOssPath::isPfn
];}
67
const
char
*
pfnPath
() {
return
Mkfn
(
pfnFile
());}
68
inline
XrdOucNSWalk::NSEnt
*
pinFile
() {
return
File
[
XrdOssPath::isPin
];}
69
const
char
*
pinPath
() {
return
Mkfn
(
pinFile
());}
70
71
inline
XrdOucNSWalk::NSEnt
*
xyzFile
(
XrdOssPath::theSfx
sfx) {
return
File
[sfx];}
72
const
char
*
xyzPath
(
XrdOssPath::theSfx
sfx)
73
{
return
Mkfn
(
File
[sfx]);}
74
75
int
dirPath
(
char
*dBuff,
int
dBlen);
76
77
static
void
Purge
() {
BadFiles
.
Purge
();}
78
79
int
Refresh
(
int
isMig=0,
int
doLock=1);
80
81
int
Screen
(
int
needLF=1);
82
83
int
setCpyTime
(
int
Refresh
=0);
84
85
XrdFrmFileset
(
XrdFrmFileset
*sP=0,
XrdOucTList
*diP=0);
86
~XrdFrmFileset
();
87
88
// The following are public to ease management of this object
89
//
90
XrdFrmFileset
*
Next
;
91
int
Age
;
92
93
private
:
94
int
chkLock
(
const
char
*
Path
);
95
const
char
*
Mkfn
(
XrdOucNSWalk::NSEnt
*fP);
96
void
Remfix
(
const
char
*fType,
const
char
*fPath);
97
98
// These are the basic set of files related to the base file. Two other file
99
// suffixes are ignore for fileset purposes (".anew" and ".stage").
100
//
101
XrdOucNSWalk::NSEnt
*
File
[
XrdOssPath::sfxNum
];
102
103
XrdOucTList
*
dInfo
;
// Shared directory information
104
105
static
XrdOucHash<char>
BadFiles
;
106
107
static
const
int
dLen
= 0;
// Index to directory path length in dInfo
108
static
const
int
dRef
= 1;
// Index to the reference counter in dInfo
109
};
110
111
/******************************************************************************/
112
/* C l a s s X r d F r m F i l e s */
113
/******************************************************************************/
114
115
class
XrdFrmFiles
116
{
117
public
:
118
119
XrdFrmFileset
*
Get
(
int
&rc,
int
noBase=0);
120
121
static
const
int
Recursive
= 0x0001;
// List filesets recursively
122
static
const
int
CompressD
= 0x0002;
// Use shared directory object (not MT)
123
static
const
int
NoAutoDel
= 0x0004;
// Do not automatically delete objects
124
static
const
int
GetCpyTim
= 0x0008;
// Initialize cpyInfo attribute on Get()
125
126
XrdFrmFiles
(
const
char
*dname,
int
opts
=
Recursive
,
127
XrdOucTList
*XList=0,
XrdOucNSWalk::CallBack
*cbP=0);
128
129
~XrdFrmFiles
();
130
131
private
:
132
void
Complain
(
const
char
*dPath);
133
int
oldFile
(
XrdOucNSWalk::NSEnt
*fP,
XrdOucTList
*dP,
int
fType);
134
int
Process
(
XrdOucNSWalk::NSEnt
*nP,
const
char
*dPath);
135
136
XrdOucHash<XrdFrmFileset>
fsTab
;
137
138
XrdOucNSWalk
nsObj
;
139
XrdFrmFileset
*
fsList
;
140
XrdOucHash_Options
manMem
;
141
int
shareD
;
142
int
getCPT
;
143
};
144
#endif
Generated by
1.8.3.1