public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster other) { if (other == com.google.bigtable.admin.v2.Cluster.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getLocation().isEmpty()) { location_ = other.location_; onChanged(); } if (other.state_ != 0) { setStateValue(other.getStateValue()); } if (other.getServeNodes() != 0) { setServeNodes(other.getServeNodes()); } if (other.defaultStorageType_ != 0) { setDefaultStorageTypeValue(other.getDefaultStorageTypeValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.bigtable.admin.v2.Cluster buildPartial() { com.google.bigtable.admin.v2.Cluster result = new com.google.bigtable.admin.v2.Cluster(this); result.name_ = name_; result.location_ = location_; result.state_ = state_; result.serveNodes_ = serveNodes_; result.defaultStorageType_ = defaultStorageType_; onBuilt(); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.Cluster)) { return super.equals(obj); } com.google.bigtable.admin.v2.Cluster other = (com.google.bigtable.admin.v2.Cluster) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && getLocation().equals(other.getLocation()); result = result && state_ == other.state_; result = result && (getServeNodes() == other.getServeNodes()); result = result && defaultStorageType_ == other.defaultStorageType_; result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + LOCATION_FIELD_NUMBER; hash = (53 * hash) + getLocation().hashCode(); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; hash = (37 * hash) + SERVE_NODES_FIELD_NUMBER; hash = (53 * hash) + getServeNodes(); hash = (37 * hash) + DEFAULT_STORAGE_TYPE_FIELD_NUMBER; hash = (53 * hash) + defaultStorageType_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * (`OutputOnly`) * The unique name of the cluster. Values are of the form * `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@Override public Map<String, String> extract(Cluster request) { ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); params.put("name", String.valueOf(request.getName())); return params.build(); } })
@java.lang.Override public com.google.bigtable.admin.v2.Cluster getDefaultInstanceForType() { return com.google.bigtable.admin.v2.Cluster.getDefaultInstance(); }
/** * Gets the current configuration of the cluster as encapsulated by a {@link Cluster} object. * * @param clusterId * @param zoneId * @return the {@link Cluster} if it was set. If the cluster is not found, throw a {@link * NullPointerException}. */ public Cluster getCluster(String clusterId, String zoneId) { Cluster response = null; for (Cluster cluster : getClusters().getClustersList()) { if (cluster.getName().endsWith("/clusters/" + clusterId) && cluster.getLocation().endsWith("/locations/" + zoneId)) { if (response == null) { response = cluster; } else { throw new IllegalStateException( String.format("Got multiple clusters named %s in zone %z.", clusterId, zoneId)); } } } return Preconditions.checkNotNull(response, String.format("Cluster %s in zone %s was not found.", clusterId, zoneId)); }
/** * * * <pre> * (`CreationOnly`) * The location where this cluster's nodes and storage reside. For best * performance, clients should be located as close as possible to this * cluster. Currently only zones are supported, so values should be of the * form `projects/<project>/locations/<zone>`. * </pre> * * <code>string location = 2;</code> */ public Builder clearLocation() { location_ = getDefaultInstance().getLocation(); onChanged(); return this; } /**
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (!getLocationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, location_); } if (state_ != com.google.bigtable.admin.v2.Cluster.State.STATE_NOT_KNOWN.getNumber()) { output.writeEnum(3, state_); } if (serveNodes_ != 0) { output.writeInt32(4, serveNodes_); } if (defaultStorageType_ != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(5, defaultStorageType_); } unknownFields.writeTo(output); }
/** * Get the number of nodes allocated to this cluster. More nodes enable higher throughput and more * consistent performance. */ @SuppressWarnings("WeakerAccess") public int getServeNodes() { return stateProto.getServeNodes(); }
/** Get the zone where this cluster is located. */ @SuppressWarnings("WeakerAccess") public String getZone() { LocationName location = Verify.verifyNotNull(LocationName.parse(stateProto.getLocation())); //noinspection ConstantConditions return location.getLocation(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.CreateClusterRequest)) { return super.equals(obj); } com.google.bigtable.admin.v2.CreateClusterRequest other = (com.google.bigtable.admin.v2.CreateClusterRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getClusterId().equals(other.getClusterId()); result = result && (hasCluster() == other.hasCluster()); if (hasCluster()) { result = result && getCluster().equals(other.getCluster()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Cluster.getDescriptor().getEnumTypes().get(0); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + LOCATION_FIELD_NUMBER; hash = (53 * hash) + getLocation().hashCode(); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; hash = (37 * hash) + SERVE_NODES_FIELD_NUMBER; hash = (53 * hash) + getServeNodes(); hash = (37 * hash) + DEFAULT_STORAGE_TYPE_FIELD_NUMBER; hash = (53 * hash) + defaultStorageType_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.bigtable.admin.v2.Cluster)) { return super.equals(obj); } com.google.bigtable.admin.v2.Cluster other = (com.google.bigtable.admin.v2.Cluster) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && getLocation().equals(other.getLocation()); result = result && state_ == other.state_; result = result && (getServeNodes() == other.getServeNodes()); result = result && defaultStorageType_ == other.defaultStorageType_; result = result && unknownFields.equals(other.unknownFields); return result; }
private Cluster(@Nonnull com.google.bigtable.admin.v2.Cluster proto) { Preconditions.checkNotNull(proto); Preconditions.checkArgument(!proto.getName().isEmpty(), "Name must be set"); this.stateProto = proto; }
/** * <pre> * (`OutputOnly`) * The unique name of the cluster. Values are of the form * `projects/<project>/instances/<instance>/clusters/[a-z][-a-z0-9]*`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
/** * * * <pre> * The cluster to be created. * Fields marked `OutputOnly` must be left blank. * </pre> * * <code>.google.bigtable.admin.v2.Cluster cluster = 3;</code> */ public com.google.bigtable.admin.v2.Cluster getCluster() { return cluster_ == null ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : cluster_; } /**