Package org.apache.cassandra.contrib.stress

Examples of org.apache.cassandra.contrib.stress.Session


     * Gauss key generator
     * @return byte[] representation of the key string
     */
    private static byte[] generateGaussKey()
    {
        Session session = Stress.session;
        String format = "%0" + session.getTotalKeysLength() + "d";

        for (;;)
        {
            double token = nextGaussian(session.getMean(), session.getSigma());

            if (0 <= token && token < session.getNumKeys())
            {
                return String.format(format, (int) token).getBytes(UTF_8);
            }
        }
    }
View Full Code Here


     * Gauss key generator
     * @return byte[] representation of the key string
     */
    private static byte[] generateGaussKey()
    {
        Session session = Stress.session;
        String format = "%0" + session.getTotalKeysLength() + "d";

        for (;;)
        {
            double token = nextGaussian(session.getMean(), session.getSigma());

            if (0 <= token && token < session.getNumKeys())
            {
                return String.format(format, (int) token).getBytes();
            }
        }
    }
View Full Code Here

     * Gauss key generator
     * @return byte[] representation of the key string
     */
    private static byte[] generateGaussKey()
    {
        Session session = Stress.session;
        String format = "%0" + session.getTotalKeysLength() + "d";

        for (;;)
        {
            double token = nextGaussian(session.getMean(), session.getSigma());

            if (0 <= token && token < session.getNumKeys())
            {
                return String.format(format, (int) token).getBytes();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.contrib.stress.Session

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.