Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
import javax.annotation.Nonnull;

/**
* Client for creating, configuring and delete Cloud Bigtable instances (including AppProfiles and
* Clusters).
* Client for creating, configuring and deleting Cloud Bigtable instances, app profiles, and
* clusters.
*
* <p>See the individual methods for example code.
*
Expand Down Expand Up @@ -102,13 +102,13 @@ public final class BigtableInstanceAdminClient implements AutoCloseable {
private final String projectId;
private final BigtableInstanceAdminStub stub;

/** Constructs an instance of BigtableInstanceAdminClient with the given project id. */
/** Constructs an instance of BigtableInstanceAdminClient with the given project ID. */
public static BigtableInstanceAdminClient create(@Nonnull String projectId) throws IOException {
return create(BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId).build());
}

/**
* Constructs an instance of BigtableInstanceAdminClient with the given project id.
* Constructs an instance of BigtableInstanceAdminClient with the given project ID.
*
* @deprecated Please use {@link #create(String)}.
*/
Expand All @@ -124,14 +124,14 @@ public static BigtableInstanceAdminClient create(@Nonnull BigtableInstanceAdminS
return create(settings.getProjectId(), settings.getStubSettings().createStub());
}

/** Constructs an instance of BigtableInstanceAdminClient with the given project id and stub. */
/** Constructs an instance of BigtableInstanceAdminClient with the given project ID and stub. */
public static BigtableInstanceAdminClient create(
@Nonnull String projectId, @Nonnull BigtableInstanceAdminStub stub) {
return new BigtableInstanceAdminClient(projectId, stub);
}

/**
* Constructs an instance of BigtableInstanceAdminClient with the given ProjectName and stub.
* Constructs an instance of BigtableInstanceAdminClient with the given project name and stub.
*
* @deprecated Please use {@link #create(String, BigtableInstanceAdminStub)}.
*/
Expand All @@ -148,13 +148,13 @@ private BigtableInstanceAdminClient(
this.stub = stub;
}

/** Gets the project id this client is associated with. */
/** Gets the project ID this client is associated with. */
public String getProjectId() {
return projectId;
}

/**
* Gets the ProjectName this client is associated with.
* Gets the project name this client is associated with.
*
* @deprecated Please use {@link #getProjectId()}.
*/
Expand Down Expand Up @@ -312,7 +312,7 @@ public Instance apply(com.google.bigtable.admin.v2.Instance proto) {
* Lists all of the instances in the current project.
*
* <p>This method will throw a {@link PartialListInstancesException} when any zone is unavailable.
* If partial listing are ok, the exception can be caught and inspected.
* If a partial list is OK, the exception can be caught and inspected.
*
* <p>Sample code:
*
Expand All @@ -334,7 +334,7 @@ public List<Instance> listInstances() {
* Asynchronously lists all of the instances in the current project.
*
* <p>This method will throw a {@link PartialListInstancesException} when any zone is unavailable.
* If partial listing are ok, the exception can be caught and inspected.
* If a partial list is OK, the exception can be caught and inspected.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -373,7 +373,7 @@ public ApiFuture<List<Instance>> listInstancesAsync() {
new ApiFunction<com.google.bigtable.admin.v2.ListInstancesResponse, List<Instance>>() {
@Override
public List<Instance> apply(com.google.bigtable.admin.v2.ListInstancesResponse proto) {
// NOTE: pagination is intentionally ignored. The server does not implement it and never
// NOTE: Pagination is intentionally ignored. The server does not implement it and never
// will.
Verify.verify(
proto.getNextPageToken().isEmpty(),
Expand Down Expand Up @@ -445,7 +445,7 @@ public Void apply(Empty input) {
}

/**
* Checks if the instance specified by the instanceId exists
* Checks if the instance specified by the instance ID exists.
*
* <p>Sample code:
*
Expand All @@ -460,7 +460,7 @@ public boolean exists(String instanceId) {
}

/**
* Asynchronously checks if the instance specified by the instanceId exists
* Asynchronously checks if the instance specified by the instance ID exists.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -561,7 +561,7 @@ public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) {
}

/**
* Get the cluster representation by ID.
* Gets the cluster representation by ID.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -606,7 +606,7 @@ public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) {
* Lists all clusters in the specified instance.
*
* <p>This method will throw a {@link PartialListClustersException} when any zone is unavailable.
* If partial listing are ok, the exception can be caught and inspected.
* If a partial list is OK, the exception can be caught and inspected.
*
* <p>Sample code:
*
Expand All @@ -628,7 +628,7 @@ public List<Cluster> listClusters(String instanceId) {
* Asynchronously lists all clusters in the specified instance.
*
* <p>This method will throw a {@link PartialListClustersException} when any zone is unavailable.
* If partial listing are ok, the exception can be caught and inspected.
* If a partial list is OK, the exception can be caught and inspected.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -663,7 +663,7 @@ public ApiFuture<List<Cluster>> listClustersAsync(String instanceId) {
new ApiFunction<com.google.bigtable.admin.v2.ListClustersResponse, List<Cluster>>() {
@Override
public List<Cluster> apply(com.google.bigtable.admin.v2.ListClustersResponse proto) {
// NOTE: serverside pagination is not and will not be implemented, so remaining pages
// NOTE: Server-side pagination is not and will not be implemented, so remaining pages
// are not fetched. However, if that assumption turns out to be wrong, fail fast to
// avoid returning partial data.
Verify.verify(
Expand Down Expand Up @@ -691,7 +691,7 @@ public List<Cluster> apply(com.google.bigtable.admin.v2.ListClustersResponse pro
}

/**
* Resizes the cluster's node count. Please note that only clusters that belong to a PRODUCTION
* Modifies the cluster's node count. Please note that only clusters that belong to a production
* instance can be resized.
*
* <p>Sample code:
Expand All @@ -707,8 +707,8 @@ public Cluster resizeCluster(String instanceId, String clusterId, int numServeNo
}

/**
* Asynchronously resizes the cluster's node count. Please note that only clusters that belong to
* a PRODUCTION instance can be resized.
* Asynchronously modifies the cluster's node count. Please note that only clusters that belong to
* a production instance can be resized.
*
* <pre>{@code
* ApiFuture<Cluster> clusterFuture = client.resizeCluster("my-instance", "my-cluster", 30);
Expand Down Expand Up @@ -834,7 +834,7 @@ public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) {
}

/**
* Get the app profile by id.
* Gets the app profile by ID.
*
* <p>Sample code:
*
Expand All @@ -850,7 +850,7 @@ public AppProfile getAppProfile(String instanceId, String appProfileId) {
}

/**
* Asynchronously get the app profile by id.
* Asynchronously gets the app profile by ID.
*
* <p>Sample code:
*
Expand Down Expand Up @@ -919,7 +919,7 @@ public ApiFuture<List<AppProfile>> listAppProfilesAsync(String instanceId) {
// TODO(igorbernstein2): try to upstream pagination spooling or figure out a way to expose the
// paginated responses while maintaining the wrapper facade.

// Fetch the first page.
// Fetches the first page.
ApiFuture<ListAppProfilesPage> firstPageFuture =
ApiFutures.transform(
stub.listAppProfilesPagedCallable().futureCall(request),
Expand All @@ -931,7 +931,7 @@ public ListAppProfilesPage apply(ListAppProfilesPagedResponse response) {
},
MoreExecutors.directExecutor());

// Fetch the rest of the pages by chaining the futures.
// Fetches the rest of the pages by chaining the futures.
ApiFuture<List<com.google.bigtable.admin.v2.AppProfile>> allProtos =
ApiFutures.transformAsync(
firstPageFuture,
Expand All @@ -958,7 +958,7 @@ public ApiFuture<List<com.google.bigtable.admin.v2.AppProfile>> apply(
},
MoreExecutors.directExecutor());

// Wrap all of the accumulated protos.
// Wraps all of the accumulated protos.
return ApiFutures.transform(
allProtos,
new ApiFunction<List<com.google.bigtable.admin.v2.AppProfile>, List<AppProfile>>() {
Expand Down Expand Up @@ -1307,9 +1307,9 @@ public List<String> testIamPermission(ResourceName resourceName, String... permi
}

/**
* Asynchronously tests whether the caller has the given permissions for the the specified
* absolute resource name (note that the current project of the client is ignored). Returns a
* subset of the specified permissions that the caller has.
* Asynchronously tests whether the caller has the given permissions for the specified absolute
* resource name (note that the current project of the client is ignored). Returns a subset of the
* specified permissions that the caller has.
*
* <p>Sample code:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Settings class to configure an instance of {@link BigtableInstanceAdminClient}.
*
* <p>It must be configured with a project id and can be used to change default RPC settings.
* <p>It must be configured with a project ID and can be used to change default RPC settings.
*
* <p>Example usage:
*
Expand All @@ -48,20 +48,20 @@ public final class BigtableInstanceAdminSettings {
private final BigtableInstanceAdminStubSettings stubSettings;

private BigtableInstanceAdminSettings(Builder builder) throws IOException {
Preconditions.checkNotNull(builder.projectId, "Project ud must be set");
Preconditions.checkNotNull(builder.projectId, "Project ID must be set");
Verify.verifyNotNull(builder.stubSettings, "stubSettings should never be null");

this.projectId = builder.projectId;
this.stubSettings = builder.stubSettings.build();
}

/** Gets the id of the project whose instances the client will manage. */
/** Gets the ID of the project whose instances the client will manage. */
@Nonnull
public String getProjectId() {
return projectId;
}

/** Gets the CredentialsProvider to use for getting the credentials to make calls with. */
/** Gets the credentials provider to use for getting the credentials to make calls with. */
public CredentialsProvider getCredentialsProvider() {
return stubSettings.getCredentialsProvider();
}
Expand Down Expand Up @@ -96,14 +96,14 @@ private Builder(BigtableInstanceAdminSettings settings) {
this.stubSettings = settings.stubSettings.toBuilder();
}

/** Sets the id of the project whose instances the client will manage. */
/** Sets the ID of the project whose instances the client will manage. */
public Builder setProjectId(@Nonnull String projectId) {
Preconditions.checkNotNull(projectId);
this.projectId = projectId;
return this;
}

/** Gets the id of the project whose instances the client will manage. */
/** Gets the ID of the project whose instances the client will manage. */
@Nullable
public String getProjectId() {
return projectId;
Expand Down
Loading