Package com.browseengine.bobo.util

Examples of com.browseengine.bobo.util.BigNestedIntArray$Loader


    for (int id = 0; id < maxId; id += ((id >> 2) + 1)) {
      for (int val = 0; val < 3000; val += (id + 1)) {
        if (loader.add(id, val)) count[id]++;
      }
    }
    BigNestedIntArray nestedArray = new BigNestedIntArray();
    nestedArray.load(maxId, loader);

    int[] buf = new int[1024];
    for (int id = 0; id < maxId; id++) {
      int cnt = nestedArray.getData(id, buf);
      assertEquals("item count", count[id], cnt);

      if (cnt > 0) {
        int val = 0;
        for (int i = 0; i < cnt; i++) {
View Full Code Here


        int cnt = id % (maxNumItems[i] + 1);
        for (int val = 0; val < cnt; val++) {
          if (loader.add(id, val)) count[i][id]++;
        }
      }
      nestedArray[i] = new BigNestedIntArray();
      nestedArray[i].load(maxId, loader);

      loader.reset(maxId, BigNestedIntArray.MAX_ITEMS, buffer);
    }
View Full Code Here

    int[] maxNumItems = { 1, 1, 2, 2, 3, 3, 3, 3, 1, 1 };
    int[] minNumItems = { 1, 1, 0, 1, 0, 0, 2, 3, 1, 0 };
    int[] count = new int[maxId];
    BigIntBuffer buffer = new BigIntBuffer();
    BufferedLoader loader = null;
    BigNestedIntArray nestedArray = new BigNestedIntArray();
    Random rand = new Random();

    for (int i = 0; i < maxNumItems.length; i++) {
      loader = new BufferedLoader(maxId, BigNestedIntArray.MAX_ITEMS, buffer);
      for (int id = 0; id < maxId; id++) {
        count[id] = 0;
        int cnt = Math.max(rand.nextInt(maxNumItems[i] + 1), minNumItems[i]);
        for (int val = 0; val < cnt; val++) {
          if (loader.add(id, val)) count[id]++;
        }
      }

      nestedArray.load(maxId, loader);

      int[] buf = new int[1024];
      for (int id = 0; id < maxId; id++) {
        int cnt = nestedArray.getData(id, buf);
        assertEquals("count[" + i + "," + id + "]", count[id], cnt);

        if (cnt > 0) {
          for (int val = 0; val < cnt; val++) {
            assertEquals("item[" + i + "," + id + "," + val + "]", val, buf[val]);
View Full Code Here

      for (int id = 0; id < maxId; id++) {
        int cnt = id % (maxNumItems[i] + 1);
        loader.addSize(id, cnt);
        count[i][id] = cnt;
      }
      nestedArray[i] = new BigNestedIntArray();
      nestedArray[i].load(maxId, loader);
      loader.reset();

      for (int id = 0; id < maxId; id++) {
        for (int data = 0; data < count[i][id]; data++) {
View Full Code Here

      for (int id = 0; id < maxId; id++) {
        int cnt = id % 2000;
        loader.addSize(id, cnt);
        count[i][id] = cnt;
      }
      nestedArray[i] = new BigNestedIntArray();
      nestedArray[i].setMaxItems(maxNumItems[i]);
      nestedArray[i].load(maxId, loader);
      loader.reset();

      for (int id = 0; id < maxId; id++) {
View Full Code Here

      for (int i = 0; i < maxId - val; i++) {
        loader.add(i, val);
      }
    }

    BigNestedIntArray nestedArray = new BigNestedIntArray();
    nestedArray.load(maxId, loader);

    OpenBitSet filter = new OpenBitSet(numVals);
    for (int i = 0; i < numVals; i++) {
      if (i % 2 == 0) {
        filter.set(i);
      }
    }

    for (int i = 0; i < maxId; i++) {
      nestedArray.countNoReturnWithFilter(i, count, filter);
    }

    for (int i = 0; i < numVals; i++) {
      if (i % 2 == 0) {
        assertTrue(count[i] == maxId - i);
View Full Code Here

  public final BigNestedIntArray _weightArray;

  public MultiValueWithWeightFacetDataCache() {
    super();
    _weightArray = new BigNestedIntArray();
  }
View Full Code Here

  protected int _maxItems = BigNestedIntArray.MAX_ITEMS;
  protected boolean _overflow = false;

  public MultiValueFacetDataCache() {
    super();
    _nestedArray = new BigNestedIntArray();
  }
View Full Code Here

  public final BigNestedIntArray _weightArray;

  public MultiValueWithWeightFacetDataCache()
  {
    super();
    _weightArray = new BigNestedIntArray();
  }
View Full Code Here

    return new FacetCountCollectorSource() {

      @Override
      public FacetCountCollector getFacetCountCollector(BoboIndexReader reader, int docBase) {
        MultiValueFacetDataCache dataCache = getFacetData(reader);
        final BigNestedIntArray _nestedArray = dataCache._nestedArray;
        return new RangeFacetCountCollector(_name, dataCache, docBase, ospec, _predefinedRanges) {
          public void collect(int docid) {
            _nestedArray.countNoReturn(docid, _count);
          }
        };
      }
    };
  }
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.util.BigNestedIntArray$Loader

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.