Examples of chooseForOp()


Examples of com.facebook.LinkBench.distributions.ID2Chooser.chooseForOp()

    long min = 500;
    long max = n + min;
    int trials = 1000;
    ID2Chooser c = new ID2Chooser(props, min, max, 1, 1);
    for (int i = 0; i < trials; i++) {
      long id2 = c.chooseForOp(rng, i + min, LinkStore.DEFAULT_LINK_TYPE, 1.0);
      assert(id2 >= min);

      id2 = c.chooseForOp(rng, i + min, LinkStore.DEFAULT_LINK_TYPE, 0.5);
      assert(id2 >= min);
    }
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ID2Chooser.chooseForOp()

    ID2Chooser c = new ID2Chooser(props, min, max, 1, 1);
    for (int i = 0; i < trials; i++) {
      long id2 = c.chooseForOp(rng, i + min, LinkStore.DEFAULT_LINK_TYPE, 1.0);
      assert(id2 >= min);

      id2 = c.chooseForOp(rng, i + min, LinkStore.DEFAULT_LINK_TYPE, 0.5);
      assert(id2 >= min);
    }
  }

  /**
 
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ID2Chooser.chooseForOp()

      int hit = 0; // hit for prob = 50%

      for (int i = 0; i < trials; i++) {
        // Test with 100% prob of hit
        long id2 = chooser.chooseForOp(rng, id1,
                                          LinkStore.DEFAULT_LINK_TYPE, 1.0);
        assertTrue(existing.contains(id2) || existing.size() == 0);

        // Test with 50% prob of hit
        id2 = chooser.chooseForOp(rng, id1, LinkStore.DEFAULT_LINK_TYPE, 0.5);
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ID2Chooser.chooseForOp()

        long id2 = chooser.chooseForOp(rng, id1,
                                          LinkStore.DEFAULT_LINK_TYPE, 1.0);
        assertTrue(existing.contains(id2) || existing.size() == 0);

        // Test with 50% prob of hit
        id2 = chooser.chooseForOp(rng, id1, LinkStore.DEFAULT_LINK_TYPE, 0.5);
        if (existing.contains(id2)) {
          hit++;
        }
      }
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.