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",