com.google.api.services.bigquery.model.Dataset

Here are the examples of the java api class com.google.api.services.bigquery.model.Dataset taken from open source projects.

1. DatasetInfo#toPb()

Project: gcloud-java
Source File: DatasetInfo.java
View license
Dataset toPb() {
    Dataset datasetPb = new Dataset();
    datasetPb.setDatasetReference(datasetId.toPb());
    datasetPb.setCreationTime(creationTime);
    datasetPb.setDefaultTableExpirationMs(defaultTableLifetime);
    datasetPb.setDescription(description);
    datasetPb.setEtag(etag);
    datasetPb.setFriendlyName(friendlyName);
    datasetPb.setId(generatedId);
    datasetPb.setLastModifiedTime(lastModified);
    datasetPb.setLocation(location);
    datasetPb.setSelfLink(selfLink);
    if (acl != null) {
        datasetPb.setAccess(Lists.transform(acl, new Function<Acl, Dataset.Access>() {

            @Override
            public Dataset.Access apply(Acl acl) {
                return acl.toPb();
            }
        }));
    }
    return datasetPb;
}

2. BigQueryTableRowIterator#createDataset()

View license
// Create a new BigQuery dataset
private void createDataset(String datasetId) throws IOException, InterruptedException {
    Dataset dataset = new Dataset();
    DatasetReference reference = new DatasetReference();
    reference.setProjectId(projectId);
    reference.setDatasetId(datasetId);
    dataset.setDatasetReference(reference);
    String createDatasetError = "Error when trying to create the temporary dataset " + datasetId + " in project " + projectId;
    executeWithBackOff(client.datasets().insert(projectId, dataset), createDatasetError + " :{}");
}

3. BigQueryTableRowIterator#createDataset()

View license
// Create a new BigQuery dataset
private void createDataset(String datasetId) throws IOException, InterruptedException {
    Dataset dataset = new Dataset();
    DatasetReference reference = new DatasetReference();
    reference.setProjectId(projectId);
    reference.setDatasetId(datasetId);
    dataset.setDatasetReference(reference);
    String createDatasetError = "Error when trying to create the temporary dataset " + datasetId + " in project " + projectId;
    executeWithBackOff(client.datasets().insert(projectId, dataset), createDatasetError + " :{}");
}