Package org.hornetq.core.paging.impl

Examples of org.hornetq.core.paging.impl.Page


   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


   private Page getPage(final SimpleString storeName, final int pageId) throws Exception
   {
      ConcurrentMap<Integer, Page> map = getPageMap(storeName);

      Page page = map.get(pageId);

      if (page == null)
      {
         page = newPage(pageId, storeName, map);
      }
View Full Code Here

    */
   private synchronized Page newPage(final int pageId,
                                     final SimpleString storeName,
                                     final ConcurrentMap<Integer, Page> map) throws Exception
   {
      Page page = map.get(pageId);

      if (page == null)
      {
         page = pageManager.getPageStore(storeName).createPage(pageId);
         page.open();
         map.put(pageId, page);
      }

      return page;
   }
View Full Code Here

            int pageId = (int) pageStore.getFirstPage();
            for (int i = 0; i < pageStore.getNumberOfPages(); i++)
            {
               HornetQServerLogger.LOGGER.debug("Reading page " + pageId);
               Page page = pageStore.createPage(pageId);
               page.open();
               List<PagedMessage> messages = page.read(sm);
               page.close();

               int messageId = 0;

               for (PagedMessage message : messages)
               {
View Full Code Here

         {
            PageCursorInfo info = entry.getValue();

            if (info.isDone() && !info.isPendingDelete())
            {
               Page currentPage = pageStore.getCurrentPage();

               if (currentPage != null && entry.getKey() == pageStore.getCurrentPage().getPageId() &&
                  currentPage.isLive())
               {
                  HornetQServerLogger.LOGGER.trace("We can't clear page " + entry.getKey() +
                     " now since it's the current page");
               }
               else
View Full Code Here

         // Reading is done outside of the synchronized block, however
         // the page stays locked until the entire reading is finished
         if (needToRead)
         {
            Page page = null;
            try
            {
               page = pagingStore.createPage((int)pageId);

               storageManager.beforePageRead();
               page.open();

               List<PagedMessage> pgdMessages = page.read(storageManager);
               cache.setMessages(pgdMessages.toArray(new PagedMessage[pgdMessages.size()]));
            }
            finally
            {
               try
               {
                  if (page != null)
                  {
                     page.close();
                  }
               }
               catch (Throwable ignored)
               {
               }
View Full Code Here

                        " is leaving page mode as all messages are consumed and acknowledged from the page store");
                  }

                  pagingStore.forceAnotherPage();

                  Page currentPage = pagingStore.getCurrentPage();

                  storeBookmark(cursorList, currentPage);

                  pagingStore.stopPaging();
               }
            }

            for (long i = pagingStore.getFirstPage(); i < minPage; i++)
            {
               Page page = pagingStore.depage();
               if (page == null)
               {
                  break;
               }
               depagedPages.add(page);
View Full Code Here

            int pageId = (int)pageStore.getFirstPage();
            for (int i = 0; i < pageStore.getNumberOfPages(); i++)
            {
               HornetQServerLogger.LOGGER.debug("Reading page " + pageId);
               Page page = pageStore.createPage(pageId);
               page.open();
               List<PagedMessage> messages = page.read(storageManager);
               page.close();

               int messageId = 0;

               for (PagedMessage message : messages)
               {
View Full Code Here

            int pageId = (int) pageStore.getFirstPage();
            for (int i = 0; i < pageStore.getNumberOfPages(); i++)
            {
               HornetQServerLogger.LOGGER.debug("Reading page " + pageId);
               Page page = pageStore.createPage(pageId);
               page.open();
               List<PagedMessage> messages = page.read(sm);
               page.close();

               int messageId = 0;

               for (PagedMessage message : messages)
               {
View Full Code Here

         {
            PageCursorInfo info = entry.getValue();

            if (info.isDone() && !info.isPendingDelete())
            {
               Page currentPage = pageStore.getCurrentPage();

               if (currentPage != null && entry.getKey() == pageStore.getCurrentPage().getPageId() &&
                  currentPage.isLive())
               {
                  HornetQServerLogger.LOGGER.trace("We can't clear page " + entry.getKey() +
                                                      " now since it's the current page");
               }
               else
View Full Code Here

TOP

Related Classes of org.hornetq.core.paging.impl.Page

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.