{
allocPolicy = AllocationPolicy.valueOf(_allocationPolicy);
}
catch (Exception e)
{
throw new InvalidConfigException("Invalid Config Value for allocationPolicy: " + _allocationPolicy);
}
File mmapDirectory = new File(_mmapDirectory);
if (allocPolicy.equals(AllocationPolicy.MMAPPED_MEMORY) && !mmapDirectory.exists())
{
if (!mmapDirectory.mkdirs())
{
throw new InvalidConfigException("Invalid Config Value: Cannot create mmapDirectory: " + _mmapDirectory);
}
if (mmapDirectory.exists() && !mmapDirectory.canWrite())
{
throw new InvalidConfigException("Invalid Config Value: Cannot write to mmapDirectory: " + _mmapDirectory);
}
}
QueuePolicy queuePolicy = null;
try
{
queuePolicy = QueuePolicy.valueOf(_queuePolicy);
}
catch (IllegalArgumentException e)
{
throw new InvalidConfigException("Invalid queueing policy:" + _queuePolicy);
}
AssertLevel assertLevel = null;
try
{
assertLevel = AssertLevel.valueOf(_assertLevel);
}
catch (IllegalArgumentException e)
{
throw new InvalidConfigException("Invalid assert level:" + _assertLevel);
}
//the biggest event we can process is the one that we can fit in the smallest ByteBuffer in the main event buffer,
// i.e. the last ByteBuffer
//int maxMaxEventSize = _maxSize % _maxIndividualBufferSize == 0 ? _maxIndividualBufferSize