Package org.hornetq.core.journal.impl

Examples of org.hornetq.core.journal.impl.NIOSequentialFileFactory


      deleteDirectory(file);

      file.mkdir();

      return new NIOSequentialFileFactory(journalDir);
   }
View Full Code Here


         factory = new AIOSequentialFileFactory(dir.getPath());
         maxAIO = ConfigurationImpl.DEFAULT_JOURNAL_MAX_IO_AIO;
      }
      else
      {
         factory = new NIOSequentialFileFactory(dir.getPath());
         maxAIO = ConfigurationImpl.DEFAULT_JOURNAL_MAX_IO_NIO;
      }

      journal = new JournalImpl(50 * 1024,
                                20,
View Full Code Here

         System.out.println("test # " + i);

         internalTestProduceAndConsume();
         stopServer();

         NIOSequentialFileFactory factory = new NIOSequentialFileFactory(getJournalDir());
         JournalImpl journal = new JournalImpl(ConfigurationImpl.DEFAULT_JOURNAL_FILE_SIZE,
                                               2,
                                               0,
                                               0,
                                               factory,
View Full Code Here

    * @see org.hornetq.tests.unit.core.journal.impl.JournalImplTestBase#getFileFactory()
    */
   @Override
   protected SequentialFileFactory getFileFactory() throws Exception
   {
      return new NIOSequentialFileFactory(getTestDir());
   }
View Full Code Here

      createBindingsDir = config.isCreateBindingsDir();

      journalDir = config.getJournalDirectory();

      SequentialFileFactory bindingsFF = new NIOSequentialFileFactory(bindingsDir);

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

      SequentialFileFactory journalFF = null;

      if (config.getJournalType() == JournalType.ASYNCIO)
      {
         JournalStorageManager.log.info("Using AIO Journal");

         journalFF = new AIOSequentialFileFactory(journalDir,
                                                  config.getJournalBufferSize_AIO(),
                                                  config.getJournalBufferTimeout_AIO(),
                                                  config.isLogJournalWriteRate());
      }
      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());
      }
      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);

      perfBlastPages = config.getJournalPerfBlastPages();
   }
View Full Code Here

   }

   public static void describeBindingJournal(final String bindingsDir) throws Exception
   {

      SequentialFileFactory bindingsFF = new NIOSequentialFileFactory(bindingsDir);

      JournalImpl bindings = new JournalImpl(1024 * 1024, 2, -1, 0, bindingsFF, "hornetq-bindings", "bindings", 1);

      describeJournal(bindingsFF, bindings);
   }
View Full Code Here

   }

   public static void describeMessagesJournal(final String messagesDir) throws Exception
   {

      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(messagesDir);

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

      JournalImpl messagesJournal = new JournalImpl(defaultValues.getJournalFileSize(),
View Full Code Here

    * @return
    * @throws Exception
    */
   protected static Pair<Map<Long, Set<PagePosition>>, Set<Long>> loadCursorACKs(final String journalLocation) throws Exception
   {
      SequentialFileFactory messagesFF = new NIOSequentialFileFactory(journalLocation);

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

      JournalImpl messagesJournal = new JournalImpl(defaultValues.getJournalFileSize(),
View Full Code Here

   // Protected -----------------------------------------------------

   protected SequentialFileFactory newFileFactory(final String directoryName)
   {
      return new NIOSequentialFileFactory(directory + File.separatorChar + directoryName, false);
   }
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(),
View Full Code Here

TOP

Related Classes of org.hornetq.core.journal.impl.NIOSequentialFileFactory

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.