Package org.apache.solr.util

Examples of org.apache.solr.util.OpenBitSet


  }


  public HashDocSet getRandomHashDocset(int maxSetSize, int maxDoc) {
    int n = rand.nextInt(maxSetSize);
    OpenBitSet obs = new OpenBitSet(maxDoc);
    int[] a = new int[n];
    for (int i=0; i<n; i++) {
      for(;;) {
        int idx = rand.nextInt(maxDoc);
        if (obs.getAndSet(idx)) continue;
        a[i]=idx;
        break;
      }
    }
    return loadfactor!=0 ? new HashDocSet(a,0,n,1/loadfactor) : new HashDocSet(a,0,n);
View Full Code Here

TOP

Related Classes of org.apache.solr.util.OpenBitSet

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.