Package org.hornetq.core.journal

Examples of org.hornetq.core.journal.SequentialFile.open()


      SequentialFile file = fileFactory.createSequentialFile(fileName, 1000);

      Page page = new PageImpl(storeName, storageManager, fileFactory, file, pageNumber);

      // To create the file
      file.open();

      file.position(0);

      file.close();
View Full Code Here


      {
         SequentialFile copyTo = createFile();
         try
         {
            this.pendingRecordID = storageManager.storePendingLargeMessage(this.messageID);
            copyTo.open();
            pendingCopy.open();
            pendingCopy.copyTo(copyTo);         
         }
         finally
         {
View Full Code Here

            buffer.put(Byte.MAX_VALUE);
         }
        
         buffer.rewind();
        
         file.open();
        
         file.position(0);
        
         file.writeDirect(buffer, sync);
        
View Full Code Here

      long fileID = Integer.MAX_VALUE;
      for (String fileStr : files)
      {
         SequentialFile file = fileFactory.createSequentialFile(fileStr, 1);
        
         file.open();
        
         JournalImpl.initFileHeader(fileFactory, file, journal.getUserVersion(), fileID++);

         file.close();
      }
View Full Code Here

         if (file.exists())
         {
            file.delete();
         }

         file.open();

         file.fill(0, fileSize, (byte)'X');

         if (!AIO)
         {
View Full Code Here

         if (file.exists())
         {
            file.delete();
         }

         file.open();

         file.fill(0, fileSize, (byte)'X');

         if (!AIO)
         {
View Full Code Here

      {
         SequentialFile copyTo = createFile();
         try
         {
            this.pendingRecordID = storageManager.storePendingLargeMessage(this.messageID);
            copyTo.open();
            pendingCopy.open();
            pendingCopy.copyTo(copyTo);
         }
         finally
         {
View Full Code Here

      impl.sync();
      impl.close();

      file = factory.createSequentialFile("00010.page", 1);
      file.open();
      impl = new PageImpl(new SimpleString("something"), new NullStorageManager(), factory, file, 10);

      List<PagedMessage> msgs = impl.read();

      Assert.assertEquals(numberOfElements, msgs.size());
View Full Code Here

      file.writeDirect(buffer, true);

      impl.close();

      file = factory.createSequentialFile("00010.page", 1);
      file.open();
      impl = new PageImpl(new SimpleString("something"), new NullStorageManager(), factory, file, 10);

      List<PagedMessage> msgs = impl.read();

      Assert.assertEquals(numberOfElements, msgs.size());
View Full Code Here

      Assert.assertTrue(files.size() != 0);

      for (String file : files)
      {
         SequentialFile fileTmp = factory.createSequentialFile(file, 1);
         fileTmp.open();
         Assert.assertTrue("The page file size (" + fileTmp.size() + ") shouldn't be > " + MAX_SIZE,
                           fileTmp.size() <= MAX_SIZE);
         fileTmp.close();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.