Examples of chooseForLoad()


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

    int nlinks = 50;
    HashMap<Long, Integer> seen = new HashMap<Long, Integer>();

    long id1 = 1234;
    for (int i = 0; i < nlinks; i++) {
      long id2 = c.chooseForLoad(rng, id1, LinkStore.DEFAULT_LINK_TYPE, i);
      Integer j = seen.get(id2);
      if (j != null) {
        fail("Same link generated twice: (" + id1 + ", " + id2 + ") for " +
            " indices " + j + " and " + i);
      }
View Full Code Here

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

    ID2Chooser chooser = new ID2Chooser(props, minid, maxid, 1, 0);
    for (int id1 = minid; id1 < maxid; id1 += 3763) {
      HashSet<Long> existing = new HashSet<Long>();
      long nlinks = chooser.calcTotalLinkCount(id1);
      for (long i = 0; i < nlinks; i++) {
        long id2 = chooser.chooseForLoad(rng, id1,
                                LinkStore.DEFAULT_LINK_TYPE, i);
        existing.add(id2);
      }

      int trials = 10000;
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.