Package com.oltpbenchmark.distributions

Examples of com.oltpbenchmark.distributions.ScrambledZipfianGenerator


        String sql = SQLUtil.getInsertSQL(catalog_tbl);
        PreparedStatement tweetInsert = this.conn.prepareStatement(sql);
       
        int total = 0;
        int batchSize = 0;
        ScrambledZipfianGenerator zy = new ScrambledZipfianGenerator(this.num_users);
       
        TweetHistogram tweet_h = new TweetHistogram();
        FlatHistogram<Integer> tweet_len_rng = new FlatHistogram<Integer>(this.rng(), tweet_h);
       
        for (long i = 0; i < this.num_tweets; i++) {
            int uid = zy.nextInt();
            tweetInsert.setLong(1, i);
            tweetInsert.setInt(2, uid);
            tweetInsert.setString(3, TextGenerator.randomStr(rng(), tweet_len_rng.nextValue()));
            tweetInsert.setNull(4, java.sql.Types.DATE);
            tweetInsert.addBatch();
View Full Code Here


       
        //
        int total = 0;
        int batch = 0;
        ZipfianGenerator numTrust = new ZipfianGenerator(num_trust, 1.95);
        ScrambledZipfianGenerator reviewed = new ScrambledZipfianGenerator(num_users);
        Random isTrusted = new Random(System.currentTimeMillis());
        for (int i = 0; i < num_users; i++) {
            List<Integer> trusted = new ArrayList<Integer>();
            int trust_count = numTrust.nextInt();
            for (int tc = 0; tc < trust_count;) {
                int u_id = reviewed.nextInt();
                if (!trusted.contains(u_id)) {
                    tc++;
                    trustInsert.setInt(1, i);
                    trustInsert.setInt(2, u_id);
                    trustInsert.setInt(3, isTrusted.nextInt(2));
View Full Code Here

TOP

Related Classes of com.oltpbenchmark.distributions.ScrambledZipfianGenerator

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.