GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bigtable: Updated Javadoc of models/CreateInstanceRequest.java by rahulKQL · Pull Request #6201 · googleapis/google-cloud-java

Bigtable: Updated Javadoc of models/CreateInstanceRequest.java #6201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
igorbernstein2 merged 6 commits into googleapis:master from rahulKQL:createInstanceJavadoc
Oct 8, 2019

Uh oh!

There was an error while loading. Please reload this page.

Merged

Bigtable: Updated Javadoc of models/CreateInstanceRequest.java #6201

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
6 commits
Select commit Hold shift + click to select a range
91846c9
Bigtable: Updated Javadoc of models/CreateInstanceRequest.java
rahulKQL Aug 30, 2019
b142ad4
Added CreateInstanceRequest#addDevelopmentCluster
rahulKQL Oct 1, 2019
f1bdbbf
Updated Integration test to include #addDevelopmentCluster
rahulKQL Oct 1, 2019
08d7426
Remove setServeNodes as it defaults to 0
rahulKQL Oct 2, 2019
a963389
Removed ServeNodes() form test class as well
rahulKQL Oct 2, 2019
e1096d9
Updated JavaDoc for method description
rahulKQL Oct 3, 2019
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

35 changes: 29 additions & 6 deletions 35 ...gtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
* cluster. You cannot downgrade a production instance to a development instance.
* <dt>Development
* <dd>A low-cost instance for development and testing, with performance limited to the equivalent
* of a 1-node cluster. Development instances only support a single 1 node cluster.
* of a 1-node cluster. Development instances only support a single 1 node cluster. At any
* point this can be upgraded to a production instance.
* </dl>
*
* When creating an Instance, you must create at least one cluster in it.
Expand All @@ -50,7 +51,7 @@
* // Development instance:
* CreateInstanceRequest smallProdInstanceRequest = CreateInstanceRequest.of("my-dev-instance")
* .setType(Type.DEVELOPMENT)
* .addCluster("cluster1", "us-east1-c", 1, StorageType.SSD);
* .addDevelopmentCluster("cluster1", "us-east1-c", StorageType.SSD);
*
* }</pre>
*
Expand Down Expand Up @@ -123,11 +124,11 @@ public CreateInstanceRequest addLabel(@Nonnull String key, @Nonnull String value
* <p>All new instances must have at least one cluster. DEVELOPMENT instances must have exactly
* one cluster.
*
* @param clusterId The name of the cluster.
* @param zone The zone where the cluster will be created.
* @param serveNodes The number of nodes that cluster will contain. DEVELOPMENT instance clusters
* @param clusterId the name of the cluster.
* @param zone the zone where the cluster will be created.
* @param serveNodes the number of nodes that cluster will contain. DEVELOPMENT instance clusters
* must have exactly one node.
* @param storageType The type of storage used by this cluster to serve its parent instance's
* @param storageType the type of storage used by this cluster to serve its parent instance's
* tables.
*/
@SuppressWarnings("WeakerAccess")
Expand All @@ -146,6 +147,28 @@ public CreateInstanceRequest addCluster(
return this;
}

/**
* Adds a DEVELOPMENT cluster to the instance request.
*
* <p>This instance will have exactly one node cluster.
*
* @param clusterId the name of the cluster.
* @param zone the zone where the cluster will be created.
* @param storageType the type of storage used by this cluster to serve its parent instance's
* tables.
*/
@SuppressWarnings("WeakerAccess")
public CreateInstanceRequest addDevelopmentCluster(
@Nonnull String clusterId, @Nonnull String zone, @Nonnull StorageType storageType) {
CreateClusterRequest developmentCluster =
CreateClusterRequest.of("ignored-instance-id", clusterId)
.setZone(zone)
.setStorageType(storageType);
clusterRequests.add(developmentCluster);

return this;
}

/**
* Creates the request protobuf. This method is considered an internal implementation detail and
* not meant to be used by applications.
Expand Down
2 changes: 1 addition & 1 deletion 2 ...le/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void instanceCreationDeletionTest() {

client.createInstance(
CreateInstanceRequest.of(newInstanceId)
.addCluster(newClusterId, "us-central1-a", 0, StorageType.SSD)
.addDevelopmentCluster(newClusterId, "us-central1-a", StorageType.SSD)
.setDisplayName("Fresh-Instance-Name")
.addLabel("state", "readytodelete")
.setType(Instance.Type.DEVELOPMENT));
Expand Down
3 changes: 1 addition & 2 deletions 3 ...ble/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void testDevelopment() {
CreateInstanceRequest input =
CreateInstanceRequest.of("my-instance")
.setType(Instance.Type.DEVELOPMENT)
.addCluster("cluster1", "us-east1-c", 1, StorageType.SSD);
.addDevelopmentCluster("cluster1", "us-east1-c", StorageType.SSD);

com.google.bigtable.admin.v2.CreateInstanceRequest actual = input.toProto("my-project");

Expand All @@ -111,7 +111,6 @@ public void testDevelopment() {
"cluster1",
com.google.bigtable.admin.v2.Cluster.newBuilder()
.setLocation("projects/my-project/locations/us-east1-c")
.setServeNodes(1)
.setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD)
.build())
.build();
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.