Package com.google.cloud.bigquery
Class DatasetInfo.Builder
java.lang.Object
com.google.cloud.bigquery.DatasetInfo.Builder
- Direct Known Subclasses:
Dataset.Builder
- Enclosing class:
- DatasetInfo
A builder for
DatasetInfo objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract DatasetInfobuild()Creates aDatasetInfoobject.abstract DatasetInfo.BuilderSets the dataset's access control configuration.abstract DatasetInfo.BuildersetDatasetId(DatasetId datasetId) Sets the dataset identity.abstract DatasetInfo.BuildersetDefaultCollation(String defaultCollation) Optional.abstract DatasetInfo.BuildersetDefaultEncryptionConfiguration(EncryptionConfiguration defaultEncryptionConfiguration) The default encryption key for all tables in the dataset.abstract DatasetInfo.BuildersetDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs) [Optional] The default partition expiration time for all partitioned tables in the dataset, in milliseconds.abstract DatasetInfo.BuildersetDefaultTableLifetime(Long defaultTableLifetime) Sets the default lifetime of all tables in the dataset, in milliseconds.abstract DatasetInfo.BuildersetDescription(String description) Sets a user-friendly description for the dataset.abstract DatasetInfo.BuildersetExternalDatasetReference(ExternalDatasetReference externalDatasetReference) Optional.abstract DatasetInfo.BuildersetFriendlyName(String friendlyName) Sets a user-friendly name for the dataset.abstract DatasetInfo.Builderabstract DatasetInfo.BuildersetLocation(String location) Sets the geographic location where the dataset should reside.abstract DatasetInfo.BuildersetMaxTimeTravelHours(Long maxTimeTravelHours) Optional.abstract DatasetInfo.BuildersetResourceTags(Map<String, String> resourceTags) Optional.abstract DatasetInfo.BuildersetStorageBillingModel(String storageBillingModel) Optional.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setDatasetId
Sets the dataset identity. -
setAcl
Sets the dataset's access control configuration.- See Also:
-
setDefaultTableLifetime
Sets the default lifetime of all tables in the dataset, in milliseconds. The minimum value is 3600000 milliseconds (one hour). Once this property is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating a table, that value takes precedence over the default expiration time indicated by this property. This property is experimental and might be subject to change or removed. -
setDescription
Sets a user-friendly description for the dataset. -
setFriendlyName
Sets a user-friendly name for the dataset. -
setLocation
Sets the geographic location where the dataset should reside. This property is experimental and might be subject to change or removed.- See Also:
-
setLabels
-
setExternalDatasetReference
public abstract DatasetInfo.Builder setExternalDatasetReference(ExternalDatasetReference externalDatasetReference) Optional. Information about the external metadata storage where the dataset is defined. Filled out when the dataset type is EXTERNAL -
setStorageBillingModel
Optional. Storage billing model to be used for all tables in the dataset. Can be set to PHYSICAL. Default is LOGICAL. -
setMaxTimeTravelHours
Optional. Defines the time travel window in hours. The value can be from 48 to 168 hours (2 to 7 days). The default value is 168 hours if this is not set. The value may benull. -
setDefaultEncryptionConfiguration
public abstract DatasetInfo.Builder setDefaultEncryptionConfiguration(EncryptionConfiguration defaultEncryptionConfiguration) The default encryption key for all tables in the dataset. Once this property is set, all newly-created partitioned tables in the dataset will have encryption key set to this value, unless table creation request (or query) overrides the key. -
setDefaultPartitionExpirationMs
public abstract DatasetInfo.Builder setDefaultPartitionExpirationMs(Long defaultPartitionExpirationMs) [Optional] The default partition expiration time for all partitioned tables in the dataset, in milliseconds. Once this property is set, all newly-created partitioned tables in the dataset will has an expirationMs property in the timePartitioning settings set to this value. Changing the value only affect new tables, not existing ones. The storage in a partition will have an expiration time of its partition time plus this value. Setting this property overrides the use of defaultTableExpirationMs for partitioned tables: only one of defaultTableExpirationMs and defaultPartitionExpirationMs will be used for any new partitioned table. If you provide an explicit timePartitioning.expirationMs when creating or updating a partitioned table, that value takes precedence over the default partition expiration time indicated by this property. The value may benull. -
setDefaultCollation
Optional. Defines the default collation specification of future tables created in the dataset. If a table is created in this dataset without table-level default collation, then the table inherits the dataset default collation, which is applied to the string fields that do not have explicit collation specified. A change to this field affects only tables created afterwards, and does not alter the existing tables. The following values are supported:* 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior. (-- A wrapper is used here because it is possible to set the value to the empty string. --) (-- api-linter: standard-fields=disabled --)
-
setResourceTags
Optional. The tags attached to this dataset. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this tag key. Tag value is expected to be the short name, for example "Production".- Parameters:
resourceTags- resourceTags ornullfor none- See Also:
-
- Tag definitions for more details.
-
build
Creates aDatasetInfoobject.
-