public Query inflate()

in harry-core/src/harry/operations/QueryGenerator.java [98:140]


    public Query inflate(long lts, long modifier, Query.QueryKind queryKind)
    {
        long pd = pdSelector.pd(lts, schema);
        long descriptor = rng.next(modifier, lts);
        boolean reverse = descriptor % 2 == 0;
        switch (queryKind)
        {
            case SINGLE_PARTITION:
                return singlePartition(pd, reverse);
            case SINGLE_CLUSTERING:
            {
                long cd = descriptorSelector.randomCd(pd, descriptor, schema);
                return singleClustering(pd, cd, reverse);
            }
            case CLUSTERING_SLICE:
            {
                long cd = descriptorSelector.randomCd(pd, descriptor, schema);
                try
                {
                    return clusteringSliceQuery(pd, cd, descriptor, reverse);
                }
                catch (IllegalArgumentException retry)
                {
                    return inflate(lts, modifier + 1, queryKind);
                }
            }
            case CLUSTERING_RANGE:
            {
                try
                {
                    long cd1 = descriptorSelector.randomCd(pd, descriptor, schema);
                    long cd2 = descriptorSelector.randomCd(pd, rng.next(descriptor, lts), schema);
                    return clusteringRangeQuery(pd, cd1, cd2, descriptor, reverse);
                }
                catch (IllegalArgumentException retry)
                {
                    return inflate(lts, modifier + 1, queryKind);
                }
            }
            default:
                throw new IllegalArgumentException("Shouldn't happen");
        }
    }