Package com.pearson.entech.elasticsearch.search.facet.approx.date.internal

Examples of com.pearson.entech.elasticsearch.search.facet.approx.date.internal.DistinctCountPayload.update()


                final DistinctCountPayload count = getSafely(_counts, time, unsafeSlice);
                while(distinctIter.hasNext()) {
                    final BytesRef unsafeTerm = distinctIter.next();
                    // Unsafe because the BytesRef may be changed if we continue reading,
                    // but the counter only needs to read it once immediately, so that's OK
                    count.update(unsafeTerm);
                }
            }
        }
    }
View Full Code Here


        testSerializingNonEmptyDistinctFacet(0, 999);
    }

    private void testSerializingNonEmptyDistinctFacet(final int threshold1, final int threshold2) throws Exception {
        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold2);
        payload2.update(new BytesRef("bart"));
        payload2.update(new BytesRef("lisa"));
        final ExtTLongObjectHashMap<DistinctCountPayload> counts = CacheRecycler.popLongObjectMap();
View Full Code Here

    }

    private void testSerializingNonEmptyDistinctFacet(final int threshold1, final int threshold2) throws Exception {
        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold2);
        payload2.update(new BytesRef("bart"));
        payload2.update(new BytesRef("lisa"));
        final ExtTLongObjectHashMap<DistinctCountPayload> counts = CacheRecycler.popLongObjectMap();
        counts.put(1, payload1);
View Full Code Here

    private void testSerializingNonEmptyDistinctFacet(final int threshold1, final int threshold2) throws Exception {
        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold2);
        payload2.update(new BytesRef("bart"));
        payload2.update(new BytesRef("lisa"));
        final ExtTLongObjectHashMap<DistinctCountPayload> counts = CacheRecycler.popLongObjectMap();
        counts.put(1, payload1);
        counts.put(2, payload2);
        final Map<Long, Integer> expectedCounts = newHashMap();
View Full Code Here

        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold2);
        payload2.update(new BytesRef("bart"));
        payload2.update(new BytesRef("lisa"));
        final ExtTLongObjectHashMap<DistinctCountPayload> counts = CacheRecycler.popLongObjectMap();
        counts.put(1, payload1);
        counts.put(2, payload2);
        final Map<Long, Integer> expectedCounts = newHashMap();
        expectedCounts.put(1l, 2);
View Full Code Here

        final ExtTLongObjectHashMap<ExtTHashMap<BytesRef, DistinctCountPayload>> counts = CacheRecycler.popLongObjectMap();
        final BytesRef label1 = new BytesRef("itchy");
        final BytesRef label2 = new BytesRef("scratchy");
        final ExtTHashMap<BytesRef, DistinctCountPayload> period1 = CacheRecycler.popHashMap();
        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold1);
        payload2.update(new BytesRef("marge"));
        payload2.update(new BytesRef("marge"));
        period1.put(label1, payload1);
View Full Code Here

        final BytesRef label1 = new BytesRef("itchy");
        final BytesRef label2 = new BytesRef("scratchy");
        final ExtTHashMap<BytesRef, DistinctCountPayload> period1 = CacheRecycler.popHashMap();
        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold1);
        payload2.update(new BytesRef("marge"));
        payload2.update(new BytesRef("marge"));
        period1.put(label1, payload1);
        period1.put(label2, payload2);
View Full Code Here

        final ExtTHashMap<BytesRef, DistinctCountPayload> period1 = CacheRecycler.popHashMap();
        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold1);
        payload2.update(new BytesRef("marge"));
        payload2.update(new BytesRef("marge"));
        period1.put(label1, payload1);
        period1.put(label2, payload2);
        counts.put(1, period1);
        final ExtTHashMap<BytesRef, DistinctCountPayload> period2 = CacheRecycler.popHashMap();
View Full Code Here

        final DistinctCountPayload payload1 = new DistinctCountPayload(threshold1);
        payload1.update(new BytesRef("marge"));
        payload1.update(new BytesRef("homer"));
        final DistinctCountPayload payload2 = new DistinctCountPayload(threshold1);
        payload2.update(new BytesRef("marge"));
        payload2.update(new BytesRef("marge"));
        period1.put(label1, payload1);
        period1.put(label2, payload2);
        counts.put(1, period1);
        final ExtTHashMap<BytesRef, DistinctCountPayload> period2 = CacheRecycler.popHashMap();
        final DistinctCountPayload payload3 = new DistinctCountPayload(threshold2);
View Full Code Here

        period1.put(label1, payload1);
        period1.put(label2, payload2);
        counts.put(1, period1);
        final ExtTHashMap<BytesRef, DistinctCountPayload> period2 = CacheRecycler.popHashMap();
        final DistinctCountPayload payload3 = new DistinctCountPayload(threshold2);
        payload3.update(new BytesRef("bart"));
        payload3.update(new BytesRef("lisa"));
        final DistinctCountPayload payload4 = new DistinctCountPayload(threshold2);
        payload4.update(new BytesRef("bart"));
        payload4.update(new BytesRef("bart"));
        period2.put(label1, payload3);
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.