Package net.timewalker.ffmq3.storage.data

Examples of net.timewalker.ffmq3.storage.data.LinkedDataStore.first()


    LinkedDataStore store = createStore(storeId, new File("target/test"));
    for (int i = 0; i < 100; i++)
    {
      for (int j = 0; j < 10; j++)
      {
        int previous = store.first();
        previous = store.store(data, previous);
        if (previous == -1)
                  throw new IllegalStateException("No space left !");
      }
      store.commitChanges();
View Full Code Here


                  throw new IllegalStateException("No space left !");
      }
      store.commitChanges();
      for (int j = 0; j < 10; j++)
      {
        store.delete(store.first());
      }
      store.commitChanges();
    }
    assertEquals(0, store.size());
    store.close();
View Full Code Here

        }
        assertEquals(MSG_COUNT, store.size());
        store.commitChanges();
       
        int count = 0;
        int current = store.first();
        while (current != -1)
        {
            /*Object data = */store.retrieve(current);
            //System.out.println(data);
            current = store.next(current);
View Full Code Here

        }
        assertEquals(MSG_COUNT, count);
       
        // Delete half entries
        count = 0;
        current = store.first();
        while (current != -1)
        {
            int next = store.next(current);
            if (next != -1)
                next = store.next(next);
View Full Code Here

        assertEquals(MSG_COUNT, store.size());
       
        //System.out.println(store);
       
        count = 0;
        current = store.first();
        while (current != -1)
        {
            /*Object data = */store.retrieve(current);
            //System.out.println(data);
            current = store.next(current);
View Full Code Here

   
    assertOrdered(msgStore);
   
    // Delete half the queue
    int count = 0;
    int current = msgStore.first();
    while (current != -1 && count < (msgCount/2))
    {
      int next = msgStore.next(current);
      msgStore.delete(current);
      count++;
View Full Code Here

    }
    assertEquals(10, msgStore.size());
   
    assertOrdered(msgStore);
   
    int current = msgStore.first();
    for(int n=0;n<5;n++)
      current = msgStore.next(current);
    Message removedMsg = msgStore.retrieve(current);
    msgStore.delete(current);
    msgStore.commitChanges();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.