Examples of OERandom


Examples of org.apache.derbyTesting.system.oe.util.OERandom

    private final OERandom rand;
    private final short w = 1;
   
    public OperationsTester(String name) {
        super(name);
        this.rand = new OERandom(-1, -1, -1);
    }
View Full Code Here

Examples of org.apache.derbyTesting.system.oe.util.OERandom

        }
        conn.commit();
        s.execute("CREATE TABLE C(CLOAD INT, CLAST INT, CID INT, CITEM INT)");
        conn.commit();

        random = new OERandom(-1, -1, -1, seed);

        // Section 2.1.6.1 of TPC-C spec
        int loadRandomFactor = random.randomInt(0, 255);
        s.execute("INSERT INTO C VALUES(" + loadRandomFactor + ", -1, -1, -1)");
        s.close();
View Full Code Here

Examples of org.apache.derbyTesting.system.oe.util.OERandom

        Statement s = conn.createStatement();
        ResultSet rs = s.executeQuery("SELECT CLOAD FROM C");
        rs.next();
        int loadRandomFactor = rs.getInt(1);
        rs.close();
        random = new OERandom(loadRandomFactor, -1, -1, seed);
        s.close();
        conn.commit();
    }
View Full Code Here

Examples of org.apache.derbyTesting.system.oe.util.OERandom

     * @throws SQLException
     */
    public static OERandom getRuntimeRandom(Connection conn)
        throws SQLException
    {
        OERandom rand = new OERandom(-1);
       
        ResultSet rs = conn.createStatement().executeQuery(
                "SELECT CLOAD FROM C");
        rs.next();
        int cload = rs.getInt(1);
        rs.close();
       
        for (;;)
        {
            int c = rand.randomInt(0, 255);
            int delta = Math.abs(cload - c);
            if (delta == 96 || delta == 112)
                continue;
            if (delta < 65 || delta > 119)
                continue;
           
            rand = new OERandom(c);
            break;
        }
       
        return rand;
    }
View Full Code Here

Examples of org.apache.derbyTesting.system.oe.util.OERandom

        }
        conn.commit();
        s.execute("CREATE TABLE C(CLOAD INT)");
        conn.commit();

        random = new OERandom(-1, seed);

        // Section 2.1.6.1 of TPC-C spec
        int loadRandomFactor = random.randomInt(0, 255);
        s.execute("INSERT INTO C VALUES(" + loadRandomFactor + ")");
        s.close();
View Full Code Here

Examples of org.apache.derbyTesting.system.oe.util.OERandom

        Statement s = conn.createStatement();
        ResultSet rs = s.executeQuery("SELECT CLOAD FROM C");
        rs.next();
        int loadRandomFactor = rs.getInt(1);
        rs.close();
        random = new OERandom(loadRandomFactor, seed);
        s.close();
        conn.commit();
    }
View Full Code Here

Examples of org.apache.derbyTesting.system.oe.util.OERandom

     * @throws SQLException
     */
    public static OERandom getRuntimeRandom(Connection conn)
        throws SQLException
    {
        OERandom rand = new OERandom(-1);
       
        ResultSet rs = conn.createStatement().executeQuery(
                "SELECT CLOAD FROM C");
        rs.next();
        int cload = rs.getInt(1);
        rs.close();
       
        for (;;)
        {
            int c = rand.randomInt(0, 255);
            int delta = Math.abs(cload - c);
            if (delta == 96 || delta == 112)
                continue;
            if (delta < 65 || delta > 119)
                continue;
           
            rand = new OERandom(c);
            break;
        }
       
        return rand;
    }
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.