/** * @throws Exception * @see org.apache.activemq.artemis.core.server.ActiveMQComponent#stop() */ @Override public void stop() throws Exception { localJournal.stop(); }
@Override public void stop() throws Exception { this.started = false; jmsJournal.stop(); }
public void stop() throws Exception { journal.stop(); }
public void stop() throws Exception { journal.stop(); }
public void stop() throws Exception { journal.stop(); }
public void stop() throws Exception { journal.stop(); }
public void stop() throws Exception { journal.stop(); }
public void stop() throws Exception { journal.stop(); }
@Override public synchronized void stop(boolean ioCriticalError, boolean sendFailover) throws Exception { if (!started) { return; } if (!ioCriticalError) { performCachedLargeMessageDeletes(); // Must call close to make sure last id is persisted if (journalLoaded && idGenerator != null) idGenerator.persistCurrentID(); } final CountDownLatch latch = new CountDownLatch(1); executor.execute(new Runnable() { @Override public void run() { latch.countDown(); } }); latch.await(30, TimeUnit.SECONDS); beforeStop(); bindingsJournal.stop(); messageJournal.stop(); journalLoaded = false; started = false; }
@Override public synchronized void stop(boolean ioCriticalError, boolean sendFailover) throws Exception { if (!started) { return; } if (!ioCriticalError) { performCachedLargeMessageDeletes(); // Must call close to make sure last id is persisted if (journalLoaded && idGenerator != null) idGenerator.persistCurrentID(); } final CountDownLatch latch = new CountDownLatch(1); executor.execute(new Runnable() { @Override public void run() { latch.countDown(); } }); latch.await(30, TimeUnit.SECONDS); beforeStop(); bindingsJournal.stop(); messageJournal.stop(); largeMessagesFactory.stop(); journalLoaded = false; started = false; }
for (Journal j : journals) { if (j instanceof FileWrapperJournal) j.stop();
/** * Open the bindings journal and extract all bindings data. * * @throws Exception will be thrown if anything goes wrong reading the bindings journal */ private void getBindings() throws Exception { List<RecordInfo> records = new LinkedList<>(); Journal bindingsJournal = storageManager.getBindingsJournal(); bindingsJournal.start(); ActiveMQServerLogger.LOGGER.debug("Reading bindings journal from " + config.getBindingsDirectory()); bindingsJournal.load(records, null, null); for (RecordInfo info : records) { if (info.getUserRecordType() == JournalRecordIds.QUEUE_BINDING_RECORD) { PersistentQueueBindingEncoding bindingEncoding = (PersistentQueueBindingEncoding) DescribeJournal.newObjectEncoding(info, null); queueBindings.put(bindingEncoding.getId(), bindingEncoding); } else if (info.getUserRecordType() == JournalRecordIds.ADDRESS_BINDING_RECORD) { PersistentAddressBindingEncoding bindingEncoding = (PersistentAddressBindingEncoding) DescribeJournal.newObjectEncoding(info, null); addressBindings.put(bindingEncoding.getId(), bindingEncoding); } } bindingsJournal.stop(); }
/** * Open the bindings journal and extract all bindings data. * * @throws Exception will be thrown if anything goes wrong reading the bindings journal */ private void getBindings() throws Exception { List<RecordInfo> records = new LinkedList<>(); Journal bindingsJournal = storageManager.getBindingsJournal(); bindingsJournal.start(); ActiveMQServerLogger.LOGGER.debug("Reading bindings journal from " + config.getBindingsDirectory()); bindingsJournal.load(records, null, null); for (RecordInfo info : records) { if (info.getUserRecordType() == JournalRecordIds.QUEUE_BINDING_RECORD) { PersistentQueueBindingEncoding bindingEncoding = (PersistentQueueBindingEncoding) DescribeJournal.newObjectEncoding(info, null); queueBindings.put(bindingEncoding.getId(), bindingEncoding); } else if (info.getUserRecordType() == JournalRecordIds.ADDRESS_BINDING_RECORD) { PersistentAddressBindingEncoding bindingEncoding = (PersistentAddressBindingEncoding) DescribeJournal.newObjectEncoding(info, null); addressBindings.put(bindingEncoding.getId(), bindingEncoding); } } bindingsJournal.stop(); }
liveServer.getStorageManager().getMessageJournal().stop();
@Test public void testPageCursorCounterRecordSize() throws Exception { server.getStorageManager().storePageCounterInc(1, 1, 1000); server.getStorageManager().stop(); JournalStorageManager journalStorageManager = (JournalStorageManager) server.getStorageManager(); List<RecordInfo> committedRecords = new LinkedList<>(); List<PreparedTransactionInfo> preparedTransactions = new LinkedList<>(); try { journalStorageManager.getMessageJournal().start(); journalStorageManager.getMessageJournal().load(committedRecords, preparedTransactions, transactionFailure); ActiveMQBuffer buff = ActiveMQBuffers.wrappedBuffer(committedRecords.get(0).data); PageCountRecordInc encoding = new PageCountRecordInc(); encoding.decode(buff); Assert.assertEquals(1000, encoding.getPersistentSize()); } finally { journalStorageManager.getMessageJournal().stop(); } }
@Test public void testStoreAMQP() throws Throwable { ActiveMQServer server = createServer(true); server.start(); ProtonProtocolManagerFactory factory = (ProtonProtocolManagerFactory) server.getRemotingService().getProtocolFactoryMap().get("AMQP"); MessageImpl protonJMessage = (MessageImpl) Message.Factory.create(); AMQPMessage message = encodeAndCreateAMQPMessage(protonJMessage); message.setMessageID(333); Assert.assertNotNull(factory); server.getStorageManager().storeMessage(message); server.getStorageManager().stop(); JournalStorageManager journalStorageManager = (JournalStorageManager) server.getStorageManager(); List<RecordInfo> committedRecords = new LinkedList<>(); List<PreparedTransactionInfo> preparedTransactions = new LinkedList<>(); TransactionFailureCallback transactionFailure = new TransactionFailureCallback() { @Override public void failedTransaction(long transactionID, List<RecordInfo> records, List<RecordInfo> recordsToDelete) { } }; try { journalStorageManager.getMessageJournal().start(); journalStorageManager.getMessageJournal().load(committedRecords, preparedTransactions, transactionFailure); Assert.assertEquals(1, committedRecords.size()); } finally { journalStorageManager.getMessageJournal().stop(); } }
@Test public void testPageCountRecordSize() throws Exception { long tx = server.getStorageManager().generateID(); server.getStorageManager().storePageCounter(tx, 1, 1, 100); server.getStorageManager().commit(tx); server.getStorageManager().stop(); JournalStorageManager journalStorageManager = (JournalStorageManager) server.getStorageManager(); List<RecordInfo> committedRecords = new LinkedList<>(); List<PreparedTransactionInfo> preparedTransactions = new LinkedList<>(); try { journalStorageManager.getMessageJournal().start(); journalStorageManager.getMessageJournal().load(committedRecords, preparedTransactions, transactionFailure); ActiveMQBuffer buff = ActiveMQBuffers.wrappedBuffer(committedRecords.get(0).data); PageCountRecord encoding = new PageCountRecord(); encoding.decode(buff); Assert.assertEquals(100, encoding.getPersistentSize()); } finally { journalStorageManager.getMessageJournal().stop(); } }
@Test public void testPageCursorCounterRecordSizeTX() throws Exception { long tx = server.getStorageManager().generateID(); server.getStorageManager().storePageCounterInc(tx, 1, 1, 1000); server.getStorageManager().commit(tx); server.getStorageManager().stop(); JournalStorageManager journalStorageManager = (JournalStorageManager) server.getStorageManager(); List<RecordInfo> committedRecords = new LinkedList<>(); List<PreparedTransactionInfo> preparedTransactions = new LinkedList<>(); try { journalStorageManager.getMessageJournal().start(); journalStorageManager.getMessageJournal().load(committedRecords, preparedTransactions, transactionFailure); ActiveMQBuffer buff = ActiveMQBuffers.wrappedBuffer(committedRecords.get(0).data); PageCountRecordInc encoding = new PageCountRecordInc(); encoding.decode(buff); Assert.assertEquals(1000, encoding.getPersistentSize()); } finally { journalStorageManager.getMessageJournal().stop(); } }
@Test public void testStoreCore() throws Throwable { ActiveMQServer server = createServer(true); server.start(); CoreMessage message = new CoreMessage().initBuffer(10 * 1024).setDurable(true); message.setMessageID(333); CoreProtocolManagerFactory factory = (CoreProtocolManagerFactory) server.getRemotingService().getProtocolFactoryMap().get("CORE"); Assert.assertNotNull(factory); message.getBodyBuffer().writeByte((byte)'Z'); server.getStorageManager().storeMessage(message); server.getStorageManager().stop(); JournalStorageManager journalStorageManager = (JournalStorageManager) server.getStorageManager(); List<RecordInfo> committedRecords = new LinkedList<>(); List<PreparedTransactionInfo> preparedTransactions = new LinkedList<>(); TransactionFailureCallback transactionFailure = new TransactionFailureCallback() { @Override public void failedTransaction(long transactionID, List<RecordInfo> records, List<RecordInfo> recordsToDelete) { } }; try { journalStorageManager.getMessageJournal().start(); journalStorageManager.getMessageJournal().load(committedRecords, preparedTransactions, transactionFailure); Assert.assertEquals(1, committedRecords.size()); } finally { journalStorageManager.getMessageJournal().stop(); } }
journalStorageManager.getMessageJournal().stop(); try { clientSession.commit(xid, false);