Package org.hornetq.core.journal

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


   public void testWriteandRead() throws Exception
   {
      SequentialFile sf = factory.createSequentialFile("write.hq", 1);

      sf.open();

      String s1 = "aardvark";
      byte[] bytes1 = s1.getBytes("UTF-8");
      HornetQBuffer bb1 = wrapBuffer(bytes1);
View Full Code Here


   public void testPosition() throws Exception
   {
      SequentialFile sf = factory.createSequentialFile("position.hq", 1);

      sf.open();

      try
      {

         sf.fill(0, 3 * 512, (byte)0);
View Full Code Here

   public void testOpenClose() throws Exception
   {
      SequentialFile sf = factory.createSequentialFile("openclose.hq", 1);

      sf.open();

      sf.fill(0, 512, (byte)0);

      String s1 = "cheesecake";
      byte[] bytes1 = s1.getBytes("UTF-8");
View Full Code Here

      }
      catch (Exception e)
      {
      }

      sf.open();

      sf.write(wrapBuffer(bytes1), true);

      sf.close();
   }
View Full Code Here

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

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

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

      file.position(0);

      file.close();
View Full Code Here

      String tmpFileName = fileName + ".tmp";

      SequentialFile sequentialFile = fileFactory.createSequentialFile(tmpFileName, maxAIO);

      sequentialFile.open(1, false);

      if (init)
      {
         sequentialFile.fill(0, fileSize, JournalImpl.FILL_CHARACTER);
View Full Code Here

      if (keepOpened)
      {
         if (multiAIO)
         {
            sequentialFile.open();
         }
         else
         {
            sequentialFile.open(1, false);
         }
View Full Code Here

         {
            sequentialFile.open();
         }
         else
         {
            sequentialFile.open(1, false);
         }
         sequentialFile.position(position);
      }

      return new JournalFileImpl(sequentialFile, fileID, JournalImpl.FORMAT_VERSION);
View Full Code Here

   {
      long newFileID = generateFileID();

      SequentialFile sf = file.getFile();

      sf.open(1, false);

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

      JournalFile jf = new JournalFileImpl(sf, newFileID, JournalImpl.FORMAT_VERSION);
View Full Code Here

         return;
      }

      if (!channel1.isOpen())
      {
         channel1.open(1, false);
      }
      channel1.writeDirect(ByteBuffer.wrap(data), true);
   }

   /**
 
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.