Examples of HLL


Examples of net.agkn.hll.HLL

        final FileWriter output = openOutput(schemaVersion, "sparse_sparse", TestType.UNION);

        final Random random = new Random(SEED);

        // the accumulator, starts empty
        final HLL hll = newHLL(HLLType.EMPTY);
        final HLL emptyHLL = newHLL(HLLType.EMPTY);

        cumulativeUnionLine(output, hll, emptyHLL, schemaVersion);

        for(int i=0; i<SPARSE_THRESHOLD; i++) {
            // make a SPARSE set and populate with cardinality 1
            final HLL sparseHLL = newHLL(HLLType.SPARSE);
            final int registerIndex = Math.abs(random.nextInt()) % REGISTER_COUNT;
            final int registerValue = ((Math.abs(random.nextInt()) % REGISTER_MAX_VALUE) + 1);
            final long rawValue = constructHLLValue(LOG2M, registerIndex, registerValue);
            sparseHLL.addRaw(rawValue);

            cumulativeUnionLine(output, hll, sparseHLL, schemaVersion);
        }

        output.flush();
View Full Code Here

Examples of net.agkn.hll.HLL

        final FileWriter output = openOutput(schemaVersion, "probabilistic_probabilistic", TestType.UNION);

        final Random random = new Random(SEED);

        // the accumulator, starts empty
        final HLL hll = newHLL(HLLType.EMPTY);
        final HLL emptyHLL = newHLL(HLLType.EMPTY);
        cumulativeUnionLine(output, hll, emptyHLL, schemaVersion);

        for(int i=0; i<1000/*number of rows to generate*/; i++) {
            // make a FULL set and populate with
            final HLL fullHLL = newHLL(HLLType.FULL);
            final int elementCount = random.nextInt(10000/*arbitrary maximum cardinality*/);
            for(int j=0;j<elementCount;j++) {
                fullHLL.addRaw(random.nextLong());
            }

            cumulativeUnionLine(output, hll, fullHLL, schemaVersion);
        }

View Full Code Here

Examples of net.agkn.hll.HLL

        final FileWriter output = openOutput(schemaVersion, "comprehensive", TestType.UNION);

        final Random random = new Random(SEED);

        // the accumulator, starts empty
        final HLL hll = newHLL(HLLType.EMPTY);
        final HLL emptyHLL = newHLL(HLLType.EMPTY);

        cumulativeUnionLine(output, hll, emptyHLL, schemaVersion);

        for(int i=0; i<1000/*number of rows to generate*/; i++) {
            final HLL randomHLL = generateRandomHLL(random);
            cumulativeUnionLine(output, hll, randomHLL, schemaVersion);
        }

        output.flush();
        output.close();
View Full Code Here

Examples of net.agkn.hll.HLL

                break;
            default:
                throw new RuntimeException("We should never be here.");
        }

        final HLL hll = newHLL(HLLType.EMPTY);
        for(int i=0; i<cardinalityBaseline; i++) {
            hll.addRaw(random.nextLong());
        }
        for(int i=0; i<random.nextInt(cardinalityCap - cardinalityBaseline); i++) {
            hll.addRaw(random.nextLong());
        }

        return hll;
    }
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.