|
22 | 22 | import com.google.gcloud.bigquery.BigQueryException; |
23 | 23 | import com.google.gcloud.bigquery.BigQueryOptions; |
24 | 24 |
|
25 | | -import java.io.FileInputStream; |
26 | | -import java.io.FileNotFoundException; |
27 | 25 | import java.io.IOException; |
28 | 26 | import java.io.InputStream; |
29 | 27 | import java.util.UUID; |
30 | 28 | import java.util.logging.Level; |
31 | 29 | import java.util.logging.Logger; |
32 | 30 |
|
33 | 31 | /** |
34 | | - * Utility to create a remote BigQuery configuration for testing. |
| 32 | + * Utility to create a remote BigQuery configuration for testing. BigQuery options can be obtained |
| 33 | + * via the {@link #options()} method. Returned options have custom |
| 34 | + * {@link BigQueryOptions#retryParams()}: {@link RetryParams#retryMaxAttempts()} is {@code 10}, |
| 35 | + * {@link RetryParams#retryMinAttempts()} is {@code 6}, {@link RetryParams#maxRetryDelayMillis()} is |
| 36 | + * {@code 30000}, {@link RetryParams#totalRetryPeriodMillis()} is {@code 120000} and |
| 37 | + * {@link RetryParams#initialRetryDelayMillis()} is {@code 250}. |
| 38 | + * {@link BigQueryOptions#connectTimeout()} and {@link BigQueryOptions#readTimeout()} are both set |
| 39 | + * to {@code 60000}. |
35 | 40 | */ |
36 | 41 | public class RemoteBigQueryHelper { |
37 | 42 |
|
@@ -97,27 +102,6 @@ public static RemoteBigQueryHelper create(String projectId, InputStream keyStrea |
97 | 102 | } |
98 | 103 | } |
99 | 104 |
|
100 | | - /** |
101 | | - * Creates a {@code RemoteBigQueryHelper} object for the given project id and JSON key path. |
102 | | - * |
103 | | - * @param projectId id of the project to be used for running the tests |
104 | | - * @param keyPath path to the JSON key to be used for running the tests |
105 | | - * @return A {@code RemoteBigQueryHelper} object for the provided options. |
106 | | - * @throws BigQueryHelperException if the file pointed by {@code keyPath} does not exist |
107 | | - */ |
108 | | - public static RemoteBigQueryHelper create(String projectId, String keyPath) |
109 | | - throws BigQueryHelperException { |
110 | | - try { |
111 | | - InputStream keyFileStream = new FileInputStream(keyPath); |
112 | | - return create(projectId, keyFileStream); |
113 | | - } catch (FileNotFoundException ex) { |
114 | | - if (log.isLoggable(Level.WARNING)) { |
115 | | - log.log(Level.WARNING, ex.getMessage()); |
116 | | - } |
117 | | - throw BigQueryHelperException.translate(ex); |
118 | | - } |
119 | | - } |
120 | | - |
121 | 105 | /** |
122 | 106 | * Creates a {@code RemoteBigQueryHelper} object using default project id and authentication |
123 | 107 | * credentials. |
|
0 commit comments