Skip to content
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.

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

Already on GitHub? Sign in to your account

feat(spanner): add processing_units to Instance resource #1248

Merged
merged 1 commit into from Jun 15, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Expand Up @@ -131,6 +131,11 @@ private Instance(
endpointUris_.add(s);
break;
}
case 72:
{
processingUnits_ = input.readInt32();
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
Expand Down Expand Up @@ -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_;
/**
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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()) {
Expand Down Expand Up @@ -1105,6 +1139,8 @@ public Builder clear() {

nodeCount_ = 0;

processingUnits_ = 0;

state_ = 0;

internalGetMutableLabels().clear();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -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;
/**
*
Expand Down
Expand Up @@ -129,6 +129,21 @@ public interface InstanceOrBuilder
*/
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();

/**
*
*
Expand Down