Package org.hornetq.core.journal.impl

Examples of org.hornetq.core.journal.impl.JournalImpl$PerfBlast


      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(journalLocation, null);

      // Will use only default values. The load function should adapt to anything different
      ConfigurationImpl defaultValues = new ConfigurationImpl();

      JournalImpl messagesJournal = new JournalImpl(defaultValues.getJournalFileSize(),
         defaultValues.getJournalMinFiles(),
         0,
         0,
         messagesFF,
         "hornetq-data",
         "hq",
         1);

      messagesJournal.start();

      ArrayList<RecordInfo> records = new ArrayList<RecordInfo>();
      ArrayList<PreparedTransactionInfo> txs = new ArrayList<PreparedTransactionInfo>();

      messagesJournal.load(records, txs, null, false);

      PageCursorsInfo cursorInfo = new PageCursorsInfo();


      for (RecordInfo record : records)
View Full Code Here


      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(journalLocation, null);

      // Will use only default values. The load function should adapt to anything different
      ConfigurationImpl defaultValues = new ConfigurationImpl();

      JournalImpl messagesJournal = new JournalImpl(defaultValues.getJournalFileSize(),
                                                    defaultValues.getJournalMinFiles(),
                                                    0,
                                                    0,
                                                    messagesFF,
                                                    "hornetq-data",
                                                    "hq",
                                                    1);

      messagesJournal.start();

      ArrayList<RecordInfo> records = new ArrayList<RecordInfo>();
      ArrayList<PreparedTransactionInfo> txs = new ArrayList<PreparedTransactionInfo>();

      messagesJournal.load(records, txs, null, false);

      PageCursorsInfo cursorInfo = new PageCursorsInfo();


      for (RecordInfo record : records)
View Full Code Here

               }

            }
         }

         JournalImpl messagesJournal = new JournalImpl(defaultValues.getJournalFileSize(),
                                                       defaultValues.getJournalMinFiles(),
                                                       0,
                                                       0,
                                                       messagesFF,
                                                       journalName,
                                                       exension,
                                                       1);

         messagesJournal.start();

         messagesJournal.loadInternalOnly();


         for (long tx : txsToRollback)
         {
            System.out.println("Rolling back " + tx);

            try
            {
               messagesJournal.appendRollbackRecord(tx, true);
            }
            catch (Throwable e)
            {
               e.printStackTrace();
            }
         }


         for (long id : idsToDelete)
         {
            System.out.println("Deleting record " + id);

            try
            {
               messagesJournal.appendDeleteRecord(id, true);
            }
            catch (Throwable e)
            {
               e.printStackTrace();
            }
         }

         messagesJournal.stop();

      }
      catch (Exception e)
      {
         e.printStackTrace();
View Full Code Here

   private void getJmsBindings() throws Exception
   {
      SequentialFileFactory bindingsJMS = new NIOSequentialFileFactory(config.getBindingsDirectory());

      Journal jmsJournal = new JournalImpl(1024 * 1024,
                                           2,
                                           config.getJournalCompactMinFiles(),
                                           config.getJournalCompactPercentage(),
                                           bindingsJMS,
                                           "hornetq-jms",
                                           "jms",
                                           1);

      jmsJournal.start();

      List<RecordInfo> data = new ArrayList<>();

      ArrayList<PreparedTransactionInfo> list = new ArrayList<>();

      HornetQServerLogger.LOGGER.debug("Reading jms bindings journal from " + config.getBindingsDirectory());

      jmsJournal.load(data, list, null);

      for (RecordInfo record : data)
      {
         long id = record.id;

View Full Code Here

      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(journalLocation, null);

      // Will use only default values. The load function should adapt to anything different
      ConfigurationImpl defaultValues = new ConfigurationImpl();

      JournalImpl messagesJournal = new JournalImpl(defaultValues.getJournalFileSize(),
         defaultValues.getJournalMinFiles(),
         0,
         0,
         messagesFF,
         "hornetq-data",
         "hq",
         1);

      messagesJournal.start();

      ArrayList<RecordInfo> records = new ArrayList<RecordInfo>();
      ArrayList<PreparedTransactionInfo> txs = new ArrayList<PreparedTransactionInfo>();

      messagesJournal.load(records, txs, null, false);

      PageCursorsInfo cursorInfo = new PageCursorsInfo();


      for (RecordInfo record : records)
View Full Code Here

      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);

      bindingsJournal = localBindings;
      originalBindingsJournal = 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)
      {
         HornetQServerLogger.LOGGER.journalUseAIO();

         journalFF = new AIOSequentialFileFactory(journalDir,
            config.getJournalBufferSize_AIO(),
            config.getJournalBufferTimeout_AIO(),
            config.isLogJournalWriteRate(),
            criticalErrorListener);
      }
      else if (config.getJournalType() == JournalType.NIO)
      {
         HornetQServerLogger.LOGGER.journalUseNIO();
         journalFF = new NIOSequentialFileFactory(journalDir,
            true,
            config.getJournalBufferSize_NIO(),
            config.getJournalBufferTimeout_NIO(),
            config.isLogJournalWriteRate(),
            criticalErrorListener);
      }
      else
      {
         throw HornetQMessageBundle.BUNDLE.invalidJournalType2(config.getJournalType());
      }

      idGenerator = new BatchingIDGenerator(0, JournalStorageManager.CHECKPOINT_BATCH_SIZE, this);

      Journal localMessage = new JournalImpl(config.getJournalFileSize(),
         config.getJournalMinFiles(),
         config.getJournalCompactMinFiles(),
         config.getJournalCompactPercentage(),
         journalFF,
         "hornetq-data",
View Full Code Here

      createDir = config.isCreateBindingsDir();

      SequentialFileFactory bindingsJMS = new NIOSequentialFileFactory(journalDir);

      Journal localJMS = new JournalImpl(1024 * 1024,
                                              2,
                                              config.getJournalCompactMinFiles(),
                                              config.getJournalCompactPercentage(),
                                              bindingsJMS,
                                              "hornetq-jms",
View Full Code Here

      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);

      bindingsJournal = localBindings;
      originalBindingsJournal = 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)
      {
         HornetQServerLogger.LOGGER.journalUseAIO();

         journalFF = new AIOSequentialFileFactory(journalDir,
            config.getJournalBufferSize_AIO(),
            config.getJournalBufferTimeout_AIO(),
            config.isLogJournalWriteRate(),
            criticalErrorListener);
      }
      else if (config.getJournalType() == JournalType.NIO)
      {
         HornetQServerLogger.LOGGER.journalUseNIO();
         journalFF = new NIOSequentialFileFactory(journalDir,
            true,
            config.getJournalBufferSize_NIO(),
            config.getJournalBufferTimeout_NIO(),
            config.isLogJournalWriteRate(),
            criticalErrorListener);
      }
      else
      {
         throw HornetQMessageBundle.BUNDLE.invalidJournalType2(config.getJournalType());
      }

      idGenerator = new BatchingIDGenerator(0, JournalStorageManager.CHECKPOINT_BATCH_SIZE, this);

      Journal localMessage = new JournalImpl(config.getJournalFileSize(),
         config.getJournalMinFiles(),
         config.getJournalCompactMinFiles(),
         config.getJournalCompactPercentage(),
         journalFF,
         "hornetq-data",
View Full Code Here

      createDir = config.isCreateBindingsDir();

      SequentialFileFactory bindingsJMS = new NIOSequentialFileFactory(journalDir);

      Journal localJMS = new JournalImpl(1024 * 1024,
                                              2,
                                              config.getJournalCompactMinFiles(),
                                              config.getJournalCompactPercentage(),
                                              bindingsJMS,
                                              "hornetq-jms",
View Full Code Here

      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",
View Full Code Here

TOP

Related Classes of org.hornetq.core.journal.impl.JournalImpl$PerfBlast

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.