Package org.hornetq.core.journal

Examples of org.hornetq.core.journal.SequentialFile


   // Package protected ---------------------------------------------

   // This should be accessed from this package only
   void deleteLargeMessageFile(final LargeServerMessage largeServerMessage) throws HornetQException
   {
      final SequentialFile file = largeServerMessage.getFile();
      if (file == null)
      {
         return;
      }

      if (largeServerMessage.isDurable() && isReplicated())
      {
         readLock();
         try
         {
            if (isReplicated() && replicator.isSynchronizing())
            {
               synchronized (largeMessagesToDelete)
               {
                  largeMessagesToDelete.add(Long.valueOf(largeServerMessage.getMessageID()));
               }
               return;
            }
         }
         finally
         {
            readUnLock();
         }
      }
      Runnable deleteAction = new Runnable()
      {
         public void run()
         {
            try
            {
               readLock();
               try
               {
                  if (replicator != null)
                  {
                     replicator.largeMessageDelete(largeServerMessage.getMessageID());
                  }
                  file.delete();
               }
               finally
               {
                  readUnLock();
               }
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

   {
      if (!enabled)
      {
         return;
      }
      SequentialFile file = jf.getFile().cloneFile();
      try
      {
         HornetQServerLogger.LOGGER.journalSynch(jf, file.size(), file);
         sendLargeFile(content, null, jf.getFileID(), file, Long.MAX_VALUE);
      }
      finally
      {
         if (file.isOpen())
            file.close();
      }
   }
View Full Code Here

   }

   public boolean checkPageFileExists(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 Page(storeName, storageManager, fileFactory, file, pageNumber);

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

      file.position(0);

      file.close();

      return page;
   }
View Full Code Here

      lock.writeLock().lock();
      try
      {
         for (Integer id : pageIds)
         {
            SequentialFile sFile = fileFactory.createSequentialFile(createFileName(id), 1);
            if (!sFile.exists())
            {
               continue;
            }
            replicator.syncPages(sFile, id, getAddress());
         }
View Full Code Here

   }

   public boolean checkPageFileExists(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 Page(storeName, storageManager, fileFactory, file, pageNumber);

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

      file.position(0);

      file.close();

      return page;
   }
View Full Code Here

      lock.writeLock().lock();
      try
      {
         for (Integer id : pageIds)
         {
            SequentialFile sFile = fileFactory.createSequentialFile(createFileName(id), 1);
            if (!sFile.exists())
            {
               continue;
            }
            replicator.syncPages(sFile, id, getAddress());
         }
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.