Package org.hornetq.core.paging.cursor.impl

Examples of org.hornetq.core.paging.cursor.impl.PagePositionImpl


      public void decode(HornetQBuffer buffer)
      {
         queueID = buffer.readLong();
         long pageNR = buffer.readLong();
         int messageNR = buffer.readInt();
         this.position = new PagePositionImpl(pageNR, messageNR);
      }
View Full Code Here


                  message.initMessage(sm);
                  long queueIDs[] = message.getQueueIDs();
                  List<String> queueNames = new ArrayList<String>();
                  for (long queueID : queueIDs)
                  {
                     PagePosition posCheck = new PagePositionImpl(pageId, messageId);

                     boolean acked = false;

                     Set<PagePosition> positions = cursorRecords.get(queueID);
                     if (positions != null)
View Full Code Here

         this.position = position;
      }

      public CursorAckRecordEncoding()
      {
         this.position = new PagePositionImpl();
      }
View Full Code Here

      public void decode(HornetQBuffer buffer)
      {
         queueID = buffer.readLong();
         long pageNR = buffer.readLong();
         int messageNR = buffer.readInt();
         this.position = new PagePositionImpl(pageNR, messageNR);
      }
View Full Code Here

                                                                         server.getExecutorFactory(),
                                                                         5);

      for (int i = 0; i < numberOfPages; i++)
      {
         PageCache cache = cursorProvider.getPageCache(new PagePositionImpl(i + 1, 0));
         System.out.println("Page " + i + " had " + cache.getNumberOfMessages() + " messages");

      }

      forceGC();
View Full Code Here

      System.out.println("NumberOfPages = " + numberOfPages);

      PageCursorProvider cursorProvider = lookupCursorProvider();

      PageCache cache = cursorProvider.getPageCache(new PagePositionImpl(2, 0));

      assertNull(cache);
   }
View Full Code Here

      PageSubscription cursor = this.server.getPagingManager()
                                           .getPageStore(ADDRESS)
                                           .getCursorProvier()
                                           .getSubscription(queue.getID());

      PageCache firstPage = cursorProvider.getPageCache(new PagePositionImpl(server.getPagingManager()
                                                                                   .getPageStore(ADDRESS)
                                                                                   .getFirstPage(), 0));

      int firstPageSize = firstPage.getNumberOfMessages();
View Full Code Here

      PagedReference msg;
      LinkedListIterator<PagedReference> iterator = cursor.iterator();
      LinkedListIterator<PagedReference> iterator2 = cursor2.iterator();
     
      cursor2.bookmark(new PagePositionImpl(1, -1));

      int key = 0;
      while ((msg = iterator.next()) != null)
      {
         System.out.println("key = " + key);
View Full Code Here

      int numberOfPages = addMessages(NUM_MESSAGES, 1024 * 1024);

      System.out.println("NumberOfPages = " + numberOfPages);

      PageCache cache = cursorProvider.getPageCache(new PagePositionImpl(5, 0));

      queue.getPageSubscription().close();

      PagePosition startingPos = new PagePositionImpl(5, cache.getNumberOfMessages() / 2);
      cursor.bookmark(startingPos);
      PagedMessage msg = cache.getMessage(startingPos.getMessageNr() + 1);
      msg.initMessage(server.getStorageManager());
      int key = msg.getMessage().getIntProperty("key").intValue();

      msg = null;

View Full Code Here

      System.out.println("NumberOfPages = " + numberOfPages);

      PageCursorProvider cursorProvider = lookupCursorProvider();

      PageCache cache = cursorProvider.getPageCache(new PagePositionImpl(5, 0));

      PageSubscription cursor = cursorProvider.getSubscription(queue.getID());
      PagePosition startingPos = new PagePositionImpl(5, cache.getNumberOfMessages() / 2);
      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;
View Full Code Here

TOP

Related Classes of org.hornetq.core.paging.cursor.impl.PagePositionImpl

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.