Class RemoteBigQueryHelper (2.11.2)

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.

Inheritance

java.lang.Object > RemoteBigQueryHelper

Static Methods

create()

public static RemoteBigQueryHelper create()

Creates a RemoteBigQueryHelper object using default project id and authentication credentials.

Returns
TypeDescription
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
NameDescription
projectIdString

id of the project to be used for running the tests

keyStreamInputStream

input stream for a JSON key

Returns
TypeDescription
RemoteBigQueryHelper

A RemoteBigQueryHelper object for the provided options

Exceptions
TypeDescription
RemoteBigQueryHelper.BigQueryHelperException

if keyStream is not a valid JSON key stream

forceDelete(BigQuery bigquery, String dataset)

public static boolean forceDelete(BigQuery bigquery, String dataset)

Deletes a dataset, even if non-empty.

Parameters
NameDescription
bigqueryBigQuery

the BigQuery service to be used to issue the delete request

datasetString

the dataset to be deleted

Returns
TypeDescription
boolean

true if deletion succeeded, false if the dataset was not found

generateDatasetName()

public static String generateDatasetName()

Returns a dataset name generated using a random UUID.

Returns
TypeDescription
String

generateModelName()

public static String generateModelName()
Returns
TypeDescription
String

generateRoutineName()

public static String generateRoutineName()
Returns
TypeDescription
String

Methods

getOptions()

public BigQueryOptions getOptions()

Returns a BigQueryOptions object to be used for testing.

Returns
TypeDescription
BigQueryOptions