Class ConnectionSettings.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setUseReadAPI

        @Nullable
        public abstract ConnectionSettings.Builder setUseReadAPI​(Boolean useReadAPI)
        Sets useReadAPI flag, enabled by default. Read API will be used if the underlying conditions are satisfied and this flag is enabled
        Parameters:
        useReadAPI - or true for none
      • setRequestTimeout

        public abstract ConnectionSettings.Builder setRequestTimeout​(Long timeoutMs)
        Sets how long to wait for the query to complete, in milliseconds, before the request times out and returns. Note that this is only a timeout for the request, not the query. If the query takes longer to run than the timeout value, the call returns without any results and with the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the query to complete and read the results. The default value is 10000 milliseconds (10 seconds).
        Parameters:
        timeoutMs - or null for none
      • setConnectionProperties

        public abstract ConnectionSettings.Builder setConnectionProperties​(List<ConnectionProperty> connectionProperties)
        Sets a connection-level property to customize query behavior.
        Parameters:
        connectionProperties - connectionProperties or null for none
      • setDefaultDataset

        public abstract ConnectionSettings.Builder setDefaultDataset​(DatasetId datasetId)
        Sets the default dataset. This dataset is used for all unqualified table names used in the query.
      • setMaximumBytesBilled

        public abstract ConnectionSettings.Builder setMaximumBytesBilled​(Long maximumBytesBilled)
        Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.
        Parameters:
        maximumBytesBilled - maximum bytes billed for this job
      • setMaxResults

        public abstract ConnectionSettings.Builder setMaxResults​(Long maxResults)
        Sets the maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies.
        Parameters:
        maxResults - maxResults or null for none
      • setNumBufferedRows

        public abstract ConnectionSettings.Builder setNumBufferedRows​(Integer numBufferedRows)
        Sets the number of rows in the buffer (a blocking queue) that query results are consumed from.
        Parameters:
        numBufferedRows - numBufferedRows or null for none
      • setTotalToPageRowCountRatio

        public abstract ConnectionSettings.Builder setTotalToPageRowCountRatio​(Integer totalToPageRowCountRatio)
        Sets a ratio of the total number of records and the records returned in the current page. This value is checked before calling the Read API
        Parameters:
        totalToPageRowCountRatio - totalToPageRowCountRatio
      • setMinResultSize

        public abstract ConnectionSettings.Builder setMinResultSize​(Integer minResultSize)
        Sets the minimum result size for which the Read API will be enabled
        Parameters:
        minResultSize - minResultSize
      • setMaxResultPerPage

        public abstract ConnectionSettings.Builder setMaxResultPerPage​(Integer maxResultPerPage)
        Sets the maximum records per page to be used for pagination. This is used as an input for the tabledata.list and jobs.getQueryResults RPC calls
        Parameters:
        maxResultPerPage -
      • setUseQueryCache

        public abstract ConnectionSettings.Builder setUseQueryCache​(Boolean useQueryCache)
        Sets whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when setDestinationTable(TableId) is not set.
        See Also:
        Query Caching
      • setDestinationEncryptionConfiguration

        public abstract ConnectionSettings.Builder setDestinationEncryptionConfiguration​(EncryptionConfiguration destinationEncryptionConfiguration)
        Sets the custom encryption configuration (e.g., Cloud KMS keys).
        Parameters:
        destinationEncryptionConfiguration - destinationEncryptionConfiguration or null for none
      • setJobTimeoutMs

        public abstract ConnectionSettings.Builder setJobTimeoutMs​(Long jobTimeoutMs)
        [Optional] Job timeout in milliseconds. If this time limit is exceeded, BigQuery may attempt to terminate the job.
        Parameters:
        jobTimeoutMs - jobTimeoutMs or null for none
      • setMaximumBillingTier

        public abstract ConnectionSettings.Builder setMaximumBillingTier​(Integer maximumBillingTier)
        Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default.
        Parameters:
        maximumBillingTier - maximum billing tier for this job
      • setCreateSession

        public abstract ConnectionSettings.Builder setCreateSession​(Boolean createSession)
        Sets whether to create a new session. If true a random session id will be generated by BigQuery. If false, runs query with an existing session_id passed in ConnectionProperty, otherwise runs query in non-session mode."
      • setRangePartitioning

        public abstract ConnectionSettings.Builder setRangePartitioning​(RangePartitioning rangePartitioning)
        Range partitioning specification for this table. Only one of timePartitioning and rangePartitioning should be specified.
        Parameters:
        rangePartitioning - rangePartitioning or null for none
      • setSchemaUpdateOptions

        public abstract ConnectionSettings.Builder setSchemaUpdateOptions​(List<JobInfo.SchemaUpdateOption> schemaUpdateOptions)
        [Experimental] Sets options allowing the schema of the destination table to be updated as a side effect of the query job. Schema update options are supported in two cases: when writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE and the destination table is a partition of a table, specified by partition decorators. For normal tables, WRITE_TRUNCATE will always overwrite the schema.
      • setTableDefinitions

        public abstract ConnectionSettings.Builder setTableDefinitions​(Map<String,​ExternalTableDefinition> tableDefinitions)
        Sets the external tables definitions. If querying external data sources outside of BigQuery, this value describes the data format, location and other properties of the data sources. By defining these properties, the data sources can be queried as if they were standard BigQuery tables.