Package org.apache.cassandra.stress.generate.values

Examples of org.apache.cassandra.stress.generate.values.Generator


    void setSeed(Seed seed)
    {
        long idseed = 0;
        for (int i = 0 ; i < partitionKey.length ; i++)
        {
            Generator generator = this.generator.partitionKey.get(i);
            // set the partition key seed based on the current work item we're processing
            generator.setSeed(seed.seed);
            Object key = generator.generate();
            partitionKey[i] = key;
            // then contribute this value to the data seed
            idseed = seed(key, generator.type, idseed);
        }
        this.seed = seed;
View Full Code Here


        {
            if (done)
                return Collections.emptyList();
            for (int i = 0 ; i < row.row.length ; i++)
            {
                Generator gen = generator.valueComponents.get(i);
                gen.setSeed(idseed);
                row.row[i] = gen.generate();
            }
            done = true;
            return Collections.singleton(row);
        }
View Full Code Here

        // generate the clustering components for the provided depth; requires preceding components
        // to have been generated and their seeds populated into clusteringSeeds
        void fill(int depth)
        {
            long seed = clusteringSeeds[depth - 1];
            Generator gen = generator.clusteringComponents.get(depth);
            gen.setSeed(seed);
            clusteringSeeds[depth] = seed(clusteringComponents[depth - 1].peek(), generator.clusteringComponents.get(depth - 1).type, seed);
            fill(clusteringComponents[depth], (int) gen.clusteringDistribution.next(), gen);
        }
View Full Code Here

            long rowSeed = seed(clusteringComponents[depth].peek(), generator.clusteringComponents.get(depth).type, parentSeed);

            // and then fill the row with the _non-clustering_ values for the position we _were_ at, as this is what we'll deliver
            for (int i = clusteringSeeds.length ; i < row.row.length ; i++)
            {
                Generator gen = generator.valueComponents.get(i - clusteringSeeds.length);
                gen.setSeed(rowSeed);
                row.row[i] = gen.generate();
            }
            returnedOne = true;
            forceReturnOne = false;

            // then we advance the leaf level
View Full Code Here

    void setSeed(long seed)
    {
        long idseed = 0;
        for (int i = 0 ; i < partitionKey.length ; i++)
        {
            Generator generator = this.generator.partitionKey.get(i);
            // set the partition key seed based on the current work item we're processing
            generator.setSeed(seed);
            Object key = generator.generate();
            partitionKey[i] = key;
            // then contribute this value to the data seed
            idseed = seed(key, generator.type, idseed);
        }
        this.idseed = idseed;
View Full Code Here

        {
            if (done)
                return Collections.emptyList();
            for (int i = 0 ; i < row.row.length ; i++)
            {
                Generator gen = generator.valueComponents.get(i);
                gen.setSeed(idseed);
                row.row[i] = gen.generate();
            }
            done = true;
            return Collections.singleton(row);
        }
View Full Code Here

        }

        void fill(int component)
        {
            long seed = clusteringSeeds[component - 1];
            Generator gen = generator.clusteringComponents.get(component);
            gen.setSeed(seed);
            clusteringSeeds[component] = seed(clusteringComponents[component - 1].peek(), generator.clusteringComponents.get(component - 1).type, seed);
            fill(clusteringComponents[component], (int) gen.clusteringDistribution.next(), gen);
        }
View Full Code Here

            // we always start at the leaf level
            int depth = clusteringComponents.length - 1;
            // fill the row with the position we *were* at (unless pre-start)
            for (int i = clusteringSeeds.length ; i < row.row.length ; i++)
            {
                Generator gen = generator.valueComponents.get(i - clusteringSeeds.length);
                long seed = clusteringSeeds[depth];
                seed = seed(clusteringComponents[depth].peek(), generator.clusteringComponents.get(depth).type, seed);
                gen.setSeed(seed);
                row.row[i] = gen.generate();
            }
            clusteringComponents[depth].poll();

            return advance(depth, continueChance);
        }
View Full Code Here

    void setSeed(long seed)
    {
        long idseed = 0;
        for (int i = 0 ; i < partitionKey.length ; i++)
        {
            Generator generator = this.generator.partitionKey.get(i);
            // set the partition key seed based on the current work item we're processing
            generator.setSeed(seed);
            Object key = generator.generate();
            partitionKey[i] = key;
            // then contribute this value to the data seed
            idseed = seed(key, generator.type, idseed);
        }
        this.idseed = idseed;
View Full Code Here

        {
            if (done)
                return Collections.emptyList();
            for (int i = 0 ; i < row.row.length ; i++)
            {
                Generator gen = generator.valueComponents.get(i);
                gen.setSeed(idseed);
                row.row[i] = gen.generate();
            }
            done = true;
            return Collections.singleton(row);
        }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.stress.generate.values.Generator

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.