Class FakeBigQueryServices
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.testing.FakeBigQueryServices
-
- All Implemented Interfaces:
java.io.Serializable,BigQueryServices
@Internal public class FakeBigQueryServices extends java.lang.Object implements BigQueryServices
A fake implementation of BigQuery's query service..- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFakeBigQueryServices.FakeBigQueryServerStream<T>An implementation ofBigQueryServices.BigQueryServerStreamwhich takes aListas theIterableto simulate a server stream.-
Nested classes/interfaces inherited from interface org.apache.beam.sdk.io.gcp.bigquery.BigQueryServices
BigQueryServices.BigQueryServerStream<T>, BigQueryServices.DatasetService, BigQueryServices.JobService, BigQueryServices.StorageClient, BigQueryServices.StreamAppendClient, BigQueryServices.WriteStreamService
-
-
Constructor Summary
Constructors Constructor Description FakeBigQueryServices()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static com.google.api.services.bigquery.model.TableRowconvertNumbers(com.google.api.services.bigquery.model.TableRow tableRow)static org.apache.beam.sdk.values.KV<com.google.api.services.bigquery.model.Table,java.util.List<com.google.api.services.bigquery.model.TableRow>>decodeQueryResult(java.lang.String queryResult)static java.lang.StringencodeQueryResult(com.google.api.services.bigquery.model.Table table)static java.lang.StringencodeQueryResult(com.google.api.services.bigquery.model.Table table, java.util.List<com.google.api.services.bigquery.model.TableRow> rows)BigQueryServices.DatasetServicegetDatasetService(BigQueryOptions bqOptions)Returns a real, mock, or fakeBigQueryServices.DatasetService.BigQueryServices.JobServicegetJobService(BigQueryOptions bqOptions)Returns a real, mock, or fakeBigQueryServices.JobService.BigQueryServices.StorageClientgetStorageClient(BigQueryOptions bqOptions)Returns a real, mock, or fakeBigQueryServices.StorageClient.BigQueryServices.WriteStreamServicegetWriteStreamService(BigQueryOptions bqOptions)Returns a real, mock, or fakeBigQueryServices.WriteStreamService.FakeBigQueryServiceswithDatasetService(FakeDatasetService datasetService)FakeBigQueryServiceswithJobService(BigQueryServices.JobService jobService)FakeBigQueryServiceswithStorageClient(BigQueryServices.StorageClient storageClient)
-
-
-
Method Detail
-
withJobService
public FakeBigQueryServices withJobService(BigQueryServices.JobService jobService)
-
withDatasetService
public FakeBigQueryServices withDatasetService(FakeDatasetService datasetService)
-
withStorageClient
public FakeBigQueryServices withStorageClient(BigQueryServices.StorageClient storageClient)
-
getJobService
public BigQueryServices.JobService getJobService(BigQueryOptions bqOptions)
Description copied from interface:BigQueryServicesReturns a real, mock, or fakeBigQueryServices.JobService.- Specified by:
getJobServicein interfaceBigQueryServices
-
getDatasetService
public BigQueryServices.DatasetService getDatasetService(BigQueryOptions bqOptions)
Description copied from interface:BigQueryServicesReturns a real, mock, or fakeBigQueryServices.DatasetService.- Specified by:
getDatasetServicein interfaceBigQueryServices
-
getWriteStreamService
public BigQueryServices.WriteStreamService getWriteStreamService(BigQueryOptions bqOptions)
Description copied from interface:BigQueryServicesReturns a real, mock, or fakeBigQueryServices.WriteStreamService.- Specified by:
getWriteStreamServicein interfaceBigQueryServices
-
getStorageClient
public BigQueryServices.StorageClient getStorageClient(BigQueryOptions bqOptions)
Description copied from interface:BigQueryServicesReturns a real, mock, or fakeBigQueryServices.StorageClient.- Specified by:
getStorageClientin interfaceBigQueryServices
-
encodeQueryResult
public static java.lang.String encodeQueryResult(com.google.api.services.bigquery.model.Table table) throws java.io.IOException- Throws:
java.io.IOException
-
encodeQueryResult
public static java.lang.String encodeQueryResult(com.google.api.services.bigquery.model.Table table, java.util.List<com.google.api.services.bigquery.model.TableRow> rows) throws java.io.IOException- Throws:
java.io.IOException
-
decodeQueryResult
public static org.apache.beam.sdk.values.KV<com.google.api.services.bigquery.model.Table,java.util.List<com.google.api.services.bigquery.model.TableRow>> decodeQueryResult(java.lang.String queryResult) throws java.io.IOException- Throws:
java.io.IOException
-
convertNumbers
public static com.google.api.services.bigquery.model.TableRow convertNumbers(com.google.api.services.bigquery.model.TableRow tableRow)
-
-