Examples of AtomicLongArray


Examples of java.util.concurrent.atomic.AtomicLongArray

        // This is true for 1 byte = 128 streams, and therefore for any higher value
        assert maxIds % 64 == 0;

        // We use one bit in our array of longs to represent each stream ID.
        bits = new AtomicLongArray(maxIds / 64);

        // Initialize all bits to 1
        for (int i = 0; i < bits.length(); i++)
            bits.set(i, MAX_UNSIGNED_LONG);
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

     * Creates a new {@link UniformReservoir}.
     *
     * @param size the number of samples to keep in the sampling reservoir
     */
    public UniformReservoir(int size) {
        this.values = new AtomicLongArray(size);
        for (int i = 0; i < values.length(); i++) {
            values.set(i, 0);
        }
        count.set(0);
    }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

    }

    public EstimatedHistogram(int bucketCount)
    {
        makeOffsets(bucketCount);
        buckets = new AtomicLongArray(bucketOffsets.length + 1);
    }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

    public EstimatedHistogram(long[] offsets, long[] bucketData)
    {
        assert bucketData.length == offsets.length +1;
        bucketOffsets = offsets;
        buckets = new AtomicLongArray(bucketData);
    }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

      blurQuery.setUuid(UUID.randomUUID().toString());
    }

    OUTER: for (int retries = 0; retries < _maxDefaultRetries; retries++) {
      try {
        final AtomicLongArray facetCounts = BlurUtil.getAtomicLongArraySameLengthAsList(blurQuery.facets);

        BlurQuery original = new BlurQuery(blurQuery);

        BlurUtil.setStartTime(original);
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

   * with all elements initially zero.
   *
   * @param length the length of the array
   */
  public AtomicDoubleArray(int length) {
    this.longs = new AtomicLongArray(length);
  }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

    final int len = array.length;
    long[] longArray = new long[len];
    for (int i = 0; i < len; i++) {
      longArray[i] = doubleToRawLongBits(array[i]);
    }
    this.longs = new AtomicLongArray(longArray);
  }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

      throws java.io.IOException, ClassNotFoundException {
    s.defaultReadObject();

    // Read in array length and allocate array
    int length = s.readInt();
    this.longs = new AtomicLongArray(length);

    // Read in all elements in the proper order.
    for (int i = 0; i < length; i++) {
      set(i, s.readDouble());
    }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

  public static AtomicLongArray getAtomicLongArraySameLengthAsList(List<?> list) {
    if (list == null) {
      return null;
    }
    return new AtomicLongArray(list.size());
  }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicLongArray

    BooleanQuery f1 = new BooleanQuery();
    f1.add(new TermQuery(new Term(PERSON_NAME, NAME1)), Occur.MUST);
    f1.add(new TermQuery(new Term(PERSON_NAME, NAME2)), Occur.MUST);

    Query[] facets = new Query[] { new SuperQuery(f1, ScoreType.CONSTANT, new Term(PRIME_DOC, PRIME_DOC_VALUE)) };
    AtomicLongArray counts = new AtomicLongArray(facets.length);
    FacetQuery query = new FacetQuery(booleanQuery, facets, counts);

    TopDocs topDocs = searcher.search(query, 10);
    assertEquals(3, topDocs.totalHits);
    printTopDocs(topDocs);
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.