Loading...
Searching...
No Matches
casacore::StorageOption Class Reference
tables package (libcasa_tables) » Tables_module

More...

`#include <StorageOption.h>`

## Public Types

enum | Option { MultiFile , MultiHDF5 , SepFile , Default , Aipsrc }
| Define the possible options how table files are organized. More...

## Public Member Functions

| 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.
Option | option () const
| Get the option.
void | setOption (Option option)
| Set the option.
uInt | blockSize () const
| Get the block size (in bytes).
void | setBlockSize (Int blockSize)
| Set the block size (in bytes).
Bool | useODirect () const
| Get the O_DIRECT option.
void | setUseODirect (Bool useODirect)
| Set the O_DIRECT option.

## Private Attributes

Option | itsOption
Int | itsBlockSize
Bool | itsUseODirect
Bool | itsUseAipsrcODirect

## Detailed Description

Options defining how table files are organized

### Intended use:

Public interface

### Review Status

Reviewed By:
  TPPR
Date Reviewed:
  08.11.94
Test programs:
  tTable

### Synopsis

This class can be used to define how the files of a table are organized. There are two ways:

1. The old way where each storage manager has its own file(s).
2. Using MultiFile that storage managers can use to combine about all table files in a single file. This mode is particularly useful for new file systems (like Lustre) requiring large block sizes.
   The block size to be used in a MultiFile can be defined in this class. Default is 4 MByte.
3. Using MultiHDF5 which behaves similar to MultiFile but uses an HDF5 file instead of a regular file. Note that it requires that support for HDF5 has been used in the build system.

It is possible to specify the storage type and block size using aipsrc. The aipsrc variables are:

- table.storage.option. The (case-insensitive) value can be 'multifile' or 'multihdf5'. Another value means the old way (separate files).
- table.storage.blocksize gives the default blocksize to be used for the multifile and multihdf5 option.
- table.storage.odirect can be true or false. It tells if the O_DIRECT option has to be used to let the kernel bypass its filecache for more predictable I/O behaviour. It's only used for MultiFile and only if the OS supports O_DIRECT.

Definition at line 74 of file StorageOption.h.

## Member Enumeration Documentation

## Option

enum casacore::StorageOption::Option

Define the possible options how table files are organized.

Enumerator
MultiFile | Let storage managers use a combined MultiFile.
MultiHDF5 | Let storage managers use a combined MultiHDF5.
SepFile | Let storage managers use separate files.
Default | Use default (currently SepFile).
Aipsrc | Use as defined in the aipsrc file.

Definition at line 78 of file StorageOption.h.

## Constructor & Destructor Documentation

## StorageOption()

casacore::StorageOption::StorageOption | ( | Option | option = Aipsrc,
|  | Int | blockSize = -2,
|  | Int | useODirect = -3 )

Create an option object.

The parameter values are described in the synopsis. The blocksize has to be given in bytes. A size value -2 means reading that size from the aipsrc file. A size value -1 means use the default of 4*1024*1024.
useODirect<0 means reading the option from the aipsrc file. It is only set if the OS supports O_DIRECT.

References Aipsrc, blockSize(), option(), and useODirect().

## Member Function Documentation

## blockSize()

uInt casacore::StorageOption::blockSize | ( |  | ) | const

inline

Get the block size (in bytes).

Definition at line 113 of file StorageOption.h.

References itsBlockSize.

Referenced by setBlockSize(), and StorageOption().

## fillOption()

void casacore::StorageOption::fillOption | ( |  | ) |

Fill the option in case Aipsrc or Default was given.

It is done as explained in the synopsis.

## option()

Option casacore::StorageOption::option | ( |  | ) | const

inline

Get the option.

Definition at line 105 of file StorageOption.h.

References itsOption.

Referenced by setOption(), and StorageOption().

## setBlockSize()

void casacore::StorageOption::setBlockSize | ( | Int | blockSize | ) |

inline

Set the block size (in bytes).

Definition at line 117 of file StorageOption.h.

References blockSize(), and itsBlockSize.

## setOption()

void casacore::StorageOption::setOption | ( | Option | option | ) |

inline

Set the option.

Definition at line 109 of file StorageOption.h.

References itsOption, and option().

## setUseODirect()

void casacore::StorageOption::setUseODirect | ( | Bool | useODirect | ) |

Set the O_DIRECT option.

It is only set if the OS supports O_DIRECT.

References useODirect().

## useODirect()

Bool casacore::StorageOption::useODirect | ( |  | ) | const

inline

Get the O_DIRECT option.

Definition at line 121 of file StorageOption.h.

References itsUseODirect.

Referenced by setUseODirect(), and StorageOption().

## Member Data Documentation

## itsBlockSize

Int casacore::StorageOption::itsBlockSize

private

Definition at line 130 of file StorageOption.h.

Referenced by blockSize(), and setBlockSize().

## itsOption

Option casacore::StorageOption::itsOption

private

Definition at line 129 of file StorageOption.h.

Referenced by option(), and setOption().

## itsUseAipsrcODirect

Bool casacore::StorageOption::itsUseAipsrcODirect

private

Definition at line 132 of file StorageOption.h.

## itsUseODirect

Bool casacore::StorageOption::itsUseODirect

private

Definition at line 131 of file StorageOption.h.

Referenced by useODirect().

The documentation for this class was generated from the following file:

- tables/Tables/StorageOption.h