xrootd
Loading...
Searching...
No Matches
XrdOfsPoscq.hh
Go to the documentation of this file.
1#ifndef __OFSPOSCQ_H__
2#define __OFSPOSCQ_H__
3/******************************************************************************/
4/* */
5/* X r d O f s P o s c q . 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 <map>
34#include <string>
35
37
38class XrdOss;
39class XrdSysError;
40
42{
43public:
44
45struct Request
46{
47long long addT; // Time committed to the queue
48char LFN[1024]; // Logical File Name (null terminated)
49char User[288]; // User trace identifier
50char Reserved[24]; // Reserved for future
51};
52
53static const int ReqOffs = 64;
54static const int ReqSize = sizeof(Request);
55
56struct recEnt
57{
60int Mode;
62 recEnt(struct Request &reqref, int mval, recEnt *nval=0)
63 {Next = nval; Offset = 0; Mode = mval; reqData = reqref;}
64};
65
66 int Add(const char *Tident, const char *Lfn, bool isNew);
67
68 int Commit(const char *Lfn, int Offset);
69
70 int Del(const char *Lfn, int Offset, int Unlink=0);
71
72 recEnt *Init(int &Ok);
73
74static recEnt *List(XrdSysError *Say, const char *theFN);
75
76inline int Num() {return pocIQ;}
77
78 XrdOfsPoscq(XrdSysError *erp, XrdOss *oss, const char *fn,
79 int sv=1);
81
82private:
83void FailIni(const char *lfn);
84//int reqRead(void *Buff, int Offs);
85bool reqWrite(void *Buff, int Bsz, int Offs);
86bool ReWrite(recEnt *rP);
87bool VerOffset(const char *Lfn, int Offset);
88
91 int Offset;
92 };
93
94std::map<std::string, int> pqMap;
95
101char *pocFN;
105unsigned
106short pocWS;
107unsigned
108short pocSV;
109};
110#endif
Definition XrdOfsPoscq.hh:42
int Num()
Definition XrdOfsPoscq.hh:76
bool VerOffset(const char *Lfn, int Offset)
static const int ReqOffs
Definition XrdOfsPoscq.hh:53
static recEnt * List(XrdSysError *Say, const char *theFN)
unsigned short pocWS
Definition XrdOfsPoscq.hh:106
FileSlot * SlotList
Definition XrdOfsPoscq.hh:99
int Del(const char *Lfn, int Offset, int Unlink=0)
int pocSZ
Definition XrdOfsPoscq.hh:102
~XrdOfsPoscq()
Definition XrdOfsPoscq.hh:80
char * pocFN
Definition XrdOfsPoscq.hh:101
recEnt * Init(int &Ok)
void FailIni(const char *lfn)
int pocIQ
Definition XrdOfsPoscq.hh:104
XrdSysMutex myMutex
Definition XrdOfsPoscq.hh:96
bool reqWrite(void *Buff, int Bsz, int Offs)
XrdOfsPoscq(XrdSysError *erp, XrdOss *oss, const char *fn, int sv=1)
static const int ReqSize
Definition XrdOfsPoscq.hh:54
unsigned short pocSV
Definition XrdOfsPoscq.hh:108
std::map< std::string, int > pqMap
Definition XrdOfsPoscq.hh:94
XrdSysError * eDest
Definition XrdOfsPoscq.hh:97
FileSlot * SlotLust
Definition XrdOfsPoscq.hh:100
int Commit(const char *Lfn, int Offset)
int pocFD
Definition XrdOfsPoscq.hh:103
XrdOss * ossFS
Definition XrdOfsPoscq.hh:98
int Add(const char *Tident, const char *Lfn, bool isNew)
bool ReWrite(recEnt *rP)
Definition XrdOss.hh:498
Definition XrdSysError.hh:90
Definition XrdSysPthread.hh:165
Definition XrdOfsPoscq.hh:90
FileSlot * Next
Definition XrdOfsPoscq.hh:90
int Offset
Definition XrdOfsPoscq.hh:91
Definition XrdOfsPoscq.hh:46
char User[288]
Definition XrdOfsPoscq.hh:49
long long addT
Definition XrdOfsPoscq.hh:47
char Reserved[24]
Definition XrdOfsPoscq.hh:50
char LFN[1024]
Definition XrdOfsPoscq.hh:48
Definition XrdOfsPoscq.hh:57
recEnt * Next
Definition XrdOfsPoscq.hh:58
recEnt(struct Request &reqref, int mval, recEnt *nval=0)
Definition XrdOfsPoscq.hh:62
int Mode
Definition XrdOfsPoscq.hh:60
struct Request reqData
Definition XrdOfsPoscq.hh:61
int Offset
Definition XrdOfsPoscq.hh:59