23
23
import com .oltpbenchmark .api .Worker ;
24
24
import com .oltpbenchmark .benchmarks .ycsb .procedures .*;
25
25
import com .oltpbenchmark .distributions .CounterGenerator ;
26
+ import com .oltpbenchmark .distributions .UniformGenerator ;
26
27
import com .oltpbenchmark .distributions .ZipfianGenerator ;
27
28
import com .oltpbenchmark .types .TransactionStatus ;
28
29
import com .oltpbenchmark .util .TextGenerator ;
@@ -39,7 +40,7 @@ class YCSBWorker extends Worker<YCSBBenchmark> {
39
40
40
41
private final ZipfianGenerator readRecord ;
41
42
private static CounterGenerator insertRecord ;
42
- private final ZipfianGenerator randScan ;
43
+ private final UniformGenerator randScan ;
43
44
44
45
private final char [] data ;
45
46
private final String [] params = new String [YCSBConstants .NUM_FIELDS ];
@@ -58,7 +59,7 @@ public YCSBWorker(YCSBBenchmark benchmarkModule, int id, int init_record_count)
58
59
this .readRecord =
59
60
new ZipfianGenerator (
60
61
rng (), init_record_count , benchmarkModule .skewFactor ); // pool for read keys
61
- this .randScan = new ZipfianGenerator ( rng () , YCSBConstants .MAX_SCAN , benchmarkModule . skewFactor );
62
+ this .randScan = new UniformGenerator ( 1 , YCSBConstants .MAX_SCAN );
62
63
63
64
synchronized (YCSBWorker .class ) {
64
65
// We must know where to start inserting
@@ -100,41 +101,35 @@ protected TransactionStatus executeWork(Connection conn, TransactionType nextTra
100
101
}
101
102
102
103
private void updateRecord (Connection conn ) throws SQLException {
103
-
104
104
int keyname = readRecord .nextInt ();
105
105
this .buildParameters ();
106
106
this .procUpdateRecord .run (conn , keyname , this .params );
107
107
}
108
108
109
109
private void scanRecord (Connection conn ) throws SQLException {
110
-
111
110
int keyname = readRecord .nextInt ();
112
111
int count = randScan .nextInt ();
113
112
this .procScanRecord .run (conn , keyname , count , new ArrayList <>());
114
113
}
115
114
116
115
private void readRecord (Connection conn ) throws SQLException {
117
-
118
116
int keyname = readRecord .nextInt ();
119
117
this .procReadRecord .run (conn , keyname , this .results );
120
118
}
121
119
122
120
private void readModifyWriteRecord (Connection conn ) throws SQLException {
123
-
124
121
int keyname = readRecord .nextInt ();
125
122
this .buildParameters ();
126
123
this .procReadModifyWriteRecord .run (conn , keyname , this .params , this .results );
127
124
}
128
125
129
126
private void insertRecord (Connection conn ) throws SQLException {
130
-
131
127
int keyname = insertRecord .nextInt ();
132
128
this .buildParameters ();
133
129
this .procInsertRecord .run (conn , keyname , this .params );
134
130
}
135
131
136
132
private void deleteRecord (Connection conn ) throws SQLException {
137
-
138
133
int keyname = readRecord .nextInt ();
139
134
this .procDeleteRecord .run (conn , keyname );
140
135
}
0 commit comments