casacore
|
#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. More... | |
void | fillOption (Bool newFile) |
Fill the option in case Aipsrc or Default was given. More... | |
Option | option () const |
Get the option. More... | |
Int | bufferSize () const |
Get the buffer size. More... | |
Int | maxCacheSizeMB () const |
Get the maximum cache size (in MibiByte). More... | |
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 MibiByte 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.
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. The buffer size has to be given in bytes. The maximum cache size has to be given in MibiBytes (1024*1024 bytes).
|
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.
|
inline |
Get the maximum cache size (in MibiByte).
-1 means undefined.
Definition at line 154 of file TSMOption.h.
References itsMaxCacheSize.
|
inline |
|
private |
Definition at line 159 of file TSMOption.h.
Referenced by bufferSize().
|
private |
Definition at line 160 of file TSMOption.h.
Referenced by maxCacheSizeMB().
|
private |
Definition at line 158 of file TSMOption.h.
Referenced by option().