Java Code Examples for org.apache.activemq.artemis.core.config.Configuration#getJournalCompactMinFiles()
The following examples show how to use
org.apache.activemq.artemis.core.config.Configuration#getJournalCompactMinFiles() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JMSJournalStorageManagerImpl.java From activemq-artemis with Apache License 2.0 | 6 votes |
public JMSJournalStorageManagerImpl(ExecutorFactory ioExecutors, final IDGenerator idGenerator, final Configuration config, final ReplicationManager replicator) { final EnumSet<JournalType> supportedJournalTypes = EnumSet.allOf(JournalType.class); if (!supportedJournalTypes.contains(config.getJournalType())) { throw new IllegalArgumentException("Only " + supportedJournalTypes + " are supported Journal types"); } this.config = config; createDir = config.isCreateBindingsDir(); SequentialFileFactory bindingsJMS = new NIOSequentialFileFactory(config.getBindingsLocation(), 1); Journal localJMS = new JournalImpl(ioExecutors, 1024 * 1024, 2, config.getJournalPoolFiles(), config.getJournalCompactMinFiles(), config.getJournalCompactPercentage(), bindingsJMS, "activemq-jms", "jms", 1, 0); if (replicator != null) { jmsJournal = new ReplicatedJournal((byte) 2, localJMS, replicator); } else { jmsJournal = localJMS; } this.idGenerator = idGenerator; }
Example 2
Source File: ShutdownOnCriticalIOErrorMoveNextTest.java From activemq-artemis with Apache License 2.0 | 4 votes |
ActiveMQServer createServer(String folder) throws Exception { final AtomicBoolean blocked = new AtomicBoolean(false); Configuration conf = createConfig(folder); ActiveMQSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), new SecurityConfiguration()); conf.setPersistenceEnabled(true); ActiveMQServer server = new ActiveMQServerImpl(conf, securityManager) { @Override protected StorageManager createStorageManager() { JournalStorageManager storageManager = new JournalStorageManager(conf, getCriticalAnalyzer(), executorFactory, scheduledPool, ioExecutorFactory, shutdownOnCriticalIO) { @Override protected Journal createMessageJournal(Configuration config, IOCriticalErrorListener criticalErrorListener, int fileSize) { return new JournalImpl(ioExecutorFactory, fileSize, config.getJournalMinFiles(), config.getJournalPoolFiles(), config.getJournalCompactMinFiles(), config.getJournalCompactPercentage(), config.getJournalFileOpenTimeout(), journalFF, "activemq-data", "amq", journalFF.getMaxIO(), 0, criticalErrorListener) { @Override protected void moveNextFile(boolean scheduleReclaim) throws Exception { super.moveNextFile(scheduleReclaim); if (blocked.get()) { throw new IllegalStateException("forcibly down"); } } }; } @Override public void storeMessage(Message message) throws Exception { super.storeMessage(message); blocked.set(true); } }; this.getCriticalAnalyzer().add(storageManager); return storageManager; } }; return server; }
Example 3
Source File: JournalStorageManager.java From activemq-artemis with Apache License 2.0 | 4 votes |
@Override protected void init(Configuration config, IOCriticalErrorListener criticalErrorListener) { if (!EnumSet.allOf(JournalType.class).contains(config.getJournalType())) { throw ActiveMQMessageBundle.BUNDLE.invalidJournal(); } bindingsFF = new NIOSequentialFileFactory(config.getBindingsLocation(), criticalErrorListener, config.getJournalMaxIO_NIO()); bindingsFF.setDatasync(config.isJournalDatasync()); Journal localBindings = new JournalImpl(ioExecutorFactory, 1024 * 1024, 2, config.getJournalPoolFiles(), config.getJournalCompactMinFiles(), config.getJournalCompactPercentage(), config.getJournalFileOpenTimeout(), bindingsFF, "activemq-bindings", "bindings", 1, 0, criticalErrorListener); bindingsJournal = localBindings; originalBindingsJournal = localBindings; switch (config.getJournalType()) { case NIO: if (criticalErrorListener != null) { ActiveMQServerLogger.LOGGER.journalUseNIO(); } journalFF = new NIOSequentialFileFactory(config.getJournalLocation(), true, config.getJournalBufferSize_NIO(), config.getJournalBufferTimeout_NIO(), config.getJournalMaxIO_NIO(), config.isLogJournalWriteRate(), criticalErrorListener, getCriticalAnalyzer()); break; case ASYNCIO: if (criticalErrorListener != null) { ActiveMQServerLogger.LOGGER.journalUseAIO(); } journalFF = new AIOSequentialFileFactory(config.getJournalLocation(), config.getJournalBufferSize_AIO(), config.getJournalBufferTimeout_AIO(), config.getJournalMaxIO_AIO(), config.isLogJournalWriteRate(), criticalErrorListener, getCriticalAnalyzer()); if (config.getJournalDeviceBlockSize() != null) { journalFF.setAlignment(config.getJournalDeviceBlockSize()); } break; case MAPPED: if (criticalErrorListener != null) { ActiveMQServerLogger.LOGGER.journalUseMAPPED(); } journalFF = new MappedSequentialFileFactory(config.getJournalLocation(), config.getJournalFileSize(), true, config.getJournalBufferSize_NIO(), config.getJournalBufferTimeout_NIO(), criticalErrorListener); break; default: throw ActiveMQMessageBundle.BUNDLE.invalidJournalType2(config.getJournalType()); } journalFF.setDatasync(config.isJournalDatasync()); int fileSize = fixJournalFileSize(config.getJournalFileSize(), journalFF.getAlignment()); Journal localMessage = createMessageJournal(config, criticalErrorListener, fileSize); messageJournal = localMessage; originalMessageJournal = localMessage; largeMessagesDirectory = config.getLargeMessagesDirectory(); largeMessagesFactory = new NIOSequentialFileFactory(config.getLargeMessagesLocation(), false, criticalErrorListener, 1); if (config.getPageMaxConcurrentIO() != 1) { pageMaxConcurrentIO = new Semaphore(config.getPageMaxConcurrentIO()); } else { pageMaxConcurrentIO = null; } }
Example 4
Source File: JournalStorageManager.java From activemq-artemis with Apache License 2.0 | 4 votes |
protected Journal createMessageJournal(Configuration config, IOCriticalErrorListener criticalErrorListener, int fileSize) { return new JournalImpl(ioExecutorFactory, fileSize, config.getJournalMinFiles(), config.getJournalPoolFiles(), config.getJournalCompactMinFiles(), config.getJournalCompactPercentage(), config.getJournalFileOpenTimeout(), journalFF, "activemq-data", "amq", journalFF.getMaxIO(), 0, criticalErrorListener); }