Package com.facebook.presto.jdbc.internal.airlift.slice

Examples of com.facebook.presto.jdbc.internal.airlift.slice.BasicSliceInput


        overflows = new short[0];
    }

    public SparseHll(Slice serialized)
    {
        BasicSliceInput input = serialized.getInput();

        checkArgument(input.readByte() == Format.SPARSE_V1.getTag(), "invalid format tag");

        indexBitLength = input.readByte();
        checkArgument(indexBitLength >= 1 && indexBitLength <= 13, "indexBitLength is out of range");

        numberOfHashes = input.readShort();
        numberOfOverflows = input.readShort();

        shortHashes = new short[numberOfHashes];
        for (int i = 0; i < numberOfHashes; i++) {
            shortHashes[i] = input.readShort();
        }

        overflows = new short[numberOfOverflows];
        for (int i = 0; i < numberOfOverflows; i++) {
            overflows[i] = input.readShort();
        }

        checkArgument(!input.isReadable(), "input is too big");
    }
View Full Code Here


        deltas = new byte[numberOfBuckets * BITS_PER_BUCKET / Byte.SIZE];
    }

    public DenseHll(Slice serialized)
    {
        BasicSliceInput input = serialized.getInput();

        checkArgument(input.readByte() == Format.DENSE_V1.getTag(), "invalid format tag");

        indexBitLength = input.readByte();
        checkArgument(indexBitLength >= 1 && indexBitLength <= Short.SIZE, "indexBitLength is out of range");

        baseline = input.readByte();
        deltas = new byte[numberOfBuckets(indexBitLength) / 2];
        input.readBytes(deltas);
        overflowBucket = input.readShort();
        overflowValue = input.readByte();

        baselineCount = 0;
        for (int i = 0; i < numberOfBuckets(indexBitLength); i++) {
            if (getDelta(i) == 0) {
                baselineCount++;
            }
        }

        checkArgument(!input.isReadable(), "input is too big");
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.jdbc.internal.airlift.slice.BasicSliceInput

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.