public class RemoteBigQueryHelper
Utility to create a remote BigQuery configuration for testing. BigQuery options can be obtained
via the #getOptions() method. Returned options have custom BigQueryOptions#getRetrySettings(): RetrySettings#getMaxAttempts() is 10
, RetrySettings#getMaxRetryDelay() is 30000
, RetrySettings#getTotalTimeout() is
120000
and RetrySettings#getInitialRetryDelay() is 250
. HttpTransportOptions#getConnectTimeout() and HttpTransportOptions#getReadTimeout() are
both set to 60000
.
Static Methods
create()
public static RemoteBigQueryHelper create()
Creates a RemoteBigQueryHelper
object using default project id and authentication
credentials.
Returns | |
---|---|
Type | Description |
RemoteBigQueryHelper |
create(String projectId, InputStream keyStream)
public static RemoteBigQueryHelper create(String projectId, InputStream keyStream)
Creates a RemoteBigQueryHelper
object for the given project id and JSON key input
stream.
Parameters | |
---|---|
Name | Description |
projectId | String id of the project to be used for running the tests |
keyStream | InputStream input stream for a JSON key |
Returns | |
---|---|
Type | Description |
RemoteBigQueryHelper | A |
Exceptions | |
---|---|
Type | Description |
RemoteBigQueryHelper.BigQueryHelperException | if |
forceDelete(BigQuery bigquery, String dataset)
public static boolean forceDelete(BigQuery bigquery, String dataset)
Deletes a dataset, even if non-empty.
Parameters | |
---|---|
Name | Description |
bigquery | BigQuery the BigQuery service to be used to issue the delete request |
dataset | String the dataset to be deleted |
Returns | |
---|---|
Type | Description |
boolean |
|
generateDatasetName()
public static String generateDatasetName()
Returns a dataset name generated using a random UUID.
Returns | |
---|---|
Type | Description |
String |
generateModelName()
public static String generateModelName()
Returns | |
---|---|
Type | Description |
String |
generateRoutineName()
public static String generateRoutineName()
Returns | |
---|---|
Type | Description |
String |
Methods
getOptions()
public BigQueryOptions getOptions()
Returns a BigQueryOptions object to be used for testing.
Returns | |
---|---|
Type | Description |
BigQueryOptions |