#include <DeviceAccessSchedulerParams.h>
Public Types | |
enum | SchedulerType { THREAD_POOL_SCHEDULER, IO_COMPLETION_PORT_SCHEDULER, AIO_POLLING_SCHEDULER, AIO_SIGNAL_SCHEDULER, AIO_LINUX_SCHEDULER } |
Enumeration of available scheduler implementations. More... | |
Public Member Functions | |
DeviceAccessSchedulerParams () | |
Defines a default set of scheduler parameters. | |
void | readConfig (ConfigMap const &configMap) |
Reads parameter settings from a ConfigMap. | |
Public Attributes | |
SchedulerType | schedulerType |
Type of scheduler to create. | |
bool | usingDefaultSchedulerType |
True if using the default scheduler type, as opposed to the one that was explicitly specified in the configuration file. | |
uint | nThreads |
Suggested number of threads to dedicate to scheduling activities; the scheduler may adjust this number based on maxRequests. | |
uint | maxRequests |
The maximum number of simultaneous requests that this scheduler should be able to handle; additional requests will be queued. | |
Static Public Attributes | |
static ParamName | paramSchedulerType |
static ParamName | paramThreadCount |
static ParamName | paramMaxRequests |
static ParamVal | valThreadPoolScheduler |
static ParamVal | valIoCompletionPortScheduler |
static ParamVal | valAioPollingScheduler |
static ParamVal | valAioSignalScheduler |
static ParamVal | valAioLinuxScheduler |
Definition at line 35 of file DeviceAccessSchedulerParams.h.
Enumeration of available scheduler implementations.
THREAD_POOL_SCHEDULER | |
IO_COMPLETION_PORT_SCHEDULER | |
AIO_POLLING_SCHEDULER | |
AIO_SIGNAL_SCHEDULER | |
AIO_LINUX_SCHEDULER |
Definition at line 51 of file DeviceAccessSchedulerParams.h.
00051 { 00052 THREAD_POOL_SCHEDULER, 00053 IO_COMPLETION_PORT_SCHEDULER, 00054 AIO_POLLING_SCHEDULER, 00055 AIO_SIGNAL_SCHEDULER, 00056 AIO_LINUX_SCHEDULER 00057 };
DeviceAccessSchedulerParams::DeviceAccessSchedulerParams | ( | ) |
Defines a default set of scheduler parameters.
Definition at line 46 of file DeviceAccessSchedulerParams.cpp.
References AIO_LINUX_SCHEDULER, IO_COMPLETION_PORT_SCHEDULER, maxRequests, nThreads, schedulerType, THREAD_POOL_SCHEDULER, and usingDefaultSchedulerType.
00047 { 00048 #ifdef __MSVC__ 00049 schedulerType = IO_COMPLETION_PORT_SCHEDULER; 00050 #elif defined(USE_LIBAIO_H) 00051 schedulerType = AIO_LINUX_SCHEDULER; 00052 #else 00053 schedulerType = THREAD_POOL_SCHEDULER; 00054 #endif 00055 nThreads = 1; 00056 maxRequests = 1024; 00057 usingDefaultSchedulerType = true; 00058 }
void DeviceAccessSchedulerParams::readConfig | ( | ConfigMap const & | configMap | ) |
Reads parameter settings from a ConfigMap.
Definition at line 60 of file DeviceAccessSchedulerParams.cpp.
References AIO_LINUX_SCHEDULER, AIO_POLLING_SCHEDULER, AIO_SIGNAL_SCHEDULER, ConfigMap::getIntParam(), ConfigMap::getStringParam(), IO_COMPLETION_PORT_SCHEDULER, maxRequests, nThreads, paramMaxRequests, paramSchedulerType, paramThreadCount, schedulerType, THREAD_POOL_SCHEDULER, usingDefaultSchedulerType, valAioLinuxScheduler, valAioPollingScheduler, valAioSignalScheduler, valIoCompletionPortScheduler, and valThreadPoolScheduler.
Referenced by RandomAccessFileDeviceTest::RandomAccessFileDeviceTest(), and CacheParams::readConfig().
00061 { 00062 usingDefaultSchedulerType = false; 00063 std::string s = configMap.getStringParam(paramSchedulerType); 00064 if (s == valThreadPoolScheduler) { 00065 schedulerType = THREAD_POOL_SCHEDULER; 00066 } else if (s == valAioPollingScheduler) { 00067 schedulerType = AIO_POLLING_SCHEDULER; 00068 } else if (s == valAioSignalScheduler) { 00069 schedulerType = AIO_SIGNAL_SCHEDULER; 00070 } else if (s == valAioLinuxScheduler) { 00071 schedulerType = AIO_LINUX_SCHEDULER; 00072 } else if (s == valIoCompletionPortScheduler) { 00073 schedulerType = IO_COMPLETION_PORT_SCHEDULER; 00074 } else { 00075 // treat unrecognized as default 00076 usingDefaultSchedulerType = true; 00077 } 00078 nThreads = configMap.getIntParam( 00079 paramThreadCount,nThreads); 00080 maxRequests = configMap.getIntParam( 00081 paramMaxRequests,maxRequests); 00082 }
Type of scheduler to create.
Definition at line 62 of file DeviceAccessSchedulerParams.h.
Referenced by DeviceAccessSchedulerParams(), DeviceAccessScheduler::newScheduler(), and readConfig().
True if using the default scheduler type, as opposed to the one that was explicitly specified in the configuration file.
Definition at line 68 of file DeviceAccessSchedulerParams.h.
Referenced by DeviceAccessSchedulerParams(), DeviceAccessScheduler::newScheduler(), and readConfig().
Suggested number of threads to dedicate to scheduling activities; the scheduler may adjust this number based on maxRequests.
Definition at line 75 of file DeviceAccessSchedulerParams.h.
Referenced by AioSignalScheduler::AioSignalScheduler(), DeviceAccessSchedulerParams(), IoCompletionPortScheduler::IoCompletionPortScheduler(), and readConfig().
The maximum number of simultaneous requests that this scheduler should be able to handle; additional requests will be queued.
Definition at line 81 of file DeviceAccessSchedulerParams.h.
Referenced by AioLinuxScheduler::AioLinuxScheduler(), DeviceAccessSchedulerParams(), readConfig(), and ThreadPoolScheduler::ThreadPoolScheduler().