createBindingsDir = config.isCreateBindingsDir();
journalDir = config.getJournalDirectory();
SequentialFileFactory bindingsFF = new NIOSequentialFileFactory(bindingsDir, criticalErrorListener);
Journal localBindings = new JournalImpl(1024 * 1024,
2,
config.getJournalCompactMinFiles(),
config.getJournalCompactPercentage(),
bindingsFF,
"hornetq-bindings",
"bindings",
1);
if (replicator != null)
{
bindingsJournal = new ReplicatedJournal((byte)0, localBindings, replicator);
}
else
{
bindingsJournal = localBindings;
}
if (journalDir == null)
{
throw new NullPointerException("journal-dir is null");
}
createJournalDir = config.isCreateJournalDir();
syncNonTransactional = config.isJournalSyncNonTransactional();
syncTransactional = config.isJournalSyncTransactional();
if (config.getJournalType() == JournalType.ASYNCIO)
{
JournalStorageManager.log.info("Using AIO Journal");
journalFF = new AIOSequentialFileFactory(journalDir,
config.getJournalBufferSize_AIO(),
config.getJournalBufferTimeout_AIO(),
config.isLogJournalWriteRate(),
criticalErrorListener);
}
else if (config.getJournalType() == JournalType.NIO)
{
JournalStorageManager.log.info("Using NIO Journal");
journalFF = new NIOSequentialFileFactory(journalDir,
true,
config.getJournalBufferSize_NIO(),
config.getJournalBufferTimeout_NIO(),
config.isLogJournalWriteRate(),
criticalErrorListener);
}
else
{
throw new IllegalArgumentException("Unsupported journal type " + config.getJournalType());
}
if (config.isBackup() && !config.isSharedStore())
{
idGenerator = null;
}
else
{
idGenerator = new BatchingIDGenerator(0, JournalStorageManager.CHECKPOINT_BATCH_SIZE, bindingsJournal);
}
Journal localMessage = new JournalImpl(config.getJournalFileSize(),
config.getJournalMinFiles(),
config.getJournalCompactMinFiles(),
config.getJournalCompactPercentage(),
journalFF,
"hornetq-data",
"hq",
config.getJournalType() == JournalType.ASYNCIO ? config.getJournalMaxIO_AIO()
: config.getJournalMaxIO_NIO());
if (replicator != null)
{
messageJournal = new ReplicatedJournal((byte)1, localMessage, replicator);
}
else
{
messageJournal = localMessage;
}
largeMessagesDirectory = config.getLargeMessagesDirectory();
largeMessagesFactory = new NIOSequentialFileFactory(largeMessagesDirectory, false, criticalErrorListener);
perfBlastPages = config.getJournalPerfBlastPages();
if (config.getPageMaxConcurrentIO() != 1)
{