DeviceAccessSchedulerParams Class Reference

DeviceAccessSchedulerParams defines parameters used to create a DeviceAccessScheduler. More...

#include <DeviceAccessSchedulerParams.h>

List of all members.

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


Detailed Description

DeviceAccessSchedulerParams defines parameters used to create a DeviceAccessScheduler.

Definition at line 35 of file DeviceAccessSchedulerParams.h.


Member Enumeration Documentation

enum DeviceAccessSchedulerParams::SchedulerType

Enumeration of available scheduler implementations.

Enumerator:
THREAD_POOL_SCHEDULER 
IO_COMPLETION_PORT_SCHEDULER 
AIO_POLLING_SCHEDULER 
AIO_SIGNAL_SCHEDULER 
AIO_LINUX_SCHEDULER 

Definition at line 51 of file DeviceAccessSchedulerParams.h.


Constructor & Destructor Documentation

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 }


Member Function Documentation

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 }


Member Data Documentation

ParamName DeviceAccessSchedulerParams::paramSchedulerType [static]

Definition at line 38 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

ParamName DeviceAccessSchedulerParams::paramThreadCount [static]

Definition at line 39 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

ParamName DeviceAccessSchedulerParams::paramMaxRequests [static]

Definition at line 40 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

ParamVal DeviceAccessSchedulerParams::valThreadPoolScheduler [static]

Definition at line 42 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

ParamVal DeviceAccessSchedulerParams::valIoCompletionPortScheduler [static]

Definition at line 43 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

ParamVal DeviceAccessSchedulerParams::valAioPollingScheduler [static]

Definition at line 44 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

ParamVal DeviceAccessSchedulerParams::valAioSignalScheduler [static]

Definition at line 45 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

ParamVal DeviceAccessSchedulerParams::valAioLinuxScheduler [static]

Definition at line 46 of file DeviceAccessSchedulerParams.h.

Referenced by readConfig().

SchedulerType DeviceAccessSchedulerParams::schedulerType

Type of scheduler to create.

Definition at line 62 of file DeviceAccessSchedulerParams.h.

Referenced by DeviceAccessSchedulerParams(), DeviceAccessScheduler::newScheduler(), and readConfig().

bool DeviceAccessSchedulerParams::usingDefaultSchedulerType

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().

uint DeviceAccessSchedulerParams::nThreads

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().

uint DeviceAccessSchedulerParams::maxRequests

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().


The documentation for this class was generated from the following files:
Generated on Mon Jun 22 04:00:29 2009 for Fennel by  doxygen 1.5.1