DABC (Data Acquisition Backbone Core)  2.9.9
rawcommn.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Copyright:
3  * GSI, Gesellschaft fuer Schwerionenforschung mbH
4  * Planckstr. 1
5  * D-64291 Darmstadt
6  * Germany
7  * created 25. 1.1996 by Horst Goeringer
8  *********************************************************************
9  * rawcommn.h
10  * communication structure tsmcli client - servers
11  *********************************************************************
12  * 11. 9.1996, H.G.: alternate archive tape device "ARCH_TAPE_2" added
13  * 26. 9.1996, H.G.: new archive tape device "ARCH_TAPE_MC" added
14  * "ARCH_TAPE_2" changed to "ARCH_TAPE_MC_2"
15  * 8. 1.1997, H.G.: new parameter MAX_FILE_SIZE
16  * 21. 7.1997, H.G.: new parameter srawComm.cliNode
17  * 10. 9.1997, H.G.: new ACTION value STAGE
18  * 15. 9.1997, H.G.: new enum RETR_DEVICE
19  * 26. 9.1997, H.G.: new ACTION value RETRIEVE_STAGE
20  * 21.10.1997, H.G.: replace ARCHIVE_STAGE by ARCHIVE_OVER
21  * 19. 1.1998, H.G.: new status flag STA_END_OF_FILE_NOT_STAGED
22  * 8. 7.1998, H.G.: use MBUF_SOCK and MBUF_ADSM; set both to 16384
23  * new filetype STREAM
24  * 28. 7.1999, H.G.: new ACTION values UNSTAGE, QUERY_UNSTAGE
25  * 16. 8.2000, H.G.: new ACTION values QUERY_WORKSPACE, QUERY_POOL
26  * new structures srawPoolStatus, srawWorkSpace
27  * 16. 8.2000, H.G.: mod srawPoolStatus, new srawPoolAttr
28  * 5. 9.2000, H.G.: new ACTION value QUERY_STAGE
29  * 22.11.2000, H.G.: enhance range of values for srawWorkSpace.iStatus
30  * 1.12.2000, H.G.: new status id IDENT_NEXT_BUFFER
31  * 21.12.2000, H.G.: new structure srawRequest for seek functionality
32  * 1. 2.2001, H.G.: new action values ARCHIVE_STAGE, METADATA_MOD
33  * 30. 5.2001, H.G.: increase MAX_TAPE_FILE from 16 to 17
34  * 13. 6.2001, H.G.: new STATUS value ARCHIVE_AVAILABLE
35  * 22. 6.2001, H.G.: new ACTION QUERY_RETRIEVE
36  * replace MPORT by new def PORT_MASTER
37  * 17. 7.2001, H.G.: enhance srawObjAttr by data mover info
38  * new structure srawDataMover
39  * 23. 8.2001, H.G.: enhance srawComm by stage info
40  * 29.10.2001, H.G.: ported to W2000
41  * 14.11.2001, H.G.: rename ACTION DELETE -> REMOVE (used in winnt.h)
42  * 28. 2.2002, H.G.: new: IDENT_STAGE_xxx, IDENT_SPACE_xx
43  * 15. 3.2002, H.G.: rename srawPoolAttr -> srawPoolStatusData, enhance
44  * 18. 3.2002, H.G.: new define MAX_NUM_DM (<- rawservn.h)
45  * 20. 3.2002, H.G.: new structure srawPoolStatusDMData
46  * 27. 5.2002, H.G.: new ACTION QUERY_ARCHIVE_OVER
47  * 6. 6.2002, H.G.: new identifier: IDENT_PURGE_INFO
48  * 20. 8.2002, H.G.: new identifier: IDENT_SPACE_LOOK
49  * 19. 9.2002, H.G.: new identifier: IDENT_CLEAN_REQUEST
50  * 26. 9.2002, H.G.: new definition PORT_RFIO_SERV
51  * 29.10.2002, H.G.: new identifier: IDENT_FILELIST_REQUEST,
52  * new define MAX_STAGE_FILE_NO
53  * 22.11.2002, H.G.: new status STA_INFO, STA_PURGED, STA_NOT_PURGED
54  * 13. 1.2003, H.G.: add definition PORT_MOVER
55  * 30. 1.2003, H.G.: add declarations cMasterNode(i), new: MAX_MASTER
56  * 13. 2.2003, H.G.: add definition MAX_MOVER
57  * 24. 2.2003, H.G.: new actions SPM_REQUEST_MOVER, QUERY_ARCHIVE_STAGE
58  * 8. 5.2003, H.G.: add synchronization parameters to srawDataMoverAttr
59  * 9. 5.2003, H.G.: add synchronization parameters to srawComm
60  * 21. 8.2003, H.G.: srawComm: new string cTapeLib,
61  * replace ACTION values:
62  * ARCHIVE_STAGE -> ARCHIVE_TO_STAGE
63  * METADATA_MOD -> ARCHIVE_FROM_STAGE
64  * new ACTION values: QUERY_ARCHIVE_TO_STAGE,
65  * QUERY_ARCHIVE_FROM_STAGE
66  * 28. 8.2003, H.G.: srawObjAttr: add parameter cStageUser
67  * 15. 9.2003, H.G.: increase MAX_NUM_DM: 5 -> 10
68  * 6.10.2003, H.G.: cNodeMaster2 now gsitsma, depc134 is backup node
69  * 10.10.2003, H.G.: new identifier: IDENT_QUERY_ARCHDB
70  * 15.10.2003, H.G.: new action END_SESSION
71  * 31.10.2003, H.G.: remove unused definition MAX_MOVER
72  * 6.11.2003, H.G.: new action QUERY_ARCHIVE_RECORD
73  * 18.11.2003, H.G.: new identifier: IDENT_FULL_ARCHDISK
74  * 18.12.2003, H.G.: new identifier: IDENT_ARCHIVE_FILE
75  * 22. 1.2004, H.G.: add cNodeMaster2A: gsitsmb
76  * 20. 2.2004, H.G.: srawObjAttr: rename iPort (unused) -> iFS
77  * new structure srawFileSystem
78  * 24. 2.2004, H.G.: new ACTION values:
79  * STAGE_FROM_CACHE, RETRIEVE_FROM_CACHE
80  * replace ACTION values:
81  * QUERY_ARCHIVE_TO_STAGE -> QUERY_ARCHIVE_TO_CACHE
82  * QUERY_ARCHIVE_FROM_STAGE ->QUERY_ARCHIVE_FROM_CACHE
83  * ARCHIVE_TO_STAGE -> ARCHIVE_TO_CACHE
84  * ARCHIVE_FROM_STAGE -> ARCHIVE_FROM_CACHE
85  * 5. 3.2004, H.G.: srawFileSystem: add cArchiveDate, cArchiveUser
86  * new ACTION value READ_FROM_CACHE
87  * 24. 6.2004, H.G.: new STATUS value STA_CACHE_FULL
88  * 29. 6.2004, H.G.: new ARCH_DEVICE value ARCH_DAQ_DISK for DaqPool
89  * 2. 7.2004, H.G.: new definitions: DEF_FILESIZE,
90  * SLEEP_CACHE_FULL, MAXLOOP_CACHE_FULL
91  * 18.10.2004, H.G.: new STATUS value STA_CACHE_FILE_AWAY
92  * 24.11.2004, H.G.: STATUS value ARCHIVE_AVAILABLE -> STA_ARCHIVE_AVAIL
93  * new: STA_ARCHIVE_NOT_AVAIL, STA_NO_ACCESS
94  * 26. 1.2005, H.G.: new ACTION value QUERY_RETRIEVE_STAGE
95  * 20.10.2005, H.G.: increase DEF_FILESIZE to nearly 2 GByte
96  * 25.11.2005, H.G.: add cNodeMasterE1/2: new entry server lxha05/4
97  * 7. 3.2006, H.G.: increase MAX_NUM_DM: 10 -> 16
98  * 13. 3.2006, H.G.: new STATUS value STA_SWITCH_ENTRY (for HA),
99  * new parameter srawComm.cNodeCacheMgr (for HA)
100  * 15. 3.2006, H.G.: new STATUS value STA_ENTRY_INFO (for HA)
101  * 17. 3.2006, H.G.: new entry server lxgstore
102  * 28. 4.2006, H.G.: cleanup cNodeMasterxx strings
103  * 9. 5.2006, H.G.: new actions for 2nd level DM: QUERY_FILESERVER,
104  * SEND_TO_FILESERVER, RECEIVE_FROM_DM
105  * rename QUERY_RETRIEVE_API -> QUERY_RETRIEVE_RECORD
106  * new parameters srawComm: iPoolIdRC, cNodeRC,
107  * iPoolIdWC, cNodeWC, iFSidWC,
108  * iPoolIdFC, cNodeFC, iFSidFC,
109  * 19. 5.2006, H.G.: new idents: IDENT_STAGE_LIST, IDENT_QUERY_FILEDB
110  * 2.10.2006, H.G.: new parameters srawObjAttr: iATLServer,
111  * iRestoHigh2, iRestoHighLow, iRestoHighLow2,
112  * 5.10.2006, H.G.: new parameter srawComm: iATLServer
113  * 28. 9.2006, H.G.: add MAX_ATLSERVER
114  * 24.11.2006, H.G.: new ident IDENT_QUERY_DONE
115  * 20.12.2006, H.G.: add ATLSERVER_ARCHIVE for API write to gStore
116  * 14. 5.2007, H.G.: in srawObjAttr: iRestoHighLow2 -> iRestoLowHigh,
117  * iRestoHigh2 -> iRestoHighHigh
118  * 17. 7.2007, H.G.: new limit: MAX_STAGE_FILE_NO = 1000
119  * 29. 2.2008, H.G.: new actions (for /lustre):
120  * COPY_TO_FILESYSTEM, RETRIEVE_TO_FILESYSTEM
121  * 6. 3.2008, H.G.: new parameter srawComm: iDataFS, cDataFS
122  * 7. 4.2008, H.G.: new parameter srawComm: iReservation,
123  * new action MIGRATE_CACHE_PATH
124  * 17. 4.2008, H.G.: new action ARCHIVE_FROM_FILESYSTEM
125  * 21. 4.2008, H.G.: change MAX_ATLSERVER, MAX_MASTER -> 1
126  * 23. 4.2008, H.G.: new status STA_FILE_CACHED
127  * 8. 5.2008, H.G.: move static declaration [p]cOS from rawclin.h
128  * 9. 5.2008, H.G.: add typedef srawFileList
129  * (replaces srawArchList in rawclin.h)
130  * 19. 5.2008, H.G.: remove old declarations: cNodeMaster1,
131  * cNodeMaster2A, cNodeMaster2B
132  * 2. 6.2008, H.G.: replace long->int if 64 bit client (ifdef SYSTEM64)
133  * server still 32 bit
134  * 3. 6.2008, H.G.: replace MBUF_API (unused) by MBUF_RFIO
135  * 19. 6.2008, H.G.: new ident: IDENT_CACHE_STATUS
136  * decrease MAX_NUM_DM: 16 -> 10 (no more Windows)
137  * 14. 8.2008, H.G.: new ACTION SHOW_ARCHIVES
138  * 3. 9.2008, H.G.: new statics cDataFSHigh, iDataFSHigh
139  * 12. 1.2008, H.G.: add definition PORT_MOVER_DATAFS
140  * 16. 9.2008, H.G.: cDataFSHigh -> cDataFSHigh1, cDataFSHigh2
141  * remove iDataFSHigh
142  * 17. 9.2008, H.G.: set MBUF_SOCK, MBUF_ADSM to 32768
143  * 12.12.2008, H.G.: add definition CUR_QUERY_LIMIT
144  * 12. 2.2009, H.G.: new identifier: IDENT_COPY_CACHE
145  * add structure srawCopyCache to srawAPIFile
146  * 23. 2.2009, H.G.: new status: STA_CACHE_COPY, STA_CACHE_COPY_ERROR
147  * 24. 2.2009, H.G.: add cDataFSType
148  * 10. 3.2009, H.G.: add trailing '/' to cDataFSHigh1, cDataFSHigh2
149  * new definition MIN_DATAFS_PATH
150  * 8. 4.2009, H.G.: action COPY_TO_FILESYSTEM -> COPY_RC_TO_FILESYSTEM
151  * new action COPY_WC_TO_FILESYSTEM
152  * 25. 5.2009, H.G.: new global strings cAdminUser, cForceMigPath
153  * 1. 7.2009, H.G.: new IDENT_ARCHIVE_LIST, srawArchiveList
154  * 3. 9.2009, H.G.: move MAX_STAGE_FILE_NO to rawservn.h
155  * 28. 9.2009, H.G.: rename READ_FROM_CACHE to SEND_FROM_CACHE
156  * 27.11.2009, H.G.: adds new definitions: MAX_OBJ_FS_N, MAX_OBJ_HL_N,
157  * MAX_OBJ_LL_N, MAX_MC_N
158  * 4.12.2009, H.G.: enhanced structure srawObjAttr (version 5)
159  * keep old structure as srawObjAttrOld (version 4)
160  * 7.12.2009, H.G.: new definition: VERSION_SRAWOBJATTR
161  * 18.12.2009, H.G.: overall usage of new object sizes in MAX_OBJ_FS_N,
162  * MAX_OBJ_HL_N, MAX_OBJ_LL_N (but no trailing _N)
163  * for srawObjAttrOld:
164  * MAX_OBJ_HL -> MAX_OBJ_HL_O,
165  * MAX_OBJ_LL -> MAX_OBJ_LL_O
166  * 14. 1.2010, H.G.: MAX_MC -> MAX_MC_O (in srawObjAttrOld),
167  * MAX_MC_N -> MAX_MC
168  * srawObjAttr: cMgmtClass[MAX_MC+2] (padded 8 byte)
169  * remove unused ARCH_TAPE_MC_2, RETR_STAGE_DATE
170  * srawObjAttr: new mem iDM (for 8 byte padding)
171  * 28. 1.2010, H.G.: new definition: MAX_FULL_FILE
172  * enhance STATUS_LEN 256 -> 512
173  * 29. 1.2010, H.G.: srawFileList.cFile: MAX_FILE -> MAX_FULL_FILE
174  * srawComm.cDataFS: MAX_FILE -> MAX_FULL_FILE
175  * srawCopyCache.cCopyPath: MAX_FILE -> MAX_FULL_FILE
176  * 5. 2.2010, H.G.: mod. values: MAX_OBJ_HL 112, MAX_OBJ_LL 52
177  * srawObjAttr: new mem iDummy (for 8 byte padding)
178  * new: SIZE_CACHE_METADATA_5, SIZE_CACHE_METADATA_4
179  * 11. 2.2010, H.G.: new definition: MAX_OBJ_HL_LEVEL
180  * 22. 2.2010, H.G.: srawObjAttr.iFileSize[2]: two int for future 64 bit:
181  * 4 byte padding, ident struct size 32/64 bit env
182  * if long in 64 bit env: 8 byte padding, diff struct
183  * sizes (also in V1, V2 metadata structures)
184  * 16. 4.2010, H.G.: srawDataMoverAttr: iSynchId -> iATLServer
185  * 9. 6.2010, H.G.: IDENT_PROC_INFO, MAX_ITEM added
186  * 3. 9.2010, H.G.: srawComm: enable 8 byte filesize in 64 bit OS
187  * new iFileSize2, MAX_APPLTYPE: 32 -> 28
188  * 10. 9.2010, H.G.: discard SYSTEM64, srawObjAttrOld: 4 byte iFileSize
189  * 6.10.2010, H.G.: srawComm: new iClient32
190  * new definition: MAX_FILE_SIZE_U
191  * 26.11.2010, H.G.: string cTooBig: substitute for filesizes >= 4 GB
192  * 19. 1.2011, H.G.: new IDENT_STAGE_PARALLEL, MAX_NUM_TAPE
193  * 21. 1.2011, H.G.: new action STAGE_PARALLEL, struct srawObjNameList,
194  * new IDENT_GLOBAL_SOCKET
195  * 24. 1.2011, H.G.: new structs srawStageSocket, srawStageSocketData
196  * 25. 1.2011, H.G.: add definition PORT_STAGER
197  * 3. 2.2011, H.G.: new actions SET_GLOBAL_SOCKET, UNSET_GLOBAL_SOCKET
198  * get definition PORT_STAGE_MGR from rawservn.h
199  * 9. 2.2011, H.G.: new parameter srawComm: iParStageId
200  * 2. 3.2011, H.G.: new IDENT_CACHEFS_ACTION
201  * 1. 4.2011, H.G.: new define MAX_NUM_DM_NO (digits in DM name)
202  * 4. 4.2011, H.G.: new IDENT_STAGE_SEQUENTIAL
203  * 15. 4.2011, H.G.: increase MAX_NUM_DM to 12
204  * 9. 2.2012, H.G.: remove MAX_MASTER, WORK_LEN (no longer needed),
205  * new STATUS_LEN_LONG
206  * 10. 2.2012, H.G.: new IDENT_MIGR_LIMIT
207  * 16. 2.2012, H.G.: get from rawservn.h: declaration cNodeStageMgr +
208  * cNodeArchiveMgr, definition PORT_ARCHIVE_MGR
209  * ren PORT_STAGER -> PORT_DISTR, move to rawservn.h
210  * 24. 2.2012, H.G.: srawFileSystem: add iPoolId
211  * 20. 4.2012, H.G.: /hera: new base directory for InfiniBand lustre
212  * 31. 8.2012, H.G.: enhanced usage, if srawComm.iDataFS > 1
213  * 6. 9.2012, H.G.: new parameter srawDataMoverAttr: iPoolId,
214  * new define MAX_POOL_ATLSERVER,
215  * 11. 9.2011, H.G.: mod define MAX_NUM_DM_NO 17 -> 20
216  * mod define MAX_NUM_DM 12 -> 13
217  * 31. 1.2013, H.G.: new IDENT_TAPE_STATUS_DM
218  * 19. 3.2013, H.G.: new action SEND_FROM_TAPE
219  * 3. 4.2013, H.G.: new action RETRIEVE_PARALLEL
220  * 4. 4.2013, H.G.: define MAX_NUM_POOL from rawstagen.h
221  * 12. 4.2013, H.G.: rename srawStageSocket -> srawGlobalSocket,
222  * srawStageSocketData -> srawGlobalSocketData,
223  * new srawGlobalNotice, new action SEND_GLOBAL_NOTICE
224  * 15. 4.2013, H.G.: in srawComm: ren iParStageId -> iGlobalActionId
225  * in srawGlobalSocketData: iParStageId -> iActionId
226  * 19. 4.2013, H.G.: new status STA_FILE_AVAIL
227  * 29. 4.2013, H.G.: srawObjNameList: add iCacheLocation (for par retr)
228  * 17. 5.2013, H.G.: srawObjNameList: add iPoolIdRC, iPoolIdWC
229  * 27. 6.2013, H.G.: srawGlobalNotice: add cFile (lustre file name)
230  * 12. 8.2013, H.G.: sComm.iSynchId==21: test access rights
231  * mod define MAX_NUM_DM 13 -> 20
232  * 19. 8.2013, H.G.: sComm.iSynchId>100: use alternate prod TSM server
233  * 22. 8.2013, H.G.: new IDENT_TAPE_STATUS_DM
234  * 2. 1.2014, H.G.: srawComm.iReservation <0: request filesize check
235  * comparing cacheDB - data mover FS
236  * srawObjAttr: iDummy -> iObjInfo: contains
237  * result of filesize check
238  * 3. 1.2014, H.G.: new IDENT_FILESIZE_REQUEST
239  * 21. 2.2014, H.G.: get from rawclin.h: define MIN_SEQUENTIAL_FILES
240  * 26. 2.2014, H.G.: new IDENT_SPACE_TREE1, IDENT_SPACE_TREE2
241  * 16. 9.2014, H.G.: new STA_FILE_CACHED_OVER
242  * 12.11.2014, H.G.: new MAX_SIZE_CACHE_FILE: max file size in cache
243  * 28.11.2014, H.G.: srawComm.iReservation: document new usage in API
244  * client file loops
245  * 14. 1.2015, H.G.: srawComm.iSynchId: document new usage in API
246  * file delete
247  * 21. 1.2015, H.G.: SEND_FROM_CACHE: doc. enhanced usage for any cache
248  * ********************************************************************
249  */
250 
251 #define PORT_STAGE_MGR 1991 /* default port number StageManager */
252  /* 1992: port number SpaceManager on DM */
253 #define PORT_ARCHIVE_MGR 1993 /* default port number ArchiveManager */
254 #define PORT_MOVER 1994 /* default port number data mover */
255  /* 1995: port number ArchiveServer on DM */
256 #define PORT_MASTER 1996 /* default port number master server */
257  /* 1997: port number distribution server */
258 #define PORT_MOVER_DATAFS 1998 /* port number DM for lustre (root) */
259 
260 #define PORT_RFIO_SERV 1974 /* default port number RFIO server */
261 
262 #define ATLSERVER_ARCHIVE 1 /* API write: 1: IBM 3494, 2: SANLB2 */
263 #define MAX_ATLSERVER 1 /* max no. of ATL servers */
264 #define MAX_POOL_ATLSERVER 10 /* max no. of pools in ATL servers */
265 #define MAX_NUM_POOL 5 /* sum for all ATL servers */
266 #define MAX_NUM_TAPE 8 /* max no. of available tapes in ATL */
267 #define MAX_NUM_DM 20 /* max no. of DMs for RC + GRC or WC + GWC */
268 #define MAX_NUM_DM_NO 20 /* max digits in DM name */
269 #define MBUF_SOCK 32768 /* default buffer size sockets */
270 #define MBUF_ADSM 32768 /* default buffer size ADSM */
271 #define MBUF_RFIO 32768 /* max currently possible in MBS */
272 #define CUR_QUERY_LIMIT 0
273  /* no. of entries in query buffer
274  =0: current no. has default value (MBUF_SOCK - HEAD_LEN)/iObjAttr
275  >0 in any case limited by default value */
276 
277 #define SLEEP_CACHE_FULL 600 /* wait time/iter, if write cache full */
278 #define MAXLOOP_CACHE_FULL 3 /* max no of iter, if write cache full */
279 
280 #define DEF_FILESIZE 2044000000 /* assume <2GByte, if unavailable */
281 #define MAX_FILE_SIZE 2147483647
282  /* max filesize 2GByte-1 (byte, 32 bit signed) */
283 #define MAX_FILE_SIZE_U 4294967295
284  /* max filesize 4GByte-1 (byte, 32 bit unsigned) */
285 #define MAX_SIZE_CACHE_FILE 4096000 /* max size cache file (MByte) */
286 
287 #define MAX_FILE_NO 1024 /* max number of file names in list */
288 
289 #define MIN_SEQUENTIAL_FILES 20
290  /* lower file limit for sequential staging */
291 
292 static const char cTooBig[8] = "(>=4GB)";
293  /* for 32 bit clients: substitute for filesize >= 4GB */
294 
295 #define MAX_NODE 16 /* max length node name */
296 static char cNodeMaster0[MAX_NODE] = "lxgstore"; /* entry server */
297 static char cNodeMasterE1[MAX_NODE] = "lxha05"; /* def entry server */
298 static char cNodeMasterE2[MAX_NODE] = "lxha04"; /* bkp entry server */
299 static char cNodeStageMgr[MAX_NODE] = "lxgstore";
300 static char cNodeArchiveMgr[MAX_NODE] = "lxgstore";
301 
302 #define MIN_DATAFS_PATH 12 /* min path length in lustre */
303 static char cDataFSType[16] = "lustre"; /* general name */
304 static char cDataFSHigh1[16] = "/hera/"; /* InfiniBand lustre */
305 static char cDataFSHigh2[16] = "/lustre/"; /* Ethernet lustre */
306 
307 #define MAX_OWNER 16 /* max length object owner */
308 static char cAdminUser[MAX_OWNER] = "goeri"; /* special user */
309 static char cForceMigPath[32] = "/ArchiveNow"; /* special path name */
310 
311 /* query client operating system */
312 #define MAX_OS 8 /* max length operating system name */
313 static char *pcOS;
314 #ifdef _AIX
315 static char cOS[MAX_OS] = "AIX ";
316 #endif
317 #ifdef Linux
318 static char cOS[MAX_OS] = "Linux ";
319 #endif
320 #ifdef Lynx
321 static char cOS[MAX_OS] = "Lynx ";
322 #endif
323 #ifdef VMS
324 static char cOS[MAX_OS] = "VMS ";
325 #endif
326 
327 #define MAX_FULL_FILE 256 /* max length full file name */
328 #define MAX_FILE 128 /* max length rel. file name */
329 #define MAX_TAPE_FILE 17 /* max length file name on tape */
330 
331 #define VERSION_SRAWOBJATTR 5 /* cur version of struct srawObjAttr */
332 #define SIZE_CACHE_METADATA_5 424 /* cur size of cacheDB entry */
333 #define SIZE_CACHE_METADATA_4 344 /* old size of cacheDB entry */
334 
335 #define MAX_OBJ_FS 32
336  /* max len filespace name, in code limited to 26 due to MC */
337 #define MAX_OBJ_HL 112 /* max length object high level name */
338 #define MAX_OBJ_LL 52 /* max length object low level name */
339 #define MAX_OBJ_HL_O 92 /* max length object high level name */
340 #define MAX_OBJ_LL_O 36 /* max length object low level name */
341 #define MAX_OBJ_HL_LEVEL 14
342  /* max no. gStore directory levels, if MAX_OBJ_xx fully utilized */
343 
344 #define MAX_MC 30
345  /* length ManagementClass name:
346  limited by TSM (V5.5) to DSM_MAX_MC_NAME_LENGTH = 30
347  -> length filespace name (26) + length('TAPE') */
348 #define MAX_MC_O 12 /* max length Management class name */
349 
350 #define MAX_DATE 20 /* max length archive date and time */
351 #define MAX_APPLTYPE 28 /* max length application type */
352 #define MAX_ITEM 32 /* max length of process item */
353 
354 #define HEAD_OFFSET 3 /* offset common pre-header (ints) */
355 #define HEAD_LEN 12 /* length common pre-header (bytes) */
356 #define STATUS_LEN 512 /* max length status/error message */
357 #define STATUS_LEN_LONG 4096 /* max length long status/error msg */
358 
359 /* identifiers for buffer headers transfered via sockets */
360 /* at least IDENT_STATUS must be <0 to avoid confusion with data */
361 #define IDENT_COMM -1 /* communication control buffer */
362 #define IDENT_STATUS -2 /* status buffer from/to client */
363 #define IDENT_QUERY -3 /* query result buffer */
364 #define IDENT_POOL -4 /* stage pool info buffer */
365 #define IDENT_WORKSPACE -5 /* work space info buffer */
366 #define IDENT_NEXT_BUFFER -6 /* request next data buffer */
367 #define IDENT_MOVER_ATTR -7 /* data mover attributes */
368 #define IDENT_STAGE_FILE -8 /* stage file data (read cache) */
369 #define IDENT_SPACE_INFO -9 /* data mover space info */
370 #define IDENT_PURGE_INFO -10 /* purge request for data mover */
371 #define IDENT_SPACE_LOOK -11 /* meta data DB space info */
372 #define IDENT_CLEAN_REQUEST -12 /* clean request for stage pool */
373 #define IDENT_FILELIST_REQUEST -13 /* filelist request for stage FS */
374 #define IDENT_QUERY_ARCHDB -14 /* query result buffer archDB */
375 #define IDENT_FULL_ARCHDISK -15 /* buffer describing full disk */
376 #define IDENT_ARCHIVE_FILE -16 /* archive file data (write cache) */
377 #define IDENT_STAGE_LIST -17 /* list of read cache object data */
378 #define IDENT_QUERY_FILEDB -18 /* query result buffer fileDB */
379 #define IDENT_QUERY_DONE -19 /* last query result buffer */
380 #define IDENT_CACHE_STATUS -20 /* request query/set cache status */
381 #define IDENT_COPY_CACHE -21 /* copy DAQ stream data from cache */
382 #define IDENT_ARCHIVE_LIST -22 /* list of archive names */
383 #define IDENT_PROC_INFO -23 /* get/update proc no. in cacheDB */
384 #define IDENT_STAGE_PARALLEL -24 /* DMs and filelists for par stage */
385 #define IDENT_GLOBAL_SOCKET -25 /* global socket data for CacheMgr */
386 #define IDENT_CACHEFS_ACTION -26 /* action request for cache FS */
387 #define IDENT_STAGE_SEQUENTIAL -27 /* DMs + filelists for sequ stage */
388 #define IDENT_MIGR_LIMIT -28 /* info/action for migr limit WC pool */
389 #define IDENT_TAPE_STATUS_DM -29 /* pool DM tape connect status */
390 #define IDENT_RETRIEVE_PARALLEL -30 /* DMs and filelists par retr */
391 #define IDENT_FILESIZE_REQUEST -31 /* request object filesize on DM */
392 #define IDENT_SPACE_TREE1 -32 /* metadataDB space info + 1 fill tree */
393 #define IDENT_SPACE_TREE2 -33 /* metadataDB space info + 2 fill trees*/
394 
395 enum ARCH_DEVICE /* logical archive device */
396 {
397  ARCH_ANY, /* 0: any device (for query) */
398  ARCH_TAPE, /* 1: standard tape class */
399  ARCH_TAPE_MC, /* 2: user specific tape class for archive */
400  MGR_TAPE, /* 3: tape for system manager: special MC */
401  ARCH_DISK, /* 4: disk in ArchivePool */
402  ARCH_DAQ_DISK /* 5: disk in DaqPool (RFIO only) */
403 };
404 
405 enum RETR_DEVICE /* logical staging device */
406 {
407  RETR_CLIENT, /* 0: no staging */
408  RETR_STAGE_TEMP, /* 1: no expiration date (retrieve) */
409  RETR_STAGE_PERM, /* 2: with expiration date (stage) */
410  RETR_FILESYSTEM /* 3: retrieve to central file system */
411 };
412 
413 enum FILETYPE /* describes data */
414 {
415  FIXED_INTS4, /* 0: fixed records, 4 byte int (signed) */
416  STREAM /* 1: record length not defined */
417 };
418 
419 enum ACTION /* action */
420 {
421  ARCHIVE, /* 0: archive files to TSM */
422  ARCHIVE_MGR, /* 1: archive sysmgr: set owner, special MC */
423  ARCHIVE_RECORD, /* 2: archive file from client program to WC */
424  ARCHIVE_OVER, /* 3: archive file with overwrite (client only)
425  on server: REMOVE + ARCHIVE_TO_CACHE */
426  CREATE_ARCHIVE, /* 4: sysmgr only: create new archive */
427  CLOSE, /* 5: close tape (client) */
428  REMOVE, /* 6: delete file from mass storage */
429  REMOVE_MGR, /* 7: delete file from mass storage (sysmgr) */
430  FILE_CHECK, /* 8: only needed for client side */
431  OPEN, /* 9: open tape (client) */
432  QUERY, /* 10: query for files in mass storage */
433  QUERY_ARCHIVE, /* 11: query files before ARCHIVE */
434  QUERY_ARCHIVE_MGR, /* 12: query files before ARCHIVE (sysmgr) */
435  QUERY_REMOVE, /* 13: query for files to be deleted */
436  QUERY_REMOVE_MGR, /* 14: query for files to be deleted (sysmgr) */
437  RETRIEVE, /* 15: retrieve file to client */
438  RETRIEVE_RECORD, /* 16: retrieve file via client api (via RC) */
439  RETRIEVE_STAGE, /* 17: retrieve file to client via read cache */
440  STAGE, /* 18: stage file to read cache */
441  QUERY_UNSTAGE, /* 19: query for files to be unstaged */
442  UNSTAGE, /* 20: remove file from read cache */
443  QUERY_POOL, /* 21: query for status of disk pools */
444  QUERY_WORKSPACE, /* 22: query files to be staged, get RC status*/
445  QUERY_STAGE, /* 23: query for files to be staged */
446  ARCHIVE_TO_CACHE, /* 24: arch. files from client to write cache */
447  ARCHIVE_FROM_CACHE, /* 25: archive files from write cache to TSM */
448  QUERY_RETRIEVE, /* 26: query for files to be retrieved */
449  QUERY_ARCHIVE_OVER, /* 27: query for files before ARCHIVE_OVER */
450  QUERY_ARCHIVE_TO_CACHE, /* 28: query before ARCHIVE_TO_CACHE */
451  SPM_REQUEST_MOVER, /* 29: request data mover for action */
452  QUERY_RETRIEVE_RECORD, /* 30: query before RETRIEVE_RECORD */
453  QUERY_ARCHIVE_FROM_CACHE, /* 31: query before ARCHIVE_FROM_CACHE */
454  END_SESSION, /* 32: end session on server */
455  QUERY_ARCHIVE_RECORD, /* 33: query before ARCHIVE_RECORD */
456  STAGE_FROM_CACHE, /* 34: copy files from WC to RC */
457  RETRIEVE_FROM_CACHE, /* 35: retrieve files from WC */
458  SEND_FROM_CACHE, /* 36: read in any cache, send to DM */
459  QUERY_RETRIEVE_STAGE, /* 37: query before RETRIEVE_STAGE */
460  COPY_RC_TO_FILESYSTEM, /* 38: copy from read cache to mounted FS */
461  RETRIEVE_TO_FILESYSTEM, /* 39: retrieve from TSM to mounted FS */
462  ARCHIVE_FROM_FILESYSTEM,/* 40: archive: mounted FS to write cache */
463  COPY_WC_TO_FILESYSTEM, /* 41: online copy from WC to mounted FS */
464  MIGRATE_CACHE_PATH, /* 42: migrate complete write cache path
465  (force migration) */
466  QUERY_FILESERVER, /* 43: query files in specified 2nd level DM */
467  SEND_TO_FILESERVER, /* 44: read from RC, send to FileServer */
468  RECEIVE_FROM_DM, /* 45: on FileServer: recv from DM, write to FS */
469  SHOW_ARCHIVES, /* 46 show list of matching archives */
470  STAGE_PARALLEL, /* 47 stage with several DMs in parallel or sequ. */
471  SET_GLOBAL_SOCKET, /* 48 create global socket buffer in CacheMgr
472  also lock action */
473  UNSET_GLOBAL_SOCKET,/*49 mark global socket in CacheMgr as invalid
474  also lock action */
475  SEND_GLOBAL_NOTICE,/*50 send notice for global socket in CacheMgr
476  also lock action */
477  SEND_FROM_TAPE, /* 51 read data from tape, send to DM */
478  RETRIEVE_PARALLEL /*52 retr to lustre with several DMs in parallel*/
479 };
480 
481 typedef struct /* info for file list */
482 {
483  char cFile[MAX_FULL_FILE]; /* fully qualified file name */
484 } srawFileList;
485 
486 /* command buffer with object attributes */
487 typedef struct
488 {
489  int iIdent; /* IDENT_COMM identifies command buffer */
490  int iAction; /* see definition of ACTION */
491  int iCommLen; /* length of following data */
492  char cNamefs[MAX_OBJ_FS]; /* filespace name */
493  char cNamehl[MAX_OBJ_HL]; /* object high level name */
494  char cNamell[MAX_OBJ_LL]; /* file name / object low level name */
495  char cOwner[MAX_OWNER]; /* account name of requestor */
496  char cOS[MAX_OS]; /* user operating system */
497  char cApplType[MAX_APPLTYPE]; /* application type */
498  int iFileType; /* see definition of FILETYPE */
499  int iBufsizeFile; /* buffer size file */
500  unsigned int iFileSize; /* file size (byte), overlaid with 'long' */
501  unsigned int iFileSize2; /* both together 8 byte */
502  int iArchDev; /* = ARCH_DEVICE or RETR_DEVICE */
503  unsigned int iObjHigh; /* upper four bytes object Id */
504  unsigned int iObjLow; /* lower four bytes object Id */
505  char cliNode[MAX_NODE]; /* client node name */
506  int iExecStatus; /* execution status set by LockManager:
507  =1: active, =2 waiting, =3 suppressed (--> not yet impl) */
508  int iWaitTime; /* time to wait before execution (seconds) */
509  int iSynchId;
510  /* = 1: RFIO write in file loop (1st: select DM)
511  = 2: RFIO read in file loop (1st: select DM)
512  = 3: RFIO file delete
513  =11: requested action recursive (cmd client only)
514  =21: (else) check access rights also for admin user
515  +100: as before, but use alternate prod TSM server */
516  char cTapeLib[16]; /* name of ATL: "" default, "*" all */
517  char cNodeCacheMgr[MAX_NODE]; /* name of node with cache mgrs */
519  /* = 1: prod TSM server (aixtsm1),
520  = 2: test TSM server (aixtsm2),
521  < 0: gStore test system */
522  int iPoolIdRC; /* read cache PoolId (= 0: not in RC) */
523  char cNodeRC[MAX_NODE]; /* read cache DM name (= "": not in RC) */
524  int iStageFSid; /* stage FS no. on read cache DM (= 0: not in RC) */
525  int iPoolIdWC; /* write cache PoolId (= 0: not in WC) */
526  char cNodeWC[MAX_NODE]; /* write cache DM name (= "": not in WC) */
527  int iFSidWC; /* FS no. on write cache DM (= 0: not in WC) */
528  char cNodeFC[MAX_NODE]; /* file server cache node ("": not in FC) */
529  int iFSidFC; /* FS no. on file server cache node (= 0: not in FC) */
530  int iDataFS; /* >0: handle files on central data FS
531  >1: base hl dir level, append further subdirs to
532  data FS dir (retrieve) */
533  char cDataFS[MAX_FULL_FILE]; /* full path in central data FS */
534  int iClient32; /* =1: 32 bit gstore/RFIO client */
536  /* <0: request filesize check comparing cacheDB - DM FS
537  >0: in API client file loops: no. of open connection,
538  appended to node name (lxgstore)
539  i>1000 => server test system, used i-1000
540  in servers: cur obj belongs to workspace with specified
541  space reservation number (--> not yet impl) */
542  int iGlobalActionId; /* global actionId for parallel/sequ actions */
543 } srawComm;
544 
545 enum STATUS /* status of action */
546 {
547  STA_BEGIN_TRANS, /* 0: server ready for data transfer */
548  STA_NEXT_BUFFER, /* 1: API client: request next sequ. buffer */
549  STA_END_OF_FILE, /* 2: okay, handle next file */
550  STA_END_OF_SESSION, /* 3: okay, end session */
551  STA_ERROR, /* 4: error, end session */
552  STA_ERROR_EOF, /* 5: error, handle next file */
553  STA_FILE_STAGED, /* 6: file staged (RC) or written to data FS */
554  STA_END_OF_FILE_NOT_STAGED, /* 7: file retrieved, but not staged */
555  STA_SEEK_BUFFER, /* 8: API client: seek new buffer */
556  STA_ARCHIVE_AVAIL, /* 9: archive already available on server */
557  STA_SWITCH_SERVER, /* 10: switch data mover */
558  STA_INFO, /* 11: informatory message */
559  STA_PURGED, /* 12: some/all requested files purged on DM */
560  STA_NOT_PURGED, /* 13: no file could be purged on DM */
561  STA_CACHE_FULL, /* 14: write cache currently full */
563  /* 15: file no longer in write cache, probably archived */
564  STA_ARCHIVE_NOT_AVAIL, /* 16: archive not available on server */
565  STA_NO_ACCESS, /* 17: requested access to archive not allowed */
566  STA_SWITCH_ENTRY, /* 18: switch entry server */
567  STA_ENTRY_INFO, /* 19: info: name of entry server */
568  STA_FILE_CACHED, /* 20: file archived from central data FS to WC */
569  STA_CACHE_COPY, /* 21: successfull copy from WC to central dataFS */
571  /* 22: error status for copy from WC to central data FS */
572  STA_FILE_AVAIL, /* 23: file already available in (G)RC or data FS */
574  /* 24: file in WC overwritten from central data FS */
575 };
576 
577 typedef struct /* Status buffer */
578 {
579  int iIdent; /* IDENT_STATUS identifies status buffer */
580  int iStatus; /* see definition of STATUS */
581  int iStatusLen; /* length of following message */
582  char cStatus[STATUS_LEN]; /* status message */
583 } srawStatus;
584 
585 typedef struct /* Request buffer for API client */
586 {
587  int iIdent; /* IDENT_NEXT_BUFFER identifies request buffer */
588  int iStatus; /* see definition of STATUS */
589  int iStatusLen; /* length of following info */
590  int iSeekMode; /* byte offset mode (see lseek C function):
591  SEEK_SET: set offset to iOffset bytes
592  SEEK_CUR: increase current offset for iOffset bytes
593  SEEK_END: set offset to file size plus iOffset bytes */
594  int iOffset; /* requested byte offset */
595  int iBufferSize; /* length of requested buffer */
596 } srawRequest;
597 
598 typedef struct /* object attribute buffer version 4 */
599 {
600  int iVersion; /* structure version: 4, 304 byte */
601  char cNamefs[MAX_OBJ_FS]; /* filespace name */
602  char cNamehl[MAX_OBJ_HL_O]; /* object high level name */
603  char cNamell[MAX_OBJ_LL_O]; /* file name / object low level name */
604  int iFileType; /* see definition of FILETYPE */
605  int iBufsizeFile; /* buffer size file */
606  unsigned int iFileSize; /* file size in bytes, old: 4 byte okay */
607  char cDate[MAX_DATE]; /* archive date and time */
608  char cOwner[MAX_OWNER]; /* account name of owner */
609  char cOS[MAX_OS]; /* operating system archiving client */
610  char cMgmtClass[MAX_MC_O]; /* management class */
611  int iMediaClass; /* media class */
612  unsigned int iObjHigh; /* upper four bytes object Id */
613  unsigned int iObjLow; /* lower four bytes object Id */
614  unsigned int iRestoHigh; /* top four bytes restore order */
615  unsigned int iRestoLow; /* lo_lo four bytes restore order */
616  int iFS; /* filesystem number if file on disk */
617  char cNode[MAX_NODE]; /* node name data mover */
618  char cStageUser[MAX_OWNER]; /* account name of staging user */
620  /* = 1: prod TSM server (aixtsm1),
621  = 2: test TSM server (aixtsm2),
622  < 0: gStore test system */
623  unsigned int iRestoHighHigh;/* hi_hi four bytes restore order */
624  unsigned int iRestoHighLow; /* hi_lo four bytes restore order */
625  unsigned int iRestoLowHigh; /* lo_hi four bytes restore order */
627 
628 typedef struct /* query info of gStore object version 5 from server,
629  part of cacheDB buffer relevant for client */
630 {
631  int iVersion; /* structure version: VERSION_SRAWOBJATTR */
632  int iSize; /* size of this structure (version 5: 384 byte) */
633  char cNamefs[MAX_OBJ_FS]; /* filespace name */
634  char cNamehl[MAX_OBJ_HL]; /* object high level name */
635  char cNamell[MAX_OBJ_LL]; /* file name / object low level name */
636  int iFileType; /* see definition of FILETYPE */
637  int iBufsizeFile; /* buffer size */
638  unsigned int iFileSize; /* file size (byte), overlaid with 'long' */
639  unsigned int iFileSize2; /* both together 8 byte */
640  char cDateCreate[MAX_DATE]; /* creation date/time in gStore */
641  char cOwner[MAX_OWNER]; /* account name of owner */
642  char cOS[MAX_OS]; /* operating system archiving client */
643  char cMgmtClass[MAX_MC+2]; /* TSM management class, padded 8 byte */
644  int iMediaClass; /* media class */
645  unsigned int iObjHigh; /* upper four bytes object Id */
646  unsigned int iObjLow; /* lower four bytes object Id */
647  unsigned int iRestoHigh; /* top four bytes restore order */
648  unsigned int iRestoHighHigh; /* hi_hi four bytes restore order */
649  unsigned int iRestoHighLow; /* hi_lo four bytes restore order */
650  unsigned int iRestoLowHigh; /* lo_hi four bytes restore order */
651  unsigned int iRestoLow; /* lo_lo four bytes restore order */
653  /* = 1: prod TSM server (aixtsm1),
654  = 2: test TSM server (aixtsm2),
655  < 0: gStore test system */
656  int iPoolId;
657  /* disk pool identifier:
658  1: RetrievePool ATLServer1 (created by retrieve)
659  2: StagePool ATLServer1 (created by stage)
660  3: ArchivePool ATLServer1 (write cache)
661  4: DAQPool ATLServer1 (write cache)
662  11: RetrievePool ATLServer2 (created by retrieve)
663  12: StagePool ATLServer2 (created by stage)
664  13: ArchivePool ATLServer2 (write cache)
665  14: DAQPool ATLServer2 (write cache)
666  */
667  char cNode[MAX_NODE]; /* node name data mover */
668  int iDM; /* cache data mover number, =0: not in cache */
669  int iFS; /* cache filesystem number, =0: not in cache */
670  int iFileSet; /* Id of file set (--> not used) */
671  int iObjInfo;
672  /* result of filesize check comparing cacheDB - DM FS:
673  = 1: okay, = 2: diff file sizes */
674  char cStageUser[MAX_OWNER]; /* account name of staging user */
675 } srawObjAttr;
676 
677 typedef struct /* Query response buffer */
678 {
679  int iIdent; /* IDENT_QUERY, IDENT_QUERY_ARCHDB, IDENT_QUERY_DONE */
680  int iObjCount; /* no. of objects matching */
681  int iAttrLen; /* length attributes buffer of object */
682  srawObjAttr objAttr; /* attributes of object found */
683  /* appended for each object */
685 
686 /* stage pool attributes for one data mover */
687 typedef struct
688 {
689  char cNodeName[MAX_NODE]; /* node name data mover */
690  int iMaxSizeMover; /* max size of pool on this data mover (MByte) */
691  int iFreeSizeHW; /* current free size in hardware (MByte) */
692  int iFreeSize; /* current free size in pool (MByte) */
693  int iFiles; /* current no. of files in pool */
694  int iFileSystems; /* no. of FS on this data mover:
695  = 0: all FS, > 0: list follows (srawStageFS) */
697 
698 /* stage pool attributes */
699 typedef struct
700 {
701  char cPoolName[32]; /* pool name */
702  char cPoolOS[MAX_OS]; /* name of OS where pool resides */
703  int iPoolId; /* pool identification number */
704  int iMaxSizeHW; /* overall size of HW (MByte) */
705  int iFreeSizeHW; /* current free size in HW (MByte) */
706  int iMaxSize; /* overall size of pool (MByte) */
707  int iFreeSize; /* current free size in pool (MByte) */
708  int iMaxWorkSize; /* max size of work space in pool (MByte) */
709  int iFileAvail; /* guaranteed availability of files (days) */
711  /* threshold work space size for check of pool status (MByte) */
712  int iFiles; /* current no. of files in pool */
713  int iDataMover; /* number of data movers in pool */
715 
716 /* for exchange with client: status buffers stage pool + WS */
717 typedef struct
718 {
719  int iIdent; /* IDENT_POOL identifies pool status header */
720  int iPoolNo; /* no. of pool + WS buffers following */
721  int iStatusLen; /* size of following data (n pools, opt. 1 WS) */
722  srawPoolStatusData sPoolStatusData; /* stage pool attributes */
724 
725 typedef struct /* server infos on requ. work space */
726 {
727  int iIdent;/* IDENT_WORKSPACE identifies work space status header */
728  int iWorkId; /* work space identification number */
729  int iStatusLen; /* length of following data */
730  int iWorkSizeAll; /* size of requ. work space (MByte) */
731  int iWorkFilesAll; /* total no. of files in work space */
732  int iWorkSizeSta; /* part of requ. work space already staged */
733  int iWorkFilesSta; /* no. of files in work space already staged */
734  int iWorkSizeStaTemp; /* part of staged work space in temp pool */
735  int iWorkFilesStaTemp; /* no. of staged files in temp pool */
736  int iWorkSizeEst; /* part of requ. work space size estimated */
738  /* no. of files in work space with size estimated */
739  int iStatus; /* work space status flag:
740  = -1: problem, can't create
741  = 0: okay, space available
742  = 1: lack of space in pool
743  = 2: above allowed limit of work space
744  = 3: work space larger than pool
745  = 9: lack of space -> clean job, no sleep
746  >= 10: lack of space -> clean job, sleep iStatus min.
747  */
748 } srawWorkSpace;
749 
750 typedef struct /* attributes of data mover */
751 {
752  char cNode[MAX_NODE]; /* node name */
753  int iPort; /* port no. */
754  int iSocket; /* socket no. */
755  int iExecStatus; /* execution status set by LockManager (unused):
756  = 1: active, = 2 waiting, = 3 suppressed */
757  int iWaitTime; /* time to wait before execution (seconds) */
758  int iATLServer; /* number of ATL Server */
759  /* = 1: prod TSM server (aixtsm1),
760  = 2: test TSM server (aixtsm2),
761  < 0: gStore test system */
762  int iPoolId;
763  /* =1: RetrievePool, =2 StagePool,
764  =3: ArchivePool, =4: DaqPool, =5: GlobalPool */
766 
767 typedef struct /* communication buffer with data mover attributes */
768 {
769  int iIdent; /* IDENT_STATUS identifies status buffer */
770  int iStatus; /* see definition of STATUS */
771  int iStatusLen; /* length of following message */
772  srawDataMoverAttr sDataMoverAttr; /* attributes of data mover */
773 } srawDataMover;
774 
775 typedef struct /* filesystem infos */
776 {
777  char cOS[MAX_OS]; /* operating system */
778  char cNode[MAX_NODE]; /* datamover name */
779  int iFileSystem; /* no. of filesystem on node */
780  int iPoolId; /* read or write cache poolId */
781  char cArchiveDate[MAX_DATE]; /* creation date in ArchivePool */
782  char cArchiveUser[MAX_OWNER]; /* account name of archiving user */
784 
785 typedef struct /* for copy of DAQ data stream to dataFS */
786 {
787  int iIdent; /* IDENT_COPY_CACHE */
789  /* = 0: ignore this buffer
790  = 1: copy to pcCopyPath AFTER file written to WC
791  (for high data rates, don't interfere writing to cache)
792  = 2: for dataFS only:
793  write each data buffer to WC and pcCopyPath
794  (for low data rates, anyhow first buffers quickly
795  available in lustre)
796  */
797  int iCopyLen; /* length following data (byte) */
798  char cCopyPath[MAX_FULL_FILE];
799  /* destination where to be copied
800  = "/lustre..." => fully qualified path name in lustre
801  = "/hera..." => fully qualified path name in lustre
802  if not existing: will be created (see iPathConvention)
803  = "RC" => read cache
804  */
806  /* = i>0: copy each ith file to pcCopyPath
807  if tape migration fails: ignore iCopyFraction, copy
808  each file
809  */
810  int iMaxFile;
811  /* for dataFS only:
812  = 0: no file limit
813  > 0: max no. of files to be written to directory
814  files already existing are ignored
815  if iMaxFile reached, new directory will be created
816  (same level as previous directory)
817  */
819  /* rules for creation of initial/new path
820  = 0: default convention
821  initially specified .../xxx => .../xxx
822  last .../xxx => create ...xxx1
823  last .../xxxi => create ...xxxj j=i+1
824  = 1: Hades convention: path name contains time stamp
825  initially specified .../xxx => .../xxxyydddhhmm
826  new => .../xxxyydddhhmm
827  */
828 } srawCopyCache;
829 
830 typedef struct /* list of archives */
831 {
832  int iIdent; /* IDENT_ARCHIVE_LIST */
833  int iArchCount; /* no. of archives names following */
834  int iArchSize; /* length of following data (byte) */
835  char cArchive[MAX_OBJ_FS]; /* archive name */
837 
838 typedef struct /* list of full obj names and filesizes in archive */
839 {
840  int iCacheLocation; /* 0: tape, 1: RC, 2: WC, 3: GRC, 4: GWC */
842  int iPoolIdWC; /* maybe >0 also for staged files (RC, GRC) */
843  unsigned int iFileSize; /* 8 byte filesize */
844  unsigned int iFileSize2;
845  char cPath[MAX_OBJ_HL]; /* path name */
846  char cFile[MAX_OBJ_LL]; /* file name */
848 
849 typedef struct /* global socket data for parallel actions */
850 {
851  int iSocket; /* socket for communication client - entry server */
852  int iActionId; /* global actionId for parallel/sequ actions */
853  char cClientNode[MAX_NODE]; /* client node name */
854  char cClientUser[MAX_OWNER]; /* user name on client node */
855 }
857 
858 typedef struct /* global socket buffer for parallel actions */
859 {
860  int iIdent; /* IDENT_GLOBAL_SOCKET */
861  int iAction; /* [lock] actions with global sockets: 48 - 50 */
862  int iDataLen; /* length of following data in byte */
863  srawGlobalSocketData sGlobalSocketData; /* global socket data */
865 
866 typedef struct /* global notification buffer for parallel actions */
867 {
868  srawGlobalSocket sGlobalSocket; /* global socket buffer */
869  char cDataMover[MAX_NODE]; /* name of DM sending notification */
870  char cNamefs[MAX_OBJ_FS]; /* filespace name */
871  char cNamehl[MAX_OBJ_HL]; /* object high level name */
872  char cNamell[MAX_OBJ_LL]; /* file name / object low level name */
873  char cFile[MAX_FULL_FILE]; /* full lustre file name */
874  unsigned int iuFileSize;/* file size (byte), overlaid with 'long' */
875  unsigned int iuFileSize2; /* both together 8 byte */
876  int iStatus; /* status for cmd client */
877  char cMsg[STATUS_LEN]; /* optionally: error/status msg */
879 
static char cPath[MAX_FULL_FILE]
Definition: rawCliProcn.c:186
static char cNamefs[MAX_OBJ_FS]
Definition: rawProcn.c:183
static char cNamehl[MAX_OBJ_HL]
Definition: rawProcn.c:184
static char cApplType[MAX_APPLTYPE]
Definition: rawapplcli.h:16
static char cNodeArchiveMgr[MAX_NODE]
Definition: rawcommn.h:300
static char * pcOS
Definition: rawcommn.h:313
static char cDataFSHigh2[16]
Definition: rawcommn.h:305
STATUS
Definition: rawcommn.h:546
@ STA_CACHE_FILE_AWAY
Definition: rawcommn.h:562
@ STA_SWITCH_SERVER
Definition: rawcommn.h:557
@ STA_NEXT_BUFFER
Definition: rawcommn.h:548
@ STA_ARCHIVE_NOT_AVAIL
Definition: rawcommn.h:564
@ STA_NOT_PURGED
Definition: rawcommn.h:560
@ STA_ENTRY_INFO
Definition: rawcommn.h:567
@ STA_ARCHIVE_AVAIL
Definition: rawcommn.h:556
@ STA_CACHE_COPY
Definition: rawcommn.h:569
@ STA_SEEK_BUFFER
Definition: rawcommn.h:555
@ STA_ERROR_EOF
Definition: rawcommn.h:552
@ STA_FILE_CACHED
Definition: rawcommn.h:568
@ STA_BEGIN_TRANS
Definition: rawcommn.h:547
@ STA_CACHE_COPY_ERROR
Definition: rawcommn.h:570
@ STA_END_OF_FILE
Definition: rawcommn.h:549
@ STA_SWITCH_ENTRY
Definition: rawcommn.h:566
@ STA_END_OF_FILE_NOT_STAGED
Definition: rawcommn.h:554
@ STA_INFO
Definition: rawcommn.h:558
@ STA_PURGED
Definition: rawcommn.h:559
@ STA_FILE_AVAIL
Definition: rawcommn.h:572
@ STA_FILE_STAGED
Definition: rawcommn.h:553
@ STA_NO_ACCESS
Definition: rawcommn.h:565
@ STA_FILE_CACHED_OVER
Definition: rawcommn.h:573
@ STA_END_OF_SESSION
Definition: rawcommn.h:550
@ STA_CACHE_FULL
Definition: rawcommn.h:561
@ STA_ERROR
Definition: rawcommn.h:551
static char cDataFSType[16]
Definition: rawcommn.h:303
static char cAdminUser[MAX_OWNER]
Definition: rawcommn.h:308
static char cNodeMasterE1[MAX_NODE]
Definition: rawcommn.h:297
#define MAX_NODE
Definition: rawcommn.h:295
RETR_DEVICE
Definition: rawcommn.h:406
@ RETR_FILESYSTEM
Definition: rawcommn.h:410
@ RETR_CLIENT
Definition: rawcommn.h:407
@ RETR_STAGE_TEMP
Definition: rawcommn.h:408
@ RETR_STAGE_PERM
Definition: rawcommn.h:409
static const char cTooBig[8]
Definition: rawcommn.h:292
#define MAX_OBJ_LL_O
Definition: rawcommn.h:340
static char cForceMigPath[32]
Definition: rawcommn.h:309
static char cDataFSHigh1[16]
Definition: rawcommn.h:304
#define MAX_FULL_FILE
Definition: rawcommn.h:327
#define MAX_MC_O
Definition: rawcommn.h:348
static char cNodeMaster0[MAX_NODE]
Definition: rawcommn.h:296
#define MAX_OBJ_HL_O
Definition: rawcommn.h:339
#define MAX_OBJ_LL
Definition: rawcommn.h:338
#define MAX_OBJ_HL
Definition: rawcommn.h:337
#define MAX_DATE
Definition: rawcommn.h:350
static char cNodeMasterE2[MAX_NODE]
Definition: rawcommn.h:298
#define STATUS_LEN
Definition: rawcommn.h:356
ARCH_DEVICE
Definition: rawcommn.h:396
@ MGR_TAPE
Definition: rawcommn.h:400
@ ARCH_ANY
Definition: rawcommn.h:397
@ ARCH_DISK
Definition: rawcommn.h:401
@ ARCH_TAPE_MC
Definition: rawcommn.h:399
@ ARCH_DAQ_DISK
Definition: rawcommn.h:402
@ ARCH_TAPE
Definition: rawcommn.h:398
#define MAX_MC
Definition: rawcommn.h:344
#define MAX_OS
Definition: rawcommn.h:312
#define MAX_OBJ_FS
Definition: rawcommn.h:335
FILETYPE
Definition: rawcommn.h:414
@ STREAM
Definition: rawcommn.h:416
@ FIXED_INTS4
Definition: rawcommn.h:415
ACTION
Definition: rawcommn.h:420
@ ARCHIVE_FROM_FILESYSTEM
Definition: rawcommn.h:462
@ COPY_WC_TO_FILESYSTEM
Definition: rawcommn.h:463
@ SET_GLOBAL_SOCKET
Definition: rawcommn.h:471
@ QUERY_FILESERVER
Definition: rawcommn.h:466
@ STAGE_PARALLEL
Definition: rawcommn.h:470
@ OPEN
Definition: rawcommn.h:431
@ QUERY_RETRIEVE_STAGE
Definition: rawcommn.h:459
@ SHOW_ARCHIVES
Definition: rawcommn.h:469
@ QUERY
Definition: rawcommn.h:432
@ RETRIEVE
Definition: rawcommn.h:437
@ REMOVE_MGR
Definition: rawcommn.h:429
@ QUERY_POOL
Definition: rawcommn.h:443
@ QUERY_REMOVE
Definition: rawcommn.h:435
@ QUERY_UNSTAGE
Definition: rawcommn.h:441
@ QUERY_RETRIEVE_RECORD
Definition: rawcommn.h:452
@ RETRIEVE_STAGE
Definition: rawcommn.h:439
@ QUERY_ARCHIVE_FROM_CACHE
Definition: rawcommn.h:453
@ ARCHIVE_TO_CACHE
Definition: rawcommn.h:446
@ QUERY_REMOVE_MGR
Definition: rawcommn.h:436
@ ARCHIVE
Definition: rawcommn.h:421
@ RETRIEVE_TO_FILESYSTEM
Definition: rawcommn.h:461
@ CLOSE
Definition: rawcommn.h:427
@ RECEIVE_FROM_DM
Definition: rawcommn.h:468
@ RETRIEVE_FROM_CACHE
Definition: rawcommn.h:457
@ END_SESSION
Definition: rawcommn.h:454
@ STAGE_FROM_CACHE
Definition: rawcommn.h:456
@ UNSET_GLOBAL_SOCKET
Definition: rawcommn.h:473
@ ARCHIVE_MGR
Definition: rawcommn.h:422
@ REMOVE
Definition: rawcommn.h:428
@ RETRIEVE_RECORD
Definition: rawcommn.h:438
@ SEND_FROM_TAPE
Definition: rawcommn.h:477
@ SEND_TO_FILESERVER
Definition: rawcommn.h:467
@ QUERY_STAGE
Definition: rawcommn.h:445
@ QUERY_ARCHIVE_OVER
Definition: rawcommn.h:449
@ STAGE
Definition: rawcommn.h:440
@ SEND_FROM_CACHE
Definition: rawcommn.h:458
@ QUERY_ARCHIVE
Definition: rawcommn.h:433
@ QUERY_ARCHIVE_TO_CACHE
Definition: rawcommn.h:450
@ MIGRATE_CACHE_PATH
Definition: rawcommn.h:464
@ ARCHIVE_RECORD
Definition: rawcommn.h:423
@ ARCHIVE_FROM_CACHE
Definition: rawcommn.h:447
@ SPM_REQUEST_MOVER
Definition: rawcommn.h:451
@ ARCHIVE_OVER
Definition: rawcommn.h:424
@ COPY_RC_TO_FILESYSTEM
Definition: rawcommn.h:460
@ QUERY_ARCHIVE_MGR
Definition: rawcommn.h:434
@ UNSTAGE
Definition: rawcommn.h:442
@ QUERY_WORKSPACE
Definition: rawcommn.h:444
@ QUERY_RETRIEVE
Definition: rawcommn.h:448
@ CREATE_ARCHIVE
Definition: rawcommn.h:426
@ SEND_GLOBAL_NOTICE
Definition: rawcommn.h:475
@ FILE_CHECK
Definition: rawcommn.h:430
@ QUERY_ARCHIVE_RECORD
Definition: rawcommn.h:455
@ RETRIEVE_PARALLEL
Definition: rawcommn.h:478
#define MAX_OWNER
Definition: rawcommn.h:307
static char cNodeStageMgr[MAX_NODE]
Definition: rawcommn.h:299
#define MAX_APPLTYPE
Definition: rawcommn.h:351
int iATLServer
Definition: rawcommn.h:518
int iFileType
Definition: rawcommn.h:498
int iFSidWC
Definition: rawcommn.h:527
unsigned int iObjHigh
Definition: rawcommn.h:503
int iArchDev
Definition: rawcommn.h:502
int iPoolIdRC
Definition: rawcommn.h:522
unsigned int iObjLow
Definition: rawcommn.h:504
int iSynchId
Definition: rawcommn.h:509
unsigned int iFileSize
Definition: rawcommn.h:500
int iIdent
Definition: rawcommn.h:489
int iBufsizeFile
Definition: rawcommn.h:499
int iReservation
Definition: rawcommn.h:535
int iDataFS
Definition: rawcommn.h:530
int iStageFSid
Definition: rawcommn.h:524
int iWaitTime
Definition: rawcommn.h:508
int iPoolIdWC
Definition: rawcommn.h:525
unsigned int iFileSize2
Definition: rawcommn.h:501
int iGlobalActionId
Definition: rawcommn.h:542
int iClient32
Definition: rawcommn.h:534
int iFSidFC
Definition: rawcommn.h:529
int iAction
Definition: rawcommn.h:490
int iExecStatus
Definition: rawcommn.h:506
int iCommLen
Definition: rawcommn.h:491
int iCopyFraction
Definition: rawcommn.h:805
int iPathConvention
Definition: rawcommn.h:818
int iStatusLen
Definition: rawcommn.h:771
srawDataMoverAttr sDataMoverAttr
Definition: rawcommn.h:772
unsigned int iuFileSize2
Definition: rawcommn.h:875
srawGlobalSocket sGlobalSocket
Definition: rawcommn.h:868
unsigned int iuFileSize
Definition: rawcommn.h:874
srawGlobalSocketData sGlobalSocketData
Definition: rawcommn.h:863
unsigned int iFileSize
Definition: rawcommn.h:606
unsigned int iRestoHighHigh
Definition: rawcommn.h:623
unsigned int iRestoLow
Definition: rawcommn.h:615
unsigned int iRestoHigh
Definition: rawcommn.h:614
unsigned int iRestoLowHigh
Definition: rawcommn.h:625
unsigned int iObjLow
Definition: rawcommn.h:613
unsigned int iObjHigh
Definition: rawcommn.h:612
unsigned int iRestoHighLow
Definition: rawcommn.h:624
int iBufsizeFile
Definition: rawcommn.h:605
int iFileSet
Definition: rawcommn.h:670
int iBufsizeFile
Definition: rawcommn.h:637
unsigned int iRestoHigh
Definition: rawcommn.h:647
unsigned int iObjHigh
Definition: rawcommn.h:645
int iObjInfo
Definition: rawcommn.h:671
unsigned int iFileSize
Definition: rawcommn.h:638
unsigned int iRestoLowHigh
Definition: rawcommn.h:650
int iATLServer
Definition: rawcommn.h:652
unsigned int iFileSize2
Definition: rawcommn.h:639
int iVersion
Definition: rawcommn.h:631
unsigned int iRestoHighHigh
Definition: rawcommn.h:648
unsigned int iRestoHighLow
Definition: rawcommn.h:649
int iMediaClass
Definition: rawcommn.h:644
int iFileType
Definition: rawcommn.h:636
unsigned int iRestoLow
Definition: rawcommn.h:651
int iPoolId
Definition: rawcommn.h:656
unsigned int iObjLow
Definition: rawcommn.h:646
int iCacheLocation
Definition: rawcommn.h:840
unsigned int iFileSize2
Definition: rawcommn.h:844
unsigned int iFileSize
Definition: rawcommn.h:843
srawPoolStatusData sPoolStatusData
Definition: rawcommn.h:722
srawObjAttr objAttr
Definition: rawcommn.h:682
int iOffset
Definition: rawcommn.h:594
int iStatus
Definition: rawcommn.h:588
int iBufferSize
Definition: rawcommn.h:595
int iIdent
Definition: rawcommn.h:587
int iSeekMode
Definition: rawcommn.h:590
int iStatusLen
Definition: rawcommn.h:589
int iStatus
Definition: rawcommn.h:580
int iStatusLen
Definition: rawcommn.h:581
int iIdent
Definition: rawcommn.h:579
int iStatusLen
Definition: rawcommn.h:729
int iWorkSizeEst
Definition: rawcommn.h:736
int iWorkFilesEst
Definition: rawcommn.h:737
int iWorkFilesStaTemp
Definition: rawcommn.h:735
int iWorkFilesSta
Definition: rawcommn.h:733
int iWorkFilesAll
Definition: rawcommn.h:731
int iWorkSizeStaTemp
Definition: rawcommn.h:734
int iWorkSizeAll
Definition: rawcommn.h:730
int iWorkSizeSta
Definition: rawcommn.h:732