Package com.oltpbenchmark.distributions

Examples of com.oltpbenchmark.distributions.ZipfianGenerator


        final PreparedStatement followersInsert = this.conn.prepareStatement(SQLUtil.getInsertSQL(catalog_tbl));

        int total = 1;
        int batchSize = 0;
       
        ZipfianGenerator zipfFollowee = new ZipfianGenerator(this.num_users,1.75);
        ZipfianGenerator zipfFollows = new ZipfianGenerator(this.num_follows,1.75);
        List<Integer> followees = new ArrayList<Integer>();
        for (int follower = 0; follower < this.num_users; follower++) {
            followees.clear();
            int time = zipfFollows.nextInt();
            if(time==0) time=1; // At least this follower will follow 1 user
            for (int f = 0; f < time; ) {
                int followee = zipfFollowee.nextInt();
                if (follower != followee && !followees.contains(followee)) {
                    followsInsert.setInt(1, follower);
View Full Code Here


        assert (catalog_tbl != null);
        String sql = SQLUtil.getInsertSQL(catalog_tbl);
        PreparedStatement reviewInsert = this.conn.prepareStatement(sql);
       
        //
        ZipfianGenerator numReviews = new ZipfianGenerator(num_reviews, 1.8);
        ZipfianGenerator reviewer = new ZipfianGenerator(num_users);
        int total = 0;
        int batch = 0;
        for (int i = 0; i < num_items; i++) {
            List<Integer> reviewers = new ArrayList<Integer>();
            int review_count = numReviews.nextInt();
            if (review_count == 0)
                review_count = 1; // make sure at least each item has a review
            for (int rc = 0; rc < review_count;) {
                int u_id = reviewer.nextInt();
                if (!reviewers.contains(u_id)) {
                    rc++;
                    reviewInsert.setInt(1, total);
                    reviewInsert.setInt(2, u_id);
                    reviewInsert.setInt(3, i);
View Full Code Here

        PreparedStatement trustInsert = this.conn.prepareStatement(sql);
       
        //
        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);
View Full Code Here

    private final Map<Integer, String> m = new HashMap<Integer, String>();
   
    public YCSBWorker(int id, BenchmarkModule benchmarkModule, int init_record_count) {
        super(benchmarkModule, id);
        readRecord = new ZipfianGenerator(init_record_count);// pool for read keys
        randScan = new ZipfianGenerator(YCSBConstants.MAX_SCAN);
       
        synchronized (YCSBWorker.class) {
            // We must know where to start inserting
            if (insertRecord == null) {
                insertRecord = new CounterGenerator(init_record_count);
View Full Code Here

TOP

Related Classes of com.oltpbenchmark.distributions.ZipfianGenerator

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.