Skip to content
Permalink
Browse files
feat(spanner): add processing_units to Instance resource (#1248)
PiperOrigin-RevId: 378758342

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Jun 10 16:19:06 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: d8698715e4f5b7c45505dadd679255987c260180
Source-Link: googleapis/googleapis@d869871
  • Loading branch information
yoshi-automation committed Jun 15, 2021
1 parent 7d7f390 commit e3c7e8fbdfb5d41a1c418f176679bf5b19f22f83
@@ -374,6 +374,7 @@ public void getInstanceTest() throws Exception {
.setConfig(InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString())
.setDisplayName("displayName1714148973")
.setNodeCount(1539922066)
.setProcessingUnits(-329117885)
.putAllLabels(new HashMap<String, String>())
.addAllEndpointUris(new ArrayList<String>())
.build();
@@ -417,6 +418,7 @@ public void getInstanceTest2() throws Exception {
.setConfig(InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString())
.setDisplayName("displayName1714148973")
.setNodeCount(1539922066)
.setProcessingUnits(-329117885)
.putAllLabels(new HashMap<String, String>())
.addAllEndpointUris(new ArrayList<String>())
.build();
@@ -460,6 +462,7 @@ public void createInstanceTest() throws Exception {
.setConfig(InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString())
.setDisplayName("displayName1714148973")
.setNodeCount(1539922066)
.setProcessingUnits(-329117885)
.putAllLabels(new HashMap<String, String>())
.addAllEndpointUris(new ArrayList<String>())
.build();
@@ -517,6 +520,7 @@ public void createInstanceTest2() throws Exception {
.setConfig(InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString())
.setDisplayName("displayName1714148973")
.setNodeCount(1539922066)
.setProcessingUnits(-329117885)
.putAllLabels(new HashMap<String, String>())
.addAllEndpointUris(new ArrayList<String>())
.build();
@@ -574,6 +578,7 @@ public void updateInstanceTest() throws Exception {
.setConfig(InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString())
.setDisplayName("displayName1714148973")
.setNodeCount(1539922066)
.setProcessingUnits(-329117885)
.putAllLabels(new HashMap<String, String>())
.addAllEndpointUris(new ArrayList<String>())
.build();
@@ -131,6 +131,11 @@ private Instance(
endpointUris_.add(s);
break;
}
case 72:
{
processingUnits_ = input.readInt32();
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -525,6 +530,26 @@ public int getNodeCount() {
return nodeCount_;
}

public static final int PROCESSING_UNITS_FIELD_NUMBER = 9;
private int processingUnits_;
/**
*
*
* <pre>
* The number of processing units allocated to this instance. At most one of
* processing_units or node_count should be present in the message. This may
* be zero in API responses for instances that are not yet in state `READY`.
* </pre>
*
* <code>int32 processing_units = 9;</code>
*
* @return The processingUnits.
*/
@java.lang.Override
public int getProcessingUnits() {
return processingUnits_;
}

public static final int STATE_FIELD_NUMBER = 6;
private int state_;
/**
@@ -837,6 +862,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < endpointUris_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, endpointUris_.getRaw(i));
}
if (processingUnits_ != 0) {
output.writeInt32(9, processingUnits_);
}
unknownFields.writeTo(output);
}

@@ -880,6 +908,9 @@ public int getSerializedSize() {
size += dataSize;
size += 1 * getEndpointUrisList().size();
}
if (processingUnits_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, processingUnits_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -900,6 +931,7 @@ public boolean equals(final java.lang.Object obj) {
if (!getConfig().equals(other.getConfig())) return false;
if (!getDisplayName().equals(other.getDisplayName())) return false;
if (getNodeCount() != other.getNodeCount()) return false;
if (getProcessingUnits() != other.getProcessingUnits()) return false;
if (state_ != other.state_) return false;
if (!internalGetLabels().equals(other.internalGetLabels())) return false;
if (!getEndpointUrisList().equals(other.getEndpointUrisList())) return false;
@@ -922,6 +954,8 @@ public int hashCode() {
hash = (53 * hash) + getDisplayName().hashCode();
hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER;
hash = (53 * hash) + getNodeCount();
hash = (37 * hash) + PROCESSING_UNITS_FIELD_NUMBER;
hash = (53 * hash) + getProcessingUnits();
hash = (37 * hash) + STATE_FIELD_NUMBER;
hash = (53 * hash) + state_;
if (!internalGetLabels().getMap().isEmpty()) {
@@ -1105,6 +1139,8 @@ public Builder clear() {

nodeCount_ = 0;

processingUnits_ = 0;

state_ = 0;

internalGetMutableLabels().clear();
@@ -1142,6 +1178,7 @@ public com.google.spanner.admin.instance.v1.Instance buildPartial() {
result.config_ = config_;
result.displayName_ = displayName_;
result.nodeCount_ = nodeCount_;
result.processingUnits_ = processingUnits_;
result.state_ = state_;
result.labels_ = internalGetLabels();
result.labels_.makeImmutable();
@@ -1214,6 +1251,9 @@ public Builder mergeFrom(com.google.spanner.admin.instance.v1.Instance other) {
if (other.getNodeCount() != 0) {
setNodeCount(other.getNodeCount());
}
if (other.getProcessingUnits() != 0) {
setProcessingUnits(other.getProcessingUnits());
}
if (other.state_ != 0) {
setStateValue(other.getStateValue());
}
@@ -1676,6 +1716,64 @@ public Builder clearNodeCount() {
return this;
}

private int processingUnits_;
/**
*
*
* <pre>
* The number of processing units allocated to this instance. At most one of
* processing_units or node_count should be present in the message. This may
* be zero in API responses for instances that are not yet in state `READY`.
* </pre>
*
* <code>int32 processing_units = 9;</code>
*
* @return The processingUnits.
*/
@java.lang.Override
public int getProcessingUnits() {
return processingUnits_;
}
/**
*
*
* <pre>
* The number of processing units allocated to this instance. At most one of
* processing_units or node_count should be present in the message. This may
* be zero in API responses for instances that are not yet in state `READY`.
* </pre>
*
* <code>int32 processing_units = 9;</code>
*
* @param value The processingUnits to set.
* @return This builder for chaining.
*/
public Builder setProcessingUnits(int value) {

processingUnits_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The number of processing units allocated to this instance. At most one of
* processing_units or node_count should be present in the message. This may
* be zero in API responses for instances that are not yet in state `READY`.
* </pre>
*
* <code>int32 processing_units = 9;</code>
*
* @return This builder for chaining.
*/
public Builder clearProcessingUnits() {

processingUnits_ = 0;
onChanged();
return this;
}

private int state_ = 0;
/**
*
@@ -129,6 +129,21 @@
*/
int getNodeCount();

/**
*
*
* <pre>
* The number of processing units allocated to this instance. At most one of
* processing_units or node_count should be present in the message. This may
* be zero in API responses for instances that are not yet in state `READY`.
* </pre>
*
* <code>int32 processing_units = 9;</code>
*
* @return The processingUnits.
*/
int getProcessingUnits();

/**
*
*

0 comments on commit e3c7e8f

Please sign in to comment.