Package org.hornetq.core.journal

Examples of org.hornetq.core.journal.SequentialFile


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

      TestSupportPageStore storeImpl2 = new PagingStoreImpl(PagingStoreImplTest.destinationTestName,
                                                            null,
                                                            100,
View Full Code Here


      }
   }

   public boolean isFileExists() throws Exception
   {
      SequentialFile localfile = storageManager.createFileForLargeMessage(getMessageID(), durable);
      return localfile.exists();
   }
View Full Code Here

   @Override
   public synchronized ServerMessage copy()
   {
      long idToUse = messageID;

      SequentialFile newfile = storageManager.createFileForLargeMessage(idToUse, durable);

      ServerMessage newMessage = new LargeServerMessageImpl(this,
                                                            properties,
                                                            newfile,
                                                            messageID);
View Full Code Here

   {
      try
      {
         validateFile();
        
         SequentialFile file = this.file;
        
         SequentialFile newFile = storageManager.createFileForLargeMessage(newID, durable);
        
         file.copyTo(newFile);
        
         LargeServerMessageImpl newMessage = new LargeServerMessageImpl(this, properties, newFile, newID);
        
View Full Code Here

      if (fileFactory == null)
      {
         fileFactory = storeFactory.newFileFactory(getStoreName());
      }

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

      return page;
   }
View Full Code Here

   }
  
   public boolean checkPage(final int pageNumber)
   {
      String fileName = createFileName(pageNumber);
      SequentialFile file = fileFactory.createSequentialFile(fileName, 1);
      return file.exists();
   }
View Full Code Here

      if (fileFactory == null)
      {
         fileFactory = storeFactory.newFileFactory(getStoreName());
      }

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

      return page;
   }
View Full Code Here

      if (largeMessage.containsProperty(Message.HDR_ORIG_MESSAGE_ID))
      {
         // for compatibility: couple with old behaviour, copying the old file to avoid message loss
         long originalMessageID = largeMessage.getLongProperty(Message.HDR_ORIG_MESSAGE_ID);
        
         SequentialFile currentFile = createFileForLargeMessage(largeMessage.getMessageID(), true);
        
         if (!currentFile.exists())
         {
            SequentialFile linkedFile = createFileForLargeMessage(originalMessageID, true);
            if (linkedFile.exists())
            {
               linkedFile.copyTo(currentFile);
               linkedFile.close();
            }
         }
        
         currentFile.close();
      }
View Full Code Here

      if (largeMessagesFactory != null)
      {
         List<String> tmpFiles = largeMessagesFactory.listFiles("tmp");
         for (String tmpFile : tmpFiles)
         {
            SequentialFile file = largeMessagesFactory.createSequentialFile(tmpFile, -1);
            file.delete();
         }
      }
   }
View Full Code Here

    */
   private void performCachedLargeMessageDeletes()
   {
      for (Long largeMsgId : largeMessagesToDelete)
      {
         SequentialFile msg = createFileForLargeMessage(largeMsgId, LargeMessageExtension.DURABLE);
         try
         {
            msg.delete();
         }
         catch (Exception e)
         {
            HornetQServerLogger.LOGGER.journalErrorDeletingMessage(e, largeMsgId);
         }
View Full Code Here

TOP

Related Classes of org.hornetq.core.journal.SequentialFile

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.