casacore
Loading...
Searching...
No Matches
StorageOption.h
Go to the documentation of this file.
1//# StorageOption.h: Options defining how table files are organized
2//# Copyright (C) 2014
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have receied a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26#ifndef TABLES_STORAGEOPTION_H
27#define TABLES_STORAGEOPTION_H
28
29
30//# Includes
31#include <casacore/casa/aips.h>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Options defining how table files are organized
37// </summary>
38
39// <use visibility=export>
40
41// <reviewed reviewer="TPPR" date="08.11.94" tests="tTable.cc">
42// </reviewed>
43
44// <synopsis>
45// This class can be used to define how the files of a table are organized.
46// There are two ways:
47// <ol>
48// <li> The old way where each storage manager has its own file(s).
49// <li> Using MultiFile that storage managers can use to combine about all
50// table files in a single file. This mode is particularly useful
51// for new file systems (like Lustre) requiring large block sizes.
52// <br>The block size to be used in a MultiFile can be defined in
53// this class. Default is 4 MByte.
54// <li> Using MultiHDF5 which behaves similar to MultiFile but uses an
55// HDF5 file instead of a regular file. Note that it requires that
56// support for HDF5 has been used in the build system.
57// </ol>
58// It is possible to specify the storage type and block size using aipsrc.
59// The aipsrc variables are:
60// <ul>
61// <li> <src>table.storage.option</src>. The (case-insensitive) value can be
62// 'multifile' or 'multihdf5'.
63// Another value means the old way (separate files).
64// <li> <src>table.storage.blocksize</src> gives the default blocksize to be
65// used for the multifile and multihdf5 option.
66// <li> <src>table.storage.odirect</src> can be true or false. It tells if the
67// O_DIRECT option has to be used to let the kernel bypass its filecache
68// for more predictable I/O behaviour. It's only used for MultiFile and
69// only if the OS supports O_DIRECT.
70// </ul>
71// </synopsis>
72
73
75 {
76 public:
77 // Define the possible options how table files are organized.
78 enum Option {
79 // Let storage managers use a combined MultiFile.
81 // Let storage managers use a combined MultiHDF5.
83 // Let storage managers use separate files.
85 // Use default (currently SepFile).
87 // Use as defined in the aipsrc file.
88 Aipsrc
89 };
90
91 // Create an option object.
92 // The parameter values are described in the synopsis.
93 // The blocksize has to be given in bytes.
94 // A size value -2 means reading that size from the aipsrc file.
95 // A size value -1 means use the default of 4*1024*1024.
96 // <br>useODirect<0 means reading the option from the aipsrc file.
97 // It is only set if the OS supports O_DIRECT.
99
100 // Fill the option in case Aipsrc or Default was given.
101 // It is done as explained in the synopsis.
103
104 // Get the option.
106 { return itsOption; }
107
108 // Set the option.
111
112 // Get the block size (in bytes).
114 { return itsBlockSize; }
115
116 // Set the block size (in bytes).
119
120 // Get the O_DIRECT option.
122 { return itsUseODirect; }
123
124 // Set the O_DIRECT option.
125 // It is only set if the OS supports O_DIRECT.
127
128 private:
133 };
134
135} //# NAMESPACE CASACORE - END
136
137#endif
StorageOption(Option option=Aipsrc, Int blockSize=-2, Int useODirect=-3)
Create an option object.
void fillOption()
Fill the option in case Aipsrc or Default was given.
void setOption(Option option)
Set the option.
Bool useODirect() const
Get the O_DIRECT option.
Option
Define the possible options how table files are organized.
@ MultiFile
Let storage managers use a combined MultiFile.
@ SepFile
Let storage managers use separate files.
@ MultiHDF5
Let storage managers use a combined MultiHDF5.
@ Default
Use default (currently SepFile).
uInt blockSize() const
Get the block size (in bytes).
void setBlockSize(Int blockSize)
Set the block size (in bytes).
void setUseODirect(Bool useODirect)
Set the O_DIRECT option.
Option option() const
Get the option.
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40