3535@ State (Scope .Benchmark )
3636public class MixedWorkload extends BenchmarkBase {
3737 private static final Logger LOGGER = LoggerFactory .getLogger (MixedWorkload .class );
38+ private static final int LIMIT = 10000 ;
3839
3940 private ClickHouseClient clientV1Shared ;
4041 private Client clientV2Shared ;
@@ -56,12 +57,6 @@ public void tearDownTrial() {
5657 }
5758 }
5859
59- // @State(Scope.Thread)
60- // public static class MixedWorkloadState {
61- // @Param({"true", "false"})
62- // public boolean alternate;
63- // }
64-
6560
6661 @ TearDown (Level .Iteration )
6762 public void teardownIteration (DataState dataState ) {
@@ -124,7 +119,7 @@ public void insertV1RowBinary(DataState dataState) {
124119 public void queryV1 (DataState dataState , Blackhole blackhole ) {
125120 try {
126121 try (ClickHouseResponse response = clientV1Shared .read (getServer ())
127- .query (BenchmarkRunner .getSelectQuery (dataState .tableNameFilled ))
122+ .query (BenchmarkRunner .getSelectQueryWithLimit (dataState .tableNameFilled , LIMIT ))
128123 .format (ClickHouseFormat .RowBinaryWithNamesAndTypes )
129124 .option (ClickHouseClientOption .ASYNC , false )
130125 .executeAndWait ()) {
@@ -190,7 +185,7 @@ public void insertV2RowBinary(DataState dataState) {
190185 @ Group ("mixed_v2" )
191186 public void queryV2 (DataState dataState , Blackhole blackhole ) {
192187 try {
193- try (QueryResponse response = clientV2Shared .query (BenchmarkRunner .getSelectQuery (dataState .tableNameFilled )).get ()) {
188+ try (QueryResponse response = clientV2Shared .query (BenchmarkRunner .getSelectQueryWithLimit (dataState .tableNameFilled , LIMIT )).get ()) {
194189 ClickHouseBinaryFormatReader reader = clientV2Shared .newBinaryFormatReader (response );
195190 while (reader .next () != null ) {//Compiler optimization avoidance
196191 for (int i = 1 ; i <= dataState .dataSet .getSchema ().getColumns ().size (); i ++) {
0 commit comments