Class HttpBigQueryRpc

java.lang.Object
com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc
All Implemented Interfaces:
BigQueryRpc, com.google.cloud.ServiceRpc

@InternalExtensionOnly public class HttpBigQueryRpc extends Object implements BigQueryRpc
  • Field Details

  • Constructor Details

  • Method Details

    • getDataset

      public com.google.api.services.bigquery.model.Dataset getDataset(String projectId, String datasetId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Returns the requested dataset or null if not found.
      Specified by:
      getDataset in interface BigQueryRpc
    • listDatasets

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Dataset>> listDatasets(String projectId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Lists the provided project's datasets, keyed by page token. Partial information is returned on a dataset (datasetReference, friendlyName and id). To get full information use BigQueryRpc.getDataset(String, String, Map).
      Specified by:
      listDatasets in interface BigQueryRpc
    • create

      public com.google.api.services.bigquery.model.Dataset create(com.google.api.services.bigquery.model.Dataset dataset, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Creates a new dataset.
      Specified by:
      create in interface BigQueryRpc
    • create

      public com.google.api.services.bigquery.model.Table create(com.google.api.services.bigquery.model.Table table, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Creates a new table.
      Specified by:
      create in interface BigQueryRpc
    • create

      public com.google.api.services.bigquery.model.Routine create(com.google.api.services.bigquery.model.Routine routine, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Creates the requested routine.
      Specified by:
      create in interface BigQueryRpc
    • create

      public com.google.api.services.bigquery.model.Job create(com.google.api.services.bigquery.model.Job job, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Creates a new job.
      Specified by:
      create in interface BigQueryRpc
    • createJobForQuery

      public com.google.api.services.bigquery.model.Job createJobForQuery(com.google.api.services.bigquery.model.Job job)
      Description copied from interface: BigQueryRpc
      Creates a new query job.
      Specified by:
      createJobForQuery in interface BigQueryRpc
    • deleteDataset

      public boolean deleteDataset(String projectId, String datasetId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Delete the requested dataset.
      Specified by:
      deleteDataset in interface BigQueryRpc
      Returns:
      true if dataset was deleted, false if it was not found
    • patch

      public com.google.api.services.bigquery.model.Dataset patch(com.google.api.services.bigquery.model.Dataset dataset, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Updates dataset information.
      Specified by:
      patch in interface BigQueryRpc
    • patch

      public com.google.api.services.bigquery.model.Table patch(com.google.api.services.bigquery.model.Table table, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Updates table information.
      Specified by:
      patch in interface BigQueryRpc
    • getTable

      public com.google.api.services.bigquery.model.Table getTable(String projectId, String datasetId, String tableId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Returns the requested table or null if not found.
      Specified by:
      getTable in interface BigQueryRpc
    • listTables

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Table>> listTables(String projectId, String datasetId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Lists the dataset's tables, keyed by page token. Partial information is returned on a table (tableReference, friendlyName, id and type). To get full information use BigQueryRpc.getTable(String, String, String, Map).
      Specified by:
      listTables in interface BigQueryRpc
    • deleteTable

      public boolean deleteTable(String projectId, String datasetId, String tableId)
      Description copied from interface: BigQueryRpc
      Delete the requested table.
      Specified by:
      deleteTable in interface BigQueryRpc
      Returns:
      true if table was deleted, false if it was not found
    • patch

      public com.google.api.services.bigquery.model.Model patch(com.google.api.services.bigquery.model.Model model, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Updates model information.
      Specified by:
      patch in interface BigQueryRpc
    • getModel

      public com.google.api.services.bigquery.model.Model getModel(String projectId, String datasetId, String modelId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Returns the requested model or null if not found.
      Specified by:
      getModel in interface BigQueryRpc
    • listModels

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Model>> listModels(String projectId, String datasetId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Lists the dataset's models, keyed by page token.
      Specified by:
      listModels in interface BigQueryRpc
    • deleteModel

      public boolean deleteModel(String projectId, String datasetId, String modelId)
      Description copied from interface: BigQueryRpc
      Delete the requested model.
      Specified by:
      deleteModel in interface BigQueryRpc
      Returns:
      true if model was deleted, false if it was not found
    • update

      public com.google.api.services.bigquery.model.Routine update(com.google.api.services.bigquery.model.Routine routine, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Updates the requested routine.
      Specified by:
      update in interface BigQueryRpc
    • getRoutine

      public com.google.api.services.bigquery.model.Routine getRoutine(String projectId, String datasetId, String routineId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Returns the requested routine or null if not found.
      Specified by:
      getRoutine in interface BigQueryRpc
    • listRoutines

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Routine>> listRoutines(String projectId, String datasetId, Map<BigQueryRpc.Option,?> options)
      Specified by:
      listRoutines in interface BigQueryRpc
    • deleteRoutine

      public boolean deleteRoutine(String projectId, String datasetId, String routineId)
      Description copied from interface: BigQueryRpc
      Deletes the requested routine.
      Specified by:
      deleteRoutine in interface BigQueryRpc
      Returns:
      true if routine was deleted, false if it was not found
    • insertAll

      public com.google.api.services.bigquery.model.TableDataInsertAllResponse insertAll(String projectId, String datasetId, String tableId, com.google.api.services.bigquery.model.TableDataInsertAllRequest request)
      Description copied from interface: BigQueryRpc
      Sends an insert all request.
      Specified by:
      insertAll in interface BigQueryRpc
    • listTableData

      public com.google.api.services.bigquery.model.TableDataList listTableData(String projectId, String datasetId, String tableId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Lists the table's rows.
      Specified by:
      listTableData in interface BigQueryRpc
    • listTableDataWithRowLimit

      public com.google.api.services.bigquery.model.TableDataList listTableDataWithRowLimit(String projectId, String datasetId, String tableId, Integer maxResultPerPage, String pageToken)
      Description copied from interface: BigQueryRpc
      Lists the table's rows with a limit on how many rows of data to pre-fetch.
      Specified by:
      listTableDataWithRowLimit in interface BigQueryRpc
    • getJob

      public com.google.api.services.bigquery.model.Job getJob(String projectId, String jobId, String location, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Returns the requested job or null if not found.
      Specified by:
      getJob in interface BigQueryRpc
    • getQueryJob

      public com.google.api.services.bigquery.model.Job getQueryJob(String projectId, String jobId, String location)
      Description copied from interface: BigQueryRpc
      Returns the requested query job or null if not found.
      Specified by:
      getQueryJob in interface BigQueryRpc
    • listJobs

      public com.google.cloud.Tuple<String,Iterable<com.google.api.services.bigquery.model.Job>> listJobs(String projectId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Lists the project's jobs.
      Specified by:
      listJobs in interface BigQueryRpc
    • cancel

      public boolean cancel(String projectId, String jobId, String location)
      Description copied from interface: BigQueryRpc
      Sends a job cancel request. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully.
      Specified by:
      cancel in interface BigQueryRpc
      Returns:
      true if cancel was requested successfully, false if the job was not found
    • deleteJob

      public boolean deleteJob(String projectId, String jobName, String location)
      Description copied from interface: BigQueryRpc
      Sends a job delete request.
      Specified by:
      deleteJob in interface BigQueryRpc
      Returns:
      true if delete was successful, false if the job was not found
    • getQueryResults

      public com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResults(String projectId, String jobId, String location, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Returns results of the query associated with the provided job.
      Specified by:
      getQueryResults in interface BigQueryRpc
    • getQueryResultsWithRowLimit

      public com.google.api.services.bigquery.model.GetQueryResultsResponse getQueryResultsWithRowLimit(String projectId, String jobId, String location, Integer maxResultPerPage, Long timeoutMs)
      Description copied from interface: BigQueryRpc
      Returns results of the query with a limit on how many rows of data to pre-fetch associated with the provided job.
      Specified by:
      getQueryResultsWithRowLimit in interface BigQueryRpc
    • queryRpc

      public com.google.api.services.bigquery.model.QueryResponse queryRpc(String projectId, com.google.api.services.bigquery.model.QueryRequest content)
      Description copied from interface: BigQueryRpc
      Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.

      Create a request for the method "jobs.query".

      This request holds the parameters needed by the bigquery server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.

      Specified by:
      queryRpc in interface BigQueryRpc
      Parameters:
      projectId - Project ID of the project billed for the query
      content - the QueryRequest
      Returns:
      the request
    • open

      public String open(com.google.api.services.bigquery.model.Job loadJob)
      Description copied from interface: BigQueryRpc
      Opens a resumable upload session to load data into a BigQuery table and returns an upload URI.
      Specified by:
      open in interface BigQueryRpc
      Parameters:
      loadJob - load job
    • write

      public com.google.api.services.bigquery.model.Job write(String uploadId, byte[] toWrite, int toWriteOffset, long destOffset, int length, boolean last)
      Description copied from interface: BigQueryRpc
      Uploads the provided data to the resumable upload session at the specified position. This method returns the job created to insert the rows, only when last is true.
      Specified by:
      write in interface BigQueryRpc
      Parameters:
      uploadId - the resumable upload session URI
      toWrite - a byte array of data to upload
      toWriteOffset - offset in the toWrite param to start writing from
      destOffset - offset in the destination where to upload data to
      length - the number of bytes to upload
      last - true indicates that the last chunk is being uploaded
      Returns:
      returns the job created to insert the rows, only when last is true. Returns null otherwise
    • getIamPolicy

      public com.google.api.services.bigquery.model.Policy getIamPolicy(String resourceId, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Returns the IAM Policy for the specified resource, using Policy V1.
      Specified by:
      getIamPolicy in interface BigQueryRpc
    • setIamPolicy

      public com.google.api.services.bigquery.model.Policy setIamPolicy(String resourceId, com.google.api.services.bigquery.model.Policy policy, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Updates the IAM policy for the specified resource.
      Specified by:
      setIamPolicy in interface BigQueryRpc
    • testIamPermissions

      public com.google.api.services.bigquery.model.TestIamPermissionsResponse testIamPermissions(String resourceId, List<String> permissions, Map<BigQueryRpc.Option,?> options)
      Description copied from interface: BigQueryRpc
      Tests whether the caller holds the provided permissions for the specified resource. Returns the subset of permissions the caller actually holds.
      Specified by:
      testIamPermissions in interface BigQueryRpc