public class DatasetInfo extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
DatasetInfo.Builder
A builder for
DatasetInfo objects. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<Acl> |
getAcl()
Returns the dataset's access control configuration.
|
Long |
getCreationTime()
Returns the time when this dataset was created, in milliseconds since the epoch.
|
DatasetId |
getDatasetId()
Returns the dataset identity.
|
String |
getDefaultCollation() |
EncryptionConfiguration |
getDefaultEncryptionConfiguration() |
Long |
getDefaultPartitionExpirationMs() |
Long |
getDefaultTableLifetime()
Returns the default lifetime of all tables in the dataset, in milliseconds.
|
String |
getDescription()
Returns a user-friendly description for the dataset.
|
String |
getEtag()
Returns the hash of the dataset resource.
|
String |
getFriendlyName()
Returns a user-friendly name for the dataset.
|
String |
getGeneratedId()
Returns the service-generated id for the dataset.
|
Map<String,String> |
getLabels()
Return a map for labels applied to the dataset.
|
Long |
getLastModified()
Returns the time when this dataset or any of its tables was last modified, in milliseconds
since the epoch.
|
String |
getLocation()
Returns the geographic location where the dataset should reside.
|
String |
getSelfLink()
Returns an URL that can be used to access the resource again.
|
int |
hashCode() |
static DatasetInfo.Builder |
newBuilder(DatasetId datasetId)
Returns a builder for a
DatasetInfo object given it's identity. |
static DatasetInfo.Builder |
newBuilder(String datasetId)
Returns a builder for a
DatasetInfo object given it's user-defined id. |
static DatasetInfo.Builder |
newBuilder(String projectId,
String datasetId)
Returns a builder for the DatasetInfo object given it's user-defined project and dataset ids.
|
static DatasetInfo |
of(DatasetId datasetId)
Returns a
DatasetInfo object given it's identity. |
static DatasetInfo |
of(String datasetId)
Returns a
DatasetInfo object given it's user-defined id. |
DatasetInfo.Builder |
toBuilder()
Returns a builder for the dataset object.
|
String |
toString() |
public DatasetId getDatasetId()
public List<Acl> getAcl()
Update the ACLs for a dataset.
Dataset dataset = bigquery.getDataset(DatasetId.of("my_dataset"));
List<Acl> beforeAcls = dataset.getAcl();
// Make a copy of the ACLs so that they can be modified.
ArrayList<Acl> acls = new ArrayList<>(beforeAcls);
acls.add(Acl.of(new Acl.User("sample.bigquery.dev@gmail.com"), Acl.Role.READER));
Dataset.Builder builder = dataset.toBuilder();
builder.setAcl(acls);
bigquery.update(builder.build()); // API request.
public Long getCreationTime()
public Long getDefaultTableLifetime()
Update the default table expiration time for a dataset.
Dataset dataset = bigquery.getDataset(DatasetId.of("my_dataset"));
Long beforeExpiration = dataset.getDefaultTableLifetime();
Long oneDayMilliseconds = 24 * 60 * 60 * 1000L;
Dataset.Builder builder = dataset.toBuilder();
builder.setDefaultTableLifetime(oneDayMilliseconds);
bigquery.update(builder.build()); // API request.
public String getDescription()
public String getEtag()
public String getFriendlyName()
public String getGeneratedId()
public Long getLastModified()
public String getLocation()
public String getSelfLink()
public Map<String,String> getLabels()
public EncryptionConfiguration getDefaultEncryptionConfiguration()
public Long getDefaultPartitionExpirationMs()
public String getDefaultCollation()
public DatasetInfo.Builder toBuilder()
public static DatasetInfo.Builder newBuilder(DatasetId datasetId)
DatasetInfo
object given it's identity.public static DatasetInfo.Builder newBuilder(String datasetId)
DatasetInfo
object given it's user-defined id.public static DatasetInfo.Builder newBuilder(String projectId, String datasetId)
public static DatasetInfo of(DatasetId datasetId)
DatasetInfo
object given it's identity.public static DatasetInfo of(String datasetId)
DatasetInfo
object given it's user-defined id.Copyright © 2023 Google LLC. All rights reserved.