Examples of LazyBigIntArray


Examples of com.browseengine.bobo.util.LazyBigIntArray

      for (int i = 0; i < _subcollectors.length; ++i) {
        _lens[i] = _subcollectors[i]._countlength;
        totalLen *= _lens[i];
      }
      _countlength = totalLen;
      _count = new LazyBigIntArray(_countlength);
      _maxdoc = maxdoc;
    }
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

    _spec = fspec;
    _predefinedRanges = new TermStringList();
    Collections.sort(predefinedRanges);
    _predefinedRanges.addAll(predefinedRanges);
    _countlength = predefinedRanges.size();
    _count = new LazyBigIntArray(_countlength);
    _ranges = new GeoRange[predefinedRanges.size()];
    int index = 0;
    for (String range : predefinedRanges) {
      _ranges[index++] = parse(range);
    }
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

   */
  @Override
  public BigSegmentedArray getCountDistribution() {
    BigSegmentedArray dist = null;
    if (_predefinedRanges != null) {
      dist = new LazyBigIntArray(_predefinedRanges.size());
      int distIdx = 0;
      for (int i = 0; i < _count.size(); i++) {
        int count = _count.get(i);
        dist.add(distIdx++, count);
      }
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

      _ospec = ospec;
      _isAggregated = false;
      _start = start;
      _end = end;
      _unit = unit;
      _count = new LazyBigIntArray(countArraySize());
    }
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

    _sel = sel;
    _name = name;
    _dataCache = dataCache;
    _sep = sep;
    _sepArray = sep.toCharArray();
    _count = new LazyBigIntArray(_dataCache.freqs.length);
    log.info(name + ": " + _count.size());
    _orderArray = _dataCache.orderArray;
    _minHitCount = ospec.getMinHitCount();
    _maxCount = ospec.getMaxCount();
    if (_maxCount < 1) {
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

    _bucketValues.seal();
  }

  private BigSegmentedArray getCollapsedCounts() {
    if (_collapsedCounts == null) {
      _collapsedCounts = new LazyBigIntArray(_bucketValues.size());
      FacetDataCache<?> dataCache = _subCollector._dataCache;
      TermValueList<?> subList = dataCache.valArray;
      BigSegmentedArray subcounts = _subCollector._count;
      FixedBitSet indexSet = new FixedBitSet(subcounts.size());
      int c = 0;
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

    _name = name;
    _dataCache = dataCache;
    _countlength = _dataCache.freqs.length;

    if (_dataCache.freqs.length <= 3096) {
      _count = new LazyBigIntArray(_countlength);
    } else {
      _count = intarraymgr.get(_countlength);
      intarraylist.add(_count);
    }
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

  public RangeFacetCountCollector(String name, FacetDataCache<?> dataCache, int docBase,
      FacetSpec ospec, List<String> predefinedRanges) {
    _name = name;
    _dataCache = dataCache;
    _countlength = _dataCache.freqs.length;
    _count = new LazyBigIntArray(_countlength);
    _array = _dataCache.orderArray;
    _ospec = ospec;
    if (predefinedRanges != null) {
      _predefinedRanges = new TermStringList();
      Collections.sort(predefinedRanges);
View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

   */
  @Override
  public BigSegmentedArray getCountDistribution() {
    BigSegmentedArray dist;
    if (_predefinedRangeIndexes != null) {
      dist = new LazyBigIntArray(_predefinedRangeIndexes.length);
      int n = 0;
      for (int[] range : _predefinedRangeIndexes) {
        int start = range[0];
        int end = range[1];

View Full Code Here

Examples of com.browseengine.bobo.util.LazyBigIntArray

      if (_predefinedRangeIndexes != null) {
        int minCount = _ospec.getMinHitCount();
        int maxNumOfFacets = _ospec.getMaxCount();
        if (maxNumOfFacets <= 0 || maxNumOfFacets > _predefinedRangeIndexes.length) maxNumOfFacets = _predefinedRangeIndexes.length;

        BigSegmentedArray rangeCount = new LazyBigIntArray(_predefinedRangeIndexes.length);

        for (int k = 0; k < _predefinedRangeIndexes.length; ++k) {
          int count = 0;
          int idx = _predefinedRangeIndexes[k][0];
          int end = _predefinedRangeIndexes[k][1];
          while (idx <= end) {
            count += _count.get(idx++);
          }
          rangeCount.add(k, count);
        }

        List<BrowseFacet> facetColl;
        FacetSortSpec sortspec = _ospec.getOrderBy();
        if (sortspec == FacetSortSpec.OrderValueAsc) {
          facetColl = new ArrayList<BrowseFacet>(maxNumOfFacets);
          for (int k = 0; k < _predefinedRangeIndexes.length; ++k) {
            if (rangeCount.get(k) >= minCount) {
              BrowseFacet choice = new BrowseFacet(_predefinedRanges.get(k), rangeCount.get(k));
              facetColl.add(choice);
            }
            if (facetColl.size() >= maxNumOfFacets) break;
          }
        } else // if (sortspec == FacetSortSpec.OrderHitsDesc)
        {
          ComparatorFactory comparatorFactory;
          if (sortspec == FacetSortSpec.OrderHitsDesc) {
            comparatorFactory = new FacetHitcountComparatorFactory();
          } else {
            comparatorFactory = _ospec.getCustomComparatorFactory();
          }

          if (comparatorFactory == null) {
            throw new IllegalArgumentException("facet comparator factory not specified");
          }

          final IntComparator comparator = comparatorFactory.newComparator(
            new FieldValueAccessor() {
              @Override
              public String getFormatedValue(int index) {
                return _predefinedRanges.get(index);
              }

              @Override
              public Object getRawValue(int index) {
                return _predefinedRanges.getRawValue(index);
              }
            }, rangeCount);

          final int forbidden = -1;
          IntBoundedPriorityQueue pq = new IntBoundedPriorityQueue(comparator, maxNumOfFacets,
              forbidden);
          for (int i = 0; i < _predefinedRangeIndexes.length; ++i) {
            if (rangeCount.get(i) >= minCount) pq.offer(i);
          }

          int val;
          facetColl = new LinkedList<BrowseFacet>();
          while ((val = pq.pollInt()) != forbidden) {
            BrowseFacet facet = new BrowseFacet(_predefinedRanges.get(val), rangeCount.get(val));
            ((LinkedList<BrowseFacet>) facetColl).addFirst(facet);
          }
        }
        return facetColl;
      } else {
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.