Options for the Tiled Storage Manager Access. More...
#include <TSMOption.h>
Public Types | |
enum | Option { Cache, Buffer, MMap, Default, Aipsrc } |
Define the possible options how the TiledStMan accesses its data. More... | |
Public Member Functions | |
TSMOption (Option option=Aipsrc, Int bufferSize=-2, Int maxCacheSizeMB=-2) | |
Create an option object. | |
void | fillOption (Bool newFile) |
Fill the option in case Aipsrc or Default was given. | |
Option | option () const |
Get the option. | |
Int | bufferSize () const |
Get the buffer size. | |
Int | maxCacheSizeMB () const |
Get the maximum cache size. | |
Private Attributes | |
Option | itsOption |
Int | itsBufferSize |
Int | itsMaxCacheSize |
Options for the Tiled Storage Manager Access.
Public interface
This class can be used to define how the Tiled Storage Manager accesses its data. There are three ways:
The constructor of the class can be used to define the options or to read options from the aipsrc file.
TSMOption::Cache
Use unbuffered file IO with internal TSM caching. This is the old behaviour. The maximum cache size can be given as a constructor argument. TSMOption::MMap
Use memory-mapped IO. TSMOption::Buffer
Use buffered file IO without. The buffer size can be given as a constructor argument. TSMOption::Default
Use default. This is MMap for existing files on 64-bit systems, otherwise Buffer. TSMOption::Aipsrc
Use the option as defined in the aipsrc file. The aipsrc variables are:
table.tsm.option
gives the option as the case-insensitive string value: cache
means TSMCache. mmap
(or map
) means TSMMap. mmapold
(or mapold
) means TSMMap for existing tables and TSMDefault for new tables. buffer
means TSMBuffer. default
means TSMDefault. default
. Note that mmapold
is almost the same as default
. Only on 32-bit systems it is different. table.tsm.maxcachesizemb
gives the maximum cache size in MB for option TSMOption::Cache
. A value -1 means that the system determines the maximum. A value 0 means unlimited. It defaults to -1. Note it can always be overridden using class ROTiledStManAccessor. table.tsm.buffersize
gives the buffer size for option TSMOption::Buffer
. A value <=0 means use the default 4096. It defaults to 0. Definition at line 116 of file TSMOption.h.
Define the possible options how the TiledStMan accesses its data.
Cache |
Use unbuffered file IO with internal TSM caching. |
Buffer |
Use buffered file IO without internal TSM caching. |
MMap |
Use memory-mapped IO. |
Default |
Use default. |
Aipsrc |
Use as defined in the aipsrc file. |
Definition at line 120 of file TSMOption.h.
casacore::TSMOption::TSMOption | ( | Option | option = Aipsrc , |
|
Int | bufferSize = -2 , |
|||
Int | maxCacheSizeMB = -2 | |||
) |
Create an option object.
The parameter values are described in the synopsis. A size value -2 means reading that size from the aipsrc file.
Int casacore::TSMOption::bufferSize | ( | ) | const [inline] |
void casacore::TSMOption::fillOption | ( | Bool | newFile | ) |
Fill the option in case Aipsrc or Default was given.
It is done as explained in the synopsis.
Int casacore::TSMOption::maxCacheSizeMB | ( | ) | const [inline] |
Get the maximum cache size.
-1 means undefined.
Definition at line 152 of file TSMOption.h.
References itsMaxCacheSize.
Option casacore::TSMOption::option | ( | ) | const [inline] |
Int casacore::TSMOption::itsBufferSize [private] |
Definition at line 157 of file TSMOption.h.
Referenced by bufferSize().
Int casacore::TSMOption::itsMaxCacheSize [private] |
Definition at line 158 of file TSMOption.h.
Referenced by maxCacheSizeMB().
Option casacore::TSMOption::itsOption [private] |
Definition at line 156 of file TSMOption.h.
Referenced by option().