|
23 | 23 | import com.google.api.core.BetaApi; |
24 | 24 | import com.google.api.core.InternalApi; |
25 | 25 | import com.google.api.gax.paging.Page; |
| 26 | +import com.google.api.gax.retrying.ResultRetryAlgorithm; |
26 | 27 | import com.google.api.services.bigquery.model.ErrorProto; |
27 | 28 | import com.google.api.services.bigquery.model.GetQueryResultsResponse; |
28 | 29 | import com.google.api.services.bigquery.model.QueryRequest; |
@@ -592,7 +593,7 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException |
592 | 593 | } |
593 | 594 | }, |
594 | 595 | getOptions().getRetrySettings(), |
595 | | - getOptions().getResultRetryAlgorithm(), |
| 596 | + getHttpRetryAlgorithm(), |
596 | 597 | getOptions().getClock(), |
597 | 598 | EMPTY_RETRY_CONFIG, |
598 | 599 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -658,7 +659,7 @@ private static Page<Dataset> listDatasets( |
658 | 659 | } |
659 | 660 | }, |
660 | 661 | serviceOptions.getRetrySettings(), |
661 | | - serviceOptions.getResultRetryAlgorithm(), |
| 662 | + BigQueryRetryHelper.getHttpRetryAlgorithm(serviceOptions.getResultRetryAlgorithm()), |
662 | 663 | serviceOptions.getClock(), |
663 | 664 | EMPTY_RETRY_CONFIG, |
664 | 665 | serviceOptions.isOpenTelemetryTracingEnabled(), |
@@ -710,7 +711,7 @@ public Boolean call() throws IOException { |
710 | 711 | } |
711 | 712 | }, |
712 | 713 | getOptions().getRetrySettings(), |
713 | | - getOptions().getResultRetryAlgorithm(), |
| 714 | + getHttpRetryAlgorithm(), |
714 | 715 | getOptions().getClock(), |
715 | 716 | EMPTY_RETRY_CONFIG, |
716 | 717 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -761,7 +762,7 @@ public Boolean call() throws IOException { |
761 | 762 | } |
762 | 763 | }, |
763 | 764 | getOptions().getRetrySettings(), |
764 | | - getOptions().getResultRetryAlgorithm(), |
| 765 | + getHttpRetryAlgorithm(), |
765 | 766 | getOptions().getClock(), |
766 | 767 | EMPTY_RETRY_CONFIG, |
767 | 768 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -807,7 +808,7 @@ public Boolean call() throws IOException { |
807 | 808 | } |
808 | 809 | }, |
809 | 810 | getOptions().getRetrySettings(), |
810 | | - getOptions().getResultRetryAlgorithm(), |
| 811 | + getHttpRetryAlgorithm(), |
811 | 812 | getOptions().getClock(), |
812 | 813 | EMPTY_RETRY_CONFIG, |
813 | 814 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -853,7 +854,7 @@ public Boolean call() throws IOException { |
853 | 854 | } |
854 | 855 | }, |
855 | 856 | getOptions().getRetrySettings(), |
856 | | - getOptions().getResultRetryAlgorithm(), |
| 857 | + getHttpRetryAlgorithm(), |
857 | 858 | getOptions().getClock(), |
858 | 859 | EMPTY_RETRY_CONFIG, |
859 | 860 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -897,7 +898,7 @@ public Boolean call() throws IOException { |
897 | 898 | } |
898 | 899 | }, |
899 | 900 | getOptions().getRetrySettings(), |
900 | | - getOptions().getResultRetryAlgorithm(), |
| 901 | + getHttpRetryAlgorithm(), |
901 | 902 | getOptions().getClock(), |
902 | 903 | EMPTY_RETRY_CONFIG, |
903 | 904 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -938,7 +939,7 @@ public com.google.api.services.bigquery.model.Dataset call() throws IOException |
938 | 939 | } |
939 | 940 | }, |
940 | 941 | getOptions().getRetrySettings(), |
941 | | - getOptions().getResultRetryAlgorithm(), |
| 942 | + getHttpRetryAlgorithm(), |
942 | 943 | getOptions().getClock(), |
943 | 944 | EMPTY_RETRY_CONFIG, |
944 | 945 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -985,7 +986,7 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { |
985 | 986 | } |
986 | 987 | }, |
987 | 988 | getOptions().getRetrySettings(), |
988 | | - getOptions().getResultRetryAlgorithm(), |
| 989 | + getHttpRetryAlgorithm(), |
989 | 990 | getOptions().getClock(), |
990 | 991 | EMPTY_RETRY_CONFIG, |
991 | 992 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1031,7 +1032,7 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { |
1031 | 1032 | } |
1032 | 1033 | }, |
1033 | 1034 | getOptions().getRetrySettings(), |
1034 | | - getOptions().getResultRetryAlgorithm(), |
| 1035 | + getHttpRetryAlgorithm(), |
1035 | 1036 | getOptions().getClock(), |
1036 | 1037 | EMPTY_RETRY_CONFIG, |
1037 | 1038 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1077,7 +1078,7 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException |
1077 | 1078 | } |
1078 | 1079 | }, |
1079 | 1080 | getOptions().getRetrySettings(), |
1080 | | - getOptions().getResultRetryAlgorithm(), |
| 1081 | + getHttpRetryAlgorithm(), |
1081 | 1082 | getOptions().getClock(), |
1082 | 1083 | EMPTY_RETRY_CONFIG, |
1083 | 1084 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1131,7 +1132,7 @@ public com.google.api.services.bigquery.model.Table call() throws IOException { |
1131 | 1132 | } |
1132 | 1133 | }, |
1133 | 1134 | getOptions().getRetrySettings(), |
1134 | | - getOptions().getResultRetryAlgorithm(), |
| 1135 | + getHttpRetryAlgorithm(), |
1135 | 1136 | getOptions().getClock(), |
1136 | 1137 | EMPTY_RETRY_CONFIG, |
1137 | 1138 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1190,7 +1191,7 @@ public com.google.api.services.bigquery.model.Model call() throws IOException { |
1190 | 1191 | } |
1191 | 1192 | }, |
1192 | 1193 | getOptions().getRetrySettings(), |
1193 | | - getOptions().getResultRetryAlgorithm(), |
| 1194 | + getHttpRetryAlgorithm(), |
1194 | 1195 | getOptions().getClock(), |
1195 | 1196 | EMPTY_RETRY_CONFIG, |
1196 | 1197 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1249,7 +1250,7 @@ public com.google.api.services.bigquery.model.Routine call() throws IOException |
1249 | 1250 | } |
1250 | 1251 | }, |
1251 | 1252 | getOptions().getRetrySettings(), |
1252 | | - getOptions().getResultRetryAlgorithm(), |
| 1253 | + getHttpRetryAlgorithm(), |
1253 | 1254 | getOptions().getClock(), |
1254 | 1255 | EMPTY_RETRY_CONFIG, |
1255 | 1256 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1467,7 +1468,7 @@ public Tuple<String, Iterable<com.google.api.services.bigquery.model.Table>> cal |
1467 | 1468 | } |
1468 | 1469 | }, |
1469 | 1470 | serviceOptions.getRetrySettings(), |
1470 | | - serviceOptions.getResultRetryAlgorithm(), |
| 1471 | + BigQueryRetryHelper.getHttpRetryAlgorithm(serviceOptions.getResultRetryAlgorithm()), |
1471 | 1472 | serviceOptions.getClock(), |
1472 | 1473 | EMPTY_RETRY_CONFIG, |
1473 | 1474 | serviceOptions.isOpenTelemetryTracingEnabled(), |
@@ -1508,7 +1509,7 @@ public Tuple<String, Iterable<com.google.api.services.bigquery.model.Model>> cal |
1508 | 1509 | } |
1509 | 1510 | }, |
1510 | 1511 | serviceOptions.getRetrySettings(), |
1511 | | - serviceOptions.getResultRetryAlgorithm(), |
| 1512 | + BigQueryRetryHelper.getHttpRetryAlgorithm(serviceOptions.getResultRetryAlgorithm()), |
1512 | 1513 | serviceOptions.getClock(), |
1513 | 1514 | EMPTY_RETRY_CONFIG, |
1514 | 1515 | serviceOptions.isOpenTelemetryTracingEnabled(), |
@@ -1549,7 +1550,7 @@ private static Page<Routine> listRoutines( |
1549 | 1550 | } |
1550 | 1551 | }, |
1551 | 1552 | serviceOptions.getRetrySettings(), |
1552 | | - serviceOptions.getResultRetryAlgorithm(), |
| 1553 | + BigQueryRetryHelper.getHttpRetryAlgorithm(serviceOptions.getResultRetryAlgorithm()), |
1553 | 1554 | serviceOptions.getClock(), |
1554 | 1555 | EMPTY_RETRY_CONFIG, |
1555 | 1556 | serviceOptions.isOpenTelemetryTracingEnabled(), |
@@ -1631,7 +1632,7 @@ public TableDataInsertAllResponse call() throws Exception { |
1631 | 1632 | } |
1632 | 1633 | }, |
1633 | 1634 | getOptions().getRetrySettings(), |
1634 | | - getOptions().getResultRetryAlgorithm(), |
| 1635 | + getHttpRetryAlgorithm(), |
1635 | 1636 | getOptions().getClock(), |
1636 | 1637 | EMPTY_RETRY_CONFIG, |
1637 | 1638 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1725,7 +1726,7 @@ public TableDataList call() throws IOException { |
1725 | 1726 | } |
1726 | 1727 | }, |
1727 | 1728 | serviceOptions.getRetrySettings(), |
1728 | | - serviceOptions.getResultRetryAlgorithm(), |
| 1729 | + BigQueryRetryHelper.getHttpRetryAlgorithm(serviceOptions.getResultRetryAlgorithm()), |
1729 | 1730 | serviceOptions.getClock(), |
1730 | 1731 | EMPTY_RETRY_CONFIG, |
1731 | 1732 | serviceOptions.isOpenTelemetryTracingEnabled(), |
@@ -1802,7 +1803,7 @@ public com.google.api.services.bigquery.model.Job call() throws IOException { |
1802 | 1803 | } |
1803 | 1804 | }, |
1804 | 1805 | getOptions().getRetrySettings(), |
1805 | | - getOptions().getResultRetryAlgorithm(), |
| 1806 | + getHttpRetryAlgorithm(), |
1806 | 1807 | getOptions().getClock(), |
1807 | 1808 | EMPTY_RETRY_CONFIG, |
1808 | 1809 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -1859,7 +1860,7 @@ public Tuple<String, Iterable<com.google.api.services.bigquery.model.Job>> call( |
1859 | 1860 | } |
1860 | 1861 | }, |
1861 | 1862 | serviceOptions.getRetrySettings(), |
1862 | | - serviceOptions.getResultRetryAlgorithm(), |
| 1863 | + BigQueryRetryHelper.getHttpRetryAlgorithm(serviceOptions.getResultRetryAlgorithm()), |
1863 | 1864 | serviceOptions.getClock(), |
1864 | 1865 | EMPTY_RETRY_CONFIG, |
1865 | 1866 | serviceOptions.isOpenTelemetryTracingEnabled(), |
@@ -1914,7 +1915,7 @@ public Boolean call() throws IOException { |
1914 | 1915 | } |
1915 | 1916 | }, |
1916 | 1917 | getOptions().getRetrySettings(), |
1917 | | - getOptions().getResultRetryAlgorithm(), |
| 1918 | + getHttpRetryAlgorithm(), |
1918 | 1919 | getOptions().getClock(), |
1919 | 1920 | EMPTY_RETRY_CONFIG, |
1920 | 1921 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -2169,7 +2170,7 @@ public GetQueryResultsResponse call() throws IOException { |
2169 | 2170 | } |
2170 | 2171 | }, |
2171 | 2172 | serviceOptions.getRetrySettings(), |
2172 | | - serviceOptions.getResultRetryAlgorithm(), |
| 2173 | + BigQueryRetryHelper.getHttpRetryAlgorithm(serviceOptions.getResultRetryAlgorithm()), |
2173 | 2174 | serviceOptions.getClock(), |
2174 | 2175 | DEFAULT_RETRY_CONFIG, |
2175 | 2176 | serviceOptions.isOpenTelemetryTracingEnabled(), |
@@ -2240,7 +2241,7 @@ public com.google.api.services.bigquery.model.Policy call() throws IOException { |
2240 | 2241 | } |
2241 | 2242 | }, |
2242 | 2243 | getOptions().getRetrySettings(), |
2243 | | - getOptions().getResultRetryAlgorithm(), |
| 2244 | + getHttpRetryAlgorithm(), |
2244 | 2245 | getOptions().getClock(), |
2245 | 2246 | EMPTY_RETRY_CONFIG, |
2246 | 2247 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -2334,7 +2335,7 @@ public com.google.api.services.bigquery.model.TestIamPermissionsResponse call() |
2334 | 2335 | } |
2335 | 2336 | }, |
2336 | 2337 | getOptions().getRetrySettings(), |
2337 | | - getOptions().getResultRetryAlgorithm(), |
| 2338 | + getHttpRetryAlgorithm(), |
2338 | 2339 | getOptions().getClock(), |
2339 | 2340 | EMPTY_RETRY_CONFIG, |
2340 | 2341 | getOptions().isOpenTelemetryTracingEnabled(), |
@@ -2411,4 +2412,10 @@ private static boolean isRetryErrorCodeHttpNotFound(BigQueryRetryHelperException |
2411 | 2412 | } |
2412 | 2413 | return false; |
2413 | 2414 | } |
| 2415 | + |
| 2416 | + @SuppressWarnings("unchecked") |
| 2417 | + private <V> ResultRetryAlgorithm<V> getHttpRetryAlgorithm() { |
| 2418 | + return BigQueryRetryHelper.getHttpRetryAlgorithm( |
| 2419 | + (ResultRetryAlgorithm<V>) getOptions().getResultRetryAlgorithm()); |
| 2420 | + } |
2414 | 2421 | } |
0 commit comments