@@ -1045,7 +1045,6 @@ Thread runNextPageTaskAsync(
10451045 // This thread makes the RPC calls and paginates
10461046 Runnable nextPageTask =
10471047 () -> {
1048- int retryCount = 0 ;
10491048 String currentPageToken = firstPageToken ;
10501049 TableResult currentResults = result ;
10511050 TableId destinationTable = null ;
@@ -1062,40 +1061,21 @@ Thread runNextPageTaskAsync(
10621061 break ;
10631062 }
10641063
1065- try {
1066- long startTime = System .nanoTime ();
1067- currentResults =
1068- this .bigQuery .listTableData (
1069- destinationTable ,
1070- TableDataListOption .pageSize (querySettings .getMaxResultPerPage ()),
1071- TableDataListOption .pageToken (currentPageToken ));
1072-
1073- currentPageToken = currentResults .getNextPageToken ();
1074- // this will be parsed asynchronously without blocking the current
1075- // thread
1076- rpcResponseQueue .put (Tuple .of (currentResults , true ));
1077- LOG .fine (
1078- "Fetched %d results from the server in %d ms." ,
1079- querySettings .getMaxResultPerPage (),
1080- (int ) ((System .nanoTime () - startTime ) / 1000000 ));
1081- } catch (com .google .cloud .bigquery .BigQueryException ex ) {
1082- if (ex .getCode () == 404 ) {
1083- throw ex ;
1084- }
1085- if (retryCount >= MAX_RETRY_COUNT ) {
1086- throw new BigQueryJdbcRuntimeException (ex ); // Re-throw max retries exceeded
1087- }
1088- retryCount ++;
1089- LOG .info (
1090- "Connection interrupted during json stream read, retrying. attempt: %d" ,
1091- retryCount );
1092- Thread .sleep (RETRY_DELAY_MS );
1093- } catch (InterruptedException ex ) {
1094- Thread .currentThread ().interrupt ();
1095- throw new BigQueryJdbcRuntimeException (ex );
1096- } catch (Exception ex ) {
1097- throw new BigQueryJdbcRuntimeException (ex );
1098- }
1064+ long startTime = System .nanoTime ();
1065+ currentResults =
1066+ this .bigQuery .listTableData (
1067+ destinationTable ,
1068+ TableDataListOption .pageSize (querySettings .getMaxResultPerPage ()),
1069+ TableDataListOption .pageToken (currentPageToken ));
1070+
1071+ currentPageToken = currentResults .getNextPageToken ();
1072+ // this will be parsed asynchronously without blocking the current
1073+ // thread
1074+ rpcResponseQueue .put (Tuple .of (currentResults , true ));
1075+ LOG .fine (
1076+ "Fetched %d results from the server in %d ms." ,
1077+ querySettings .getMaxResultPerPage (),
1078+ (int ) ((System .nanoTime () - startTime ) / 1000000 ));
10991079 }
11001080 } catch (Exception ex ) {
11011081 try {
0 commit comments