Package net.timewalker.ffmq3.storage.data.impl

Examples of net.timewalker.ffmq3.storage.data.impl.InMemoryLinkedDataStore.first()


   
    for (int i = 0; i < 500; 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();
    }
   
    store.close();
View Full Code Here

   
    for (int i = 0; i < 500; 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();
    }
   
    store.close();
View Full Code Here

    store = createStore(storeId, new File("target/test"));

    //System.out.println(store);
    int count = 0;
    int current = store.first();
    while (current != -1)
    {
      store.retrieve(current);
      current = store.next(current);
      count++;
View Full Code Here

    // -------------------------------------------------------------------
    // Delete half the messages

    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(msgCount, store.size());

    System.out.println(store);
   
    count = 0;
    current = store.first();
    while (current != -1)
    {
      store.retrieve(current);
      current = store.next(current);
      count++;
View Full Code Here

    store = createStore(storeId, new File("target/test"));
    assertEquals(msgCount, store.size());

    count = 0;
    startTime = System.currentTimeMillis();
    current = store.first();
    while (current != -1)
    {
      int next = store.next(current);
      store.delete(current);
      current = next;
View Full Code Here

    store.commitChanges();
    endTime = System.currentTimeMillis();
    System.out.println("Deletion time " + (endTime - startTime) + " ms");
    assertEquals(msgCount, count);
    assertEquals(0, store.size());
    assertEquals(-1, store.first());

    store.close();

    // -------------------------------------------------------------------
    // Reload store
View Full Code Here

    // -------------------------------------------------------------------
    // Reload store

    store = createStore(storeId, new File("target/test"));
    assertEquals(0, store.size());
    assertEquals(-1, store.first());

    store.close();
  }
}
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.