Package org.hornetq.core.paging

Examples of org.hornetq.core.paging.PagedMessage


      cursor.bookmark(startingPos);

      // We can't proceed until the operation has finished
      server.getStorageManager().waitOnOperations();
     
      PagedMessage msg = cache.getMessage(startingPos.getMessageNr() + 1);
      msg.initMessage(server.getStorageManager());
      int initialKey = msg.getMessage().getIntProperty("key").intValue();
      int key = initialKey;

      msg = null;

      cache = null;
View Full Code Here


         SimpleString dummy = new SimpleString("dummy");
         msg.setAddress(dummy);

         replicatedJournal.appendAddRecordTransactional(23, 24, (byte)1, new FakeData());

         PagedMessage pgmsg = new PagedMessageImpl(msg, new long[0]);
         manager.pageWrite(pgmsg, 1);
         manager.pageWrite(pgmsg, 2);
         manager.pageWrite(pgmsg, 3);
         manager.pageWrite(pgmsg, 4);
View Full Code Here

         // it will be null in the case of the current writing page
         return null;
      }
      else
      {
         PagedMessage serverMessage = cache.getMessage(retPos.getMessageNr());

         if (serverMessage != null)
         {
            return cursorProvider.newReference(retPos, serverMessage, this);
         }
View Full Code Here

         {
            return null;
         }
      }

      PagedMessage serverMessage = cache.getMessage(retPos.getMessageNr());

      if (serverMessage != null)
      {
         return cursorProvider.newReference(retPos, serverMessage, this);
      }
View Full Code Here

            // This will force everything to be persisted
            message.bodyChanged();
         }


         PagedMessage pagedMessage = new PagedMessageImpl(message, routeQueues(tx, listCtx), tx == null ? -1 : tx.getID());

         int bytesToWrite = pagedMessage.getEncodeSize() + PageImpl.SIZE_RECORD;

         if (currentPageSize.addAndGet(bytesToWrite) > pageSize && currentPage.getNumberOfMessages() > 0)
         {
            // Make sure nothing is currently validating or using currentPage
            openNewPage();
View Full Code Here

      return getPagedMessage().getMessage();
   }

   public synchronized PagedMessage getPagedMessage()
   {
      PagedMessage returnMessage = message != null ? message.get() : null;
     
      // We only keep a few references on the Queue from paging...
      // Besides those references are SoftReferenced on page cache...
      // So, this will unlikely be null,
      // unless the Queue has stalled for some time after paging
View Full Code Here

         {
            return null;
         }
      }

      PagedMessage serverMessage = cache.getMessage(retPos.getMessageNr());

      if (serverMessage != null)
      {
         return cursorProvider.newReference(retPos, serverMessage, this);
      }
View Full Code Here

         SimpleString dummy = new SimpleString("dummy");
         msg.setAddress(dummy);

         replicatedJournal.appendAddRecordTransactional(23, 24, (byte)1, new FakeData());

         PagedMessage pgmsg = new PagedMessageImpl(msg, new long[0]);
         manager.pageWrite(pgmsg, 1);
         manager.pageWrite(pgmsg, 2);
         manager.pageWrite(pgmsg, 3);
         manager.pageWrite(pgmsg, 4);
View Full Code Here

   /**
    * @param packet
    */
   private void handlePageWrite(final ReplicationPageWriteMessage packet) throws Exception
   {
      PagedMessage pgdMessage = packet.getPagedMessage();
      pgdMessage.initMessage(storage);
      ServerMessage msg = pgdMessage.getMessage();
      Page page = getPage(msg.getAddress(), packet.getPageNumber());
      page.write(pgdMessage);
   }
View Full Code Here

               // This will force everything to be persisted
               message.bodyChanged();
            }

            final long transactionID = tx == null ? -1 : tx.getID();
            PagedMessage pagedMessage = new PagedMessageImpl(message, routeQueues(tx, listCtx), transactionID);

            if (message.isLargeMessage())
            {
               ((LargeServerMessage)message).setPaged();
            }

            int bytesToWrite = pagedMessage.getEncodeSize() + Page.SIZE_RECORD;

            if (currentPageSize.addAndGet(bytesToWrite) > pageSize && currentPage.getNumberOfMessages() > 0)
            {
               // Make sure nothing is currently validating or using currentPage
               openNewPage();
View Full Code Here

TOP

Related Classes of org.hornetq.core.paging.PagedMessage

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.