Skip to content

Commit

Permalink
Force usage of ReadAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
o-shevchenko committed Jan 7, 2025
1 parent 4061922 commit 705c07c
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ public class ConnImplBenchmark {
public void setUp() throws IOException {
java.util.logging.Logger.getGlobal().setLevel(Level.ALL);

connectionSettingsReadAPIEnabled = ConnectionSettings.newBuilder().setUseReadAPI(true).build();
connectionSettingsReadAPIDisabled =
ConnectionSettings.newBuilder().setUseReadAPI(false).build();
connectionSettingsReadAPIEnabled = ConnectionSettings.newBuilder()
.setUseReadAPI(true)
.setMaxResults(500L)
.setJobTimeoutMs(Long.MAX_VALUE)
.build();
connectionSettingsReadAPIDisabled = ConnectionSettings.newBuilder()
.setUseReadAPI(false)
.build();
}

@Benchmark
Expand Down Expand Up @@ -153,8 +158,8 @@ private long getResultHash(BigQueryResult bigQueryResultSet) throws SQLException
System.out.println("\n Running");
while (rs.next()) {
hash += computeHash(rs, "vendor_id", ResultSet::getString);
hash += computeHash(rs, "pickup_datetime", ResultSet::getString);
hash += computeHash(rs, "dropoff_datetime", ResultSet::getString);
hash += computeHash(rs, "pickup_datetime", ResultSet::getLong);
hash += computeHash(rs, "dropoff_datetime", ResultSet::getLong);
hash += computeHash(rs, "passenger_count", ResultSet::getLong);
hash += computeHash(rs, "trip_distance", ResultSet::getDouble);
hash += computeHash(rs, "rate_code", ResultSet::getString);
Expand Down

0 comments on commit 705c07c

Please sign in to comment.