Constants.hpp 6.77 KB
Newer Older
1
/******************************************************************************
2
 *                      castor/tape/tapebridge/Constants.hpp
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 *
 * This file is part of the Castor project.
 * See http://castor.web.cern.ch/castor
 *
 * Copyright (C) 2003  CERN
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *
 *
 *
 * @author Nicola.Bessone@cern.ch Steven.Murray@cern.ch
 *****************************************************************************/

26
27
#ifndef CASTOR_TAPE_TAPEBRIDGE_CONSTANTS_HPP
#define CASTOR_TAPE_TAPEBRIDGE_CONSTANTS_HPP 1
28
29

#include "h/Castor_limits.h"
30
#include "h/tapebridge_constants.h"
31
32
33
34
35
36
37

#include <stdint.h>
#include <stdlib.h>


namespace castor     {
namespace tape       {
38
namespace tapebridge {
39

40
  /**
41
   * The minumim timeout in seconds between pings to the tapebridge clients.
42
43
44
45
46
47
48
49
50
51
52
   * Please note that the tape gateway is not pinged.
   */
  const int CLIENTPINGTIMEOUT = 5;

  /**
   * The size of an RTCOPY message header.  The header contains 3 32-bit integer
   * fields: magic number, request type and length or status.
   */
  const size_t HDRBUFSIZ = 3 * sizeof(uint32_t);

  /**
53
   * The maximum number of pending transfers between the tapebridge and RTCPD.
54
55
56
57
58
59
60
61
62
63
64
65
66
   * The theoretical maximum number of outstanding pending transfers is equal
   * to the memory allocated to memory buffers of RTCPD divided by the average
   * file size.
   */
  const int MAXPENDINGTRANSFERS = 100000;

  /**
   * The maximum size of an RTCOPY message in bytes including both message
   * header and message body.
   */
  const size_t RTCPMSGBUFSIZE = 4096;

  /**
67
   * The program name of the tapebridge daemon.
68
   */
69
  const char *const TAPEBRIDGEPROGRAMNAME = "tapebridged";
70
71
72
73
74
75
76
77
78
79
80
81
82

  /**
   * The tape record format.
   */
  const char *const RECORDFORMAT = "F";

  /**
   * The timeout in seconds used when sending and receiving RTCPD network
   * messages.
   */
  const int RTCPDNETRWTIMEOUT = 55;

  /**
83
   * The timeout in seconds for which the tapebridge waits for RTCPD to call it
84
85
86
87
88
89
   * back.
   */
  const int RTCPDCALLBACKTIMEOUT = 55;

  /**
   * The minimum timeout in seconds between sending a ping message from the
90
   * tapebridge to RTCPD.
91
92
93
94
95
96
97
98
   */
  const int RTCPDPINGTIMEOUT = 30;

  /**
   * The timeout in seconds used when sending and receiving client network
   * messages, where client refers to either tape gateway, readtp, writetp or
   * dumptp.  A value less than 60 seconds should be used because the default
   * timeout used by rtcpd when sending and receiving messages to and from the
99
   * tapebridge is 60 seconds.  The file CASTOR2/h/rtcp_constants.h contains
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
   * the following line:
   * <code>
   * #define RTCP_NETTIMEOUT (60)
   * </code>
   */
  const int CLIENTNETRWTIMEOUT = 55;

  /**
   * The maximum size of a VMGR message in bytes including both message header
   * and message body.
   */
  const size_t VMGRMSGBUFSIZE = 4096;

  /**
   * The timeout in seconds used when sending and receiving VMGR network
   * messages.  A value less than 60 seconds should be used because the default
   * timeout used by rtcpd when sending and receiving messages to and from the
117
   * tapebridge is 60 seconds.  The file CASTOR2/h/rtcp_constants.h contains
118
119
120
121
122
123
124
125
126
127
128
129
   * the following line:
   * <code>
   * #define RTCP_NETTIMEOUT (60)
   * </code>
   */
  const int VMGRNETRWTIMEOUT = 55;

  /**
   * An empty volume serial number.
   */
  const char EMPTYVSN[CA_MAXVSNLEN+1] = "";

130
131
  /**
   * The compile-time default value of the tapebridged configuration parameter
132
   * named TAPEBRIDGE/TAPEFLUSHMODE.
133
   *
134
135
   * The value of this parameter defines the mode of flush behaviour used when
   * writing data to tape.
136
   */
137
  const uint32_t TAPEBRIDGE_TAPEFLUSHMODE = TAPEBRIDGE_N_FLUSHES_PER_FILE;
138

139
  /**
140
141
142
143
144
145
146
147
148
149
150
   * The compile-time default value of the tapebridged configuration parameter
   * named TAPEBRIDGE/MAXBYTESBEFOREFLUSH.
   *
   * The value of this parameter defines the maximum number of bytes to be
   * written to tape before a flush to tape (synchronised tape-mark).  Please
   * note that a flush occurs on a file boundary therefore more bytes will
   * normally be written to tape before the actual flush occurs.
   *
   * The value of this parameter is used when buffered tape-marks are being
   * used over multiple files as defined by the parameter named
   * TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
151
   */
152
  const uint64_t TAPEBRIDGE_MAXBYTESBEFOREFLUSH = 8589934592ULL; // 8 GiB
153
154

  /**
155
156
157
158
159
160
161
162
163
164
   * The compile-time default value of the tapebridged configuration parameter
   * named TAPEBRIDGE/MAXFILESBEFOREFLUSH.
   *
   * The value of this parameter defines the maximum number of files to be
   * written to tape before a flush to tape (synchronised tape-mark).
   *
   * The value of this parameter is used when buffered tape-marks are being
   * used over multiple files as defined by the parameter named
   * TAPEBRIDGE/USEBUFFEREDTAPEMARKSOVERMULTIPLEFILES.
   */
165
  const uint64_t TAPEBRIDGE_MAXFILESBEFOREFLUSH = 1;
166

167
168
169
170
171
172
  /**
   * When the tapegatewayd daemon is asked for a set of files to migrate to
   * tape, this is the compile-time default for the maximum number of bytes
   * the resulting set can represent.  This number may be exceeded when the set
   * contains a single file.
   */
173
  const uint64_t TAPEBRIDGE_BULKREQUESTMIGRATIONMAXBYTES = 1;
174
175
176
177
178
179

  /**
   * When the tapegatewayd daemon is asked for a set of files to migrate to
   * tape, this is the compile-time default for the maximum number of files
   * that can be in that set.
   */
180
  const uint64_t TAPEBRIDGE_BULKREQUESTMIGRATIONMAXFILES = 1;
181
182
183
184
185
186
187

  /**
   * When the tapegatewayd daemon is asked for a set of files to recall from
   * tape, this is the compile-time default for the maximum number of bytes
   * the resulting set can represent.  This number may be exceeded when the set
   * contains a single file.
   */
188
  const uint64_t TAPEBRIDGE_BULKREQUESTRECALLMAXBYTES = 1;
189
190
191
192
193
194

  /**
   * When the tapegatewayd daemon is asked for a set of files to recall from
   * tape, this is the compile-time default for the maximum number of files
   * that can be in that set.
   */
195
  const uint64_t TAPEBRIDGE_BULKREQUESTRECALLMAXFILES = 1;
196

197
} // namespace tapebridge
198
199
200
201
} // namespace tape
} // namespace castor


202
#endif // CASTOR_TAPE_TAPEBRIDGE_CONSTANTS_HPP