Package org.hornetq.core.journal

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


      // Add more 10 as they will need to be ignored
      addPageElements(simpleDestination, impl, 10);

      // Damage data... position the file on the middle between points A and B
      file.position(positionA + (positionB - positionA) / 2);

      ByteBuffer buffer = ByteBuffer.allocate((int)(positionB - file.position()));

      for (int i = 0; i < buffer.capacity(); i++)
      {
View Full Code Here


      addPageElements(simpleDestination, impl, 10);

      // Damage data... position the file on the middle between points A and B
      file.position(positionA + (positionB - positionA) / 2);

      ByteBuffer buffer = ByteBuffer.allocate((int)(positionB - file.position()));

      for (int i = 0; i < buffer.capacity(); i++)
      {
         buffer.put((byte)'Z');
      }
View Full Code Here

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

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

      file.position(0);

      file.close();

      return page;
   }
View Full Code Here

      ArrayList<HornetQBuffer> buffers = addPageElements(simpleDestination, impl, numberOfElements);

      impl.sync();

      long positionA = file.position();

      // Add one record that will be damaged
      addPageElements(simpleDestination, impl, 1);

      long positionB = file.position();
View Full Code Here

      long positionA = file.position();

      // Add one record that will be damaged
      addPageElements(simpleDestination, impl, 1);

      long positionB = file.position();

      // Add more 10 as they will need to be ignored
      addPageElements(simpleDestination, impl, 10);

      // Damage data... position the file on the middle between points A and B
View Full Code Here

      // Add more 10 as they will need to be ignored
      addPageElements(simpleDestination, impl, 10);

      // Damage data... position the file on the middle between points A and B
      file.position(positionA + (positionB - positionA) / 2);

      ByteBuffer buffer = ByteBuffer.allocate((int)(positionB - file.position()));

      for (int i = 0; i < buffer.capacity(); i++)
      {
View Full Code Here

      addPageElements(simpleDestination, impl, 10);

      // Damage data... position the file on the middle between points A and B
      file.position(positionA + (positionB - positionA) / 2);

      ByteBuffer buffer = ByteBuffer.allocate((int)(positionB - file.position()));

      for (int i = 0; i < buffer.capacity(); i++)
      {
         buffer.put((byte)'Z');
      }
View Full Code Here

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

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

      file.position(0);

      file.close();

      return page;
   }
View Full Code Here

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

      file.open();

      file.position(0);

      file.close();

      return new PageImpl(storeName, storageManager, fileFactory, file, page);
   }
View Full Code Here

      int position = initFileHeader(this.fileFactory, sf, userVersion, newFileID);

      JournalFile jf = new JournalFileImpl(sf, newFileID);

      sf.position(position);

      sf.close();

      return jf;
   }
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.