Skip to content

Releases: googleapis/google-cloud-java

0.1.1

Choose a tag to compare

@ajkannan ajkannan released this 28 Dec 15:25

Features

BigQuery

  • Introduce support for Google Cloud BigQuery (#503): create datasets and tables, manage jobs, insert and list table data. See BigQueryExample for a complete example or API Documentation for gcloud-java-bigquery javadoc.

    import com.google.gcloud.bigquery.BaseTableInfo;
    import com.google.gcloud.bigquery.BigQuery;
    import com.google.gcloud.bigquery.BigQueryOptions;
    import com.google.gcloud.bigquery.Field;
    import com.google.gcloud.bigquery.JobStatus;
    import com.google.gcloud.bigquery.LoadJobInfo;
    import com.google.gcloud.bigquery.Schema;
    import com.google.gcloud.bigquery.TableId;
    import com.google.gcloud.bigquery.TableInfo;
    
    BigQuery bigquery = BigQueryOptions.defaultInstance().service();
    TableId tableId = TableId.of("dataset", "table");
    BaseTableInfo info = bigquery.getTable(tableId);
    if (info == null) {
      System.out.println("Creating table " + tableId);
      Field integerField = Field.of("fieldName", Field.Type.integer());
      bigquery.create(TableInfo.of(tableId, Schema.of(integerField)));
    } else {
      System.out.println("Loading data into table " + tableId);
      LoadJobInfo loadJob = LoadJobInfo.of(tableId, "gs://bucket/path");
      loadJob = bigquery.create(loadJob);
      while (loadJob.status().state() != JobStatus.State.DONE) {
        Thread.sleep(1000L);
        loadJob = bigquery.getJob(loadJob.jobId());
      }
      if (loadJob.status().error() != null) {
        System.out.println("Job completed with errors");
      } else {
        System.out.println("Job succeeded");
      }
    }

Resource Manager

  • Introduce support for Google Cloud Resource Manager (#495): get a list of all projects associated with an account, create/update/delete projects, undelete projects that you don't want to delete. See ResourceManagerExample for a complete example or API Documentation for gcloud-java-resourcemanager javadoc.

    import com.google.gcloud.resourcemanager.ProjectInfo;
    import com.google.gcloud.resourcemanager.ResourceManager;
    import com.google.gcloud.resourcemanager.ResourceManagerOptions;
    
    import java.util.Iterator;
    
    ResourceManager resourceManager = ResourceManagerOptions.defaultInstance().service();
    // Replace "some-project-id" with an existing project's ID
    ProjectInfo myProject = resourceManager.get("some-project-id");
    ProjectInfo newProjectInfo = resourceManager.replace(myProject.toBuilder()
        .addLabel("launch-status", "in-development").build());
    System.out.println("Updated the labels of project " + newProjectInfo.projectId()
        + " to be " + newProjectInfo.labels());
    // List all the projects you have permission to view.
    Iterator<ProjectInfo> projectIterator = resourceManager.list().iterateAll();
    System.out.println("Projects I can view:");
    while (projectIterator.hasNext()) {
      System.out.println(projectIterator.next().projectId());
    }

Storage

  • Remove the RemoteGcsHelper.create(String, String) method (#494)

Fixes

Datastore

  • HTTP Transport is now specified in DefaultDatastoreRpc (#448)

0.1.0

Choose a tag to compare

@ajkannan ajkannan released this 02 Dec 01:23

Features

Core

  • The project ID set in the Google Cloud SDK now supersedes the project ID set by Compute Engine (#337).

    Before

    The project ID is determined by iterating through the following list in order, stopping when a valid project ID is found:

    1. Project ID supplied when building the service options
    2. Project ID specified by the environment variable GCLOUD_PROJECT
    3. App Engine project ID
    4. Compute Engine project ID
    5. Google Cloud SDK project ID
    After
    1. Project ID supplied when building the service options
    2. Project ID specified by the environment variable GCLOUD_PROJECT
    3. App Engine project ID
    4. Google Cloud SDK project ID
    5. Compute Engine project ID
  • The explicit AuthCredentials.noCredentials option was removed.

Storage

  • The testing helper class RemoteGCSHelper now uses GOOGLE_APPLICATION_CREDENTIALS and GCLOUD_PROJECT environment variables to set credentials and project (#335, #339).

    Before
    export GCLOUD_TESTS_PROJECT_ID="MY_PROJECT_ID"
    export GCLOUD_TESTS_KEY=/path/to/my/key.json
    
    After
    export GCLOUD_PROJECT="MY_PROJECT_ID"
    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/key.json
    
  • BlobReadChannel throws a StorageException if a blob is updated during a read (#359, #390)

  • generation is moved from BlobInfo to BlobId, and generationMatch and generationNotMatch methods are added to BlobSourceOption and BlobGetOption (#363, #366).

    Before
    BlobInfo myBlobInfo = someAlreadyExistingBlobInfo.toBuilder().generation(1L);
    After
    BlobId myBlobId = BlobId.of("bucketName", "idName", 1L);
  • The Blob's batch delete method now returns false for blobs that were not found (#380).

Fixes

Core

  • An exception is no longer thrown when reading the default project ID in the App Engine environment (#378).
  • SocketTimeoutExceptions are now retried (#410, #414).

Datastore

  • A SocketException exception is no longer thrown when creating the Datastore service object from within the App Engine production environment (#411).

Storage

  • The toBuilder methods in BlobInfo and BucketInfo are fixed so that info.equals(info.toBuilder().build()) is true (#415, #416).

0.0.12

0.0.12 Pre-release
Pre-release

Choose a tag to compare

@ajkannan ajkannan released this 12 Nov 23:49
v0.0.12

Updating version in README files.

0.0.11

0.0.11 Pre-release
Pre-release

Choose a tag to compare

@ajkannan ajkannan released this 10 Nov 22:33
v0.0.11

Updating version in README files.

0.0.10

0.0.10 Pre-release
Pre-release

Choose a tag to compare

@ajkannan ajkannan released this 15 Oct 20:51

Fixes build issues that caused ClassNotFoundExceptions in 0.0.9 maven artifact.

Version 0.0.9

Version 0.0.9 Pre-release
Pre-release

Choose a tag to compare

@aozarov aozarov released this 09 Oct 16:29
Add javadoc links to maven site