
com.google.cloud.visionai.v1.ResourceSpecification Maven / Gradle / Ivy
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/visionai/v1/lva.proto
// Protobuf Java Version: 3.25.3
package com.google.cloud.visionai.v1;
/**
*
*
*
* ResourceSpec collects a set of resources that can
* be used to specify requests and requirements.
*
* Note: Highly experimental as this can be runtime dependent.
* Can use the "extras" field to experiment first before trying
* to abstract it.
*
*
* Protobuf type {@code google.cloud.visionai.v1.ResourceSpecification}
*/
public final class ResourceSpecification extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.visionai.v1.ResourceSpecification)
ResourceSpecificationOrBuilder {
private static final long serialVersionUID = 0L;
// Use ResourceSpecification.newBuilder() to construct.
private ResourceSpecification(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ResourceSpecification() {
cpu_ = "";
cpuLimits_ = "";
memory_ = "";
memoryLimits_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new ResourceSpecification();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.visionai.v1.LvaProto
.internal_static_google_cloud_visionai_v1_ResourceSpecification_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.visionai.v1.LvaProto
.internal_static_google_cloud_visionai_v1_ResourceSpecification_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.visionai.v1.ResourceSpecification.class,
com.google.cloud.visionai.v1.ResourceSpecification.Builder.class);
}
public static final int CPU_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object cpu_ = "";
/**
*
*
*
* CPU specification.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to let the system decide.
*
* Note that this does *not* determine the cpu vender/make,
* or its underlying clock speed and specific SIMD features.
* It is only the amount time it requires in timeslicing.
*
*
* string cpu = 1;
*
* @return The cpu.
*/
@java.lang.Override
public java.lang.String getCpu() {
java.lang.Object ref = cpu_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cpu_ = s;
return s;
}
}
/**
*
*
*
* CPU specification.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to let the system decide.
*
* Note that this does *not* determine the cpu vender/make,
* or its underlying clock speed and specific SIMD features.
* It is only the amount time it requires in timeslicing.
*
*
* string cpu = 1;
*
* @return The bytes for cpu.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCpuBytes() {
java.lang.Object ref = cpu_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cpu_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CPU_LIMITS_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private volatile java.lang.Object cpuLimits_ = "";
/**
*
*
*
* CPU limit.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to indicate no limit.
*
*
* string cpu_limits = 5;
*
* @return The cpuLimits.
*/
@java.lang.Override
public java.lang.String getCpuLimits() {
java.lang.Object ref = cpuLimits_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cpuLimits_ = s;
return s;
}
}
/**
*
*
*
* CPU limit.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to indicate no limit.
*
*
* string cpu_limits = 5;
*
* @return The bytes for cpuLimits.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCpuLimitsBytes() {
java.lang.Object ref = cpuLimits_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cpuLimits_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int MEMORY_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object memory_ = "";
/**
*
*
*
* Memory specification (in bytes).
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to let the system decide.
*
*
* string memory = 2;
*
* @return The memory.
*/
@java.lang.Override
public java.lang.String getMemory() {
java.lang.Object ref = memory_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
memory_ = s;
return s;
}
}
/**
*
*
*
* Memory specification (in bytes).
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to let the system decide.
*
*
* string memory = 2;
*
* @return The bytes for memory.
*/
@java.lang.Override
public com.google.protobuf.ByteString getMemoryBytes() {
java.lang.Object ref = memory_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
memory_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int MEMORY_LIMITS_FIELD_NUMBER = 6;
@SuppressWarnings("serial")
private volatile java.lang.Object memoryLimits_ = "";
/**
*
*
*
* Memory usage limits.
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to indicate no limit.
*
*
* string memory_limits = 6;
*
* @return The memoryLimits.
*/
@java.lang.Override
public java.lang.String getMemoryLimits() {
java.lang.Object ref = memoryLimits_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
memoryLimits_ = s;
return s;
}
}
/**
*
*
*
* Memory usage limits.
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to indicate no limit.
*
*
* string memory_limits = 6;
*
* @return The bytes for memoryLimits.
*/
@java.lang.Override
public com.google.protobuf.ByteString getMemoryLimitsBytes() {
java.lang.Object ref = memoryLimits_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
memoryLimits_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int GPUS_FIELD_NUMBER = 3;
private int gpus_ = 0;
/**
*
*
*
* Number of gpus.
*
*
* int32 gpus = 3;
*
* @return The gpus.
*/
@java.lang.Override
public int getGpus() {
return gpus_;
}
public static final int LATENCY_BUDGET_MS_FIELD_NUMBER = 4;
private int latencyBudgetMs_ = 0;
/**
*
*
*
* The maximum latency that this operator may use to process an element.
*
* If non positive, then a system default will be used.
* Operator developers should arrange for the system compute resources to be
* aligned with this latency budget; e.g. if you want a ML model to produce
* results within 500ms, then you should make sure you request enough
* cpu/gpu/memory to achieve that.
*
*
* int32 latency_budget_ms = 4;
*
* @return The latencyBudgetMs.
*/
@java.lang.Override
public int getLatencyBudgetMs() {
return latencyBudgetMs_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cpu_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cpu_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(memory_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, memory_);
}
if (gpus_ != 0) {
output.writeInt32(3, gpus_);
}
if (latencyBudgetMs_ != 0) {
output.writeInt32(4, latencyBudgetMs_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cpuLimits_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, cpuLimits_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(memoryLimits_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, memoryLimits_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cpu_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cpu_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(memory_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, memory_);
}
if (gpus_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, gpus_);
}
if (latencyBudgetMs_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, latencyBudgetMs_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cpuLimits_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, cpuLimits_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(memoryLimits_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, memoryLimits_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.visionai.v1.ResourceSpecification)) {
return super.equals(obj);
}
com.google.cloud.visionai.v1.ResourceSpecification other =
(com.google.cloud.visionai.v1.ResourceSpecification) obj;
if (!getCpu().equals(other.getCpu())) return false;
if (!getCpuLimits().equals(other.getCpuLimits())) return false;
if (!getMemory().equals(other.getMemory())) return false;
if (!getMemoryLimits().equals(other.getMemoryLimits())) return false;
if (getGpus() != other.getGpus()) return false;
if (getLatencyBudgetMs() != other.getLatencyBudgetMs()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CPU_FIELD_NUMBER;
hash = (53 * hash) + getCpu().hashCode();
hash = (37 * hash) + CPU_LIMITS_FIELD_NUMBER;
hash = (53 * hash) + getCpuLimits().hashCode();
hash = (37 * hash) + MEMORY_FIELD_NUMBER;
hash = (53 * hash) + getMemory().hashCode();
hash = (37 * hash) + MEMORY_LIMITS_FIELD_NUMBER;
hash = (53 * hash) + getMemoryLimits().hashCode();
hash = (37 * hash) + GPUS_FIELD_NUMBER;
hash = (53 * hash) + getGpus();
hash = (37 * hash) + LATENCY_BUDGET_MS_FIELD_NUMBER;
hash = (53 * hash) + getLatencyBudgetMs();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.ResourceSpecification parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.visionai.v1.ResourceSpecification prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* ResourceSpec collects a set of resources that can
* be used to specify requests and requirements.
*
* Note: Highly experimental as this can be runtime dependent.
* Can use the "extras" field to experiment first before trying
* to abstract it.
*
*
* Protobuf type {@code google.cloud.visionai.v1.ResourceSpecification}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.visionai.v1.ResourceSpecification)
com.google.cloud.visionai.v1.ResourceSpecificationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.visionai.v1.LvaProto
.internal_static_google_cloud_visionai_v1_ResourceSpecification_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.visionai.v1.LvaProto
.internal_static_google_cloud_visionai_v1_ResourceSpecification_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.visionai.v1.ResourceSpecification.class,
com.google.cloud.visionai.v1.ResourceSpecification.Builder.class);
}
// Construct using com.google.cloud.visionai.v1.ResourceSpecification.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
cpu_ = "";
cpuLimits_ = "";
memory_ = "";
memoryLimits_ = "";
gpus_ = 0;
latencyBudgetMs_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.visionai.v1.LvaProto
.internal_static_google_cloud_visionai_v1_ResourceSpecification_descriptor;
}
@java.lang.Override
public com.google.cloud.visionai.v1.ResourceSpecification getDefaultInstanceForType() {
return com.google.cloud.visionai.v1.ResourceSpecification.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.visionai.v1.ResourceSpecification build() {
com.google.cloud.visionai.v1.ResourceSpecification result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.visionai.v1.ResourceSpecification buildPartial() {
com.google.cloud.visionai.v1.ResourceSpecification result =
new com.google.cloud.visionai.v1.ResourceSpecification(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(com.google.cloud.visionai.v1.ResourceSpecification result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.cpu_ = cpu_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.cpuLimits_ = cpuLimits_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.memory_ = memory_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.memoryLimits_ = memoryLimits_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.gpus_ = gpus_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.latencyBudgetMs_ = latencyBudgetMs_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.visionai.v1.ResourceSpecification) {
return mergeFrom((com.google.cloud.visionai.v1.ResourceSpecification) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.visionai.v1.ResourceSpecification other) {
if (other == com.google.cloud.visionai.v1.ResourceSpecification.getDefaultInstance())
return this;
if (!other.getCpu().isEmpty()) {
cpu_ = other.cpu_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getCpuLimits().isEmpty()) {
cpuLimits_ = other.cpuLimits_;
bitField0_ |= 0x00000002;
onChanged();
}
if (!other.getMemory().isEmpty()) {
memory_ = other.memory_;
bitField0_ |= 0x00000004;
onChanged();
}
if (!other.getMemoryLimits().isEmpty()) {
memoryLimits_ = other.memoryLimits_;
bitField0_ |= 0x00000008;
onChanged();
}
if (other.getGpus() != 0) {
setGpus(other.getGpus());
}
if (other.getLatencyBudgetMs() != 0) {
setLatencyBudgetMs(other.getLatencyBudgetMs());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
cpu_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
memory_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 18
case 24:
{
gpus_ = input.readInt32();
bitField0_ |= 0x00000010;
break;
} // case 24
case 32:
{
latencyBudgetMs_ = input.readInt32();
bitField0_ |= 0x00000020;
break;
} // case 32
case 42:
{
cpuLimits_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 42
case 50:
{
memoryLimits_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 50
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object cpu_ = "";
/**
*
*
*
* CPU specification.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to let the system decide.
*
* Note that this does *not* determine the cpu vender/make,
* or its underlying clock speed and specific SIMD features.
* It is only the amount time it requires in timeslicing.
*
*
* string cpu = 1;
*
* @return The cpu.
*/
public java.lang.String getCpu() {
java.lang.Object ref = cpu_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cpu_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* CPU specification.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to let the system decide.
*
* Note that this does *not* determine the cpu vender/make,
* or its underlying clock speed and specific SIMD features.
* It is only the amount time it requires in timeslicing.
*
*
* string cpu = 1;
*
* @return The bytes for cpu.
*/
public com.google.protobuf.ByteString getCpuBytes() {
java.lang.Object ref = cpu_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cpu_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* CPU specification.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to let the system decide.
*
* Note that this does *not* determine the cpu vender/make,
* or its underlying clock speed and specific SIMD features.
* It is only the amount time it requires in timeslicing.
*
*
* string cpu = 1;
*
* @param value The cpu to set.
* @return This builder for chaining.
*/
public Builder setCpu(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
cpu_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* CPU specification.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to let the system decide.
*
* Note that this does *not* determine the cpu vender/make,
* or its underlying clock speed and specific SIMD features.
* It is only the amount time it requires in timeslicing.
*
*
* string cpu = 1;
*
* @return This builder for chaining.
*/
public Builder clearCpu() {
cpu_ = getDefaultInstance().getCpu();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* CPU specification.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to let the system decide.
*
* Note that this does *not* determine the cpu vender/make,
* or its underlying clock speed and specific SIMD features.
* It is only the amount time it requires in timeslicing.
*
*
* string cpu = 1;
*
* @param value The bytes for cpu to set.
* @return This builder for chaining.
*/
public Builder setCpuBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
cpu_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object cpuLimits_ = "";
/**
*
*
*
* CPU limit.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to indicate no limit.
*
*
* string cpu_limits = 5;
*
* @return The cpuLimits.
*/
public java.lang.String getCpuLimits() {
java.lang.Object ref = cpuLimits_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cpuLimits_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* CPU limit.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to indicate no limit.
*
*
* string cpu_limits = 5;
*
* @return The bytes for cpuLimits.
*/
public com.google.protobuf.ByteString getCpuLimitsBytes() {
java.lang.Object ref = cpuLimits_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cpuLimits_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* CPU limit.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to indicate no limit.
*
*
* string cpu_limits = 5;
*
* @param value The cpuLimits to set.
* @return This builder for chaining.
*/
public Builder setCpuLimits(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
cpuLimits_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* CPU limit.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to indicate no limit.
*
*
* string cpu_limits = 5;
*
* @return This builder for chaining.
*/
public Builder clearCpuLimits() {
cpuLimits_ = getDefaultInstance().getCpuLimits();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* CPU limit.
*
* Examples:
* "100m", "0.5", "1", "2", ... correspond to
* 0.1, half, 1, or 2 cpus.
*
* Leave empty to indicate no limit.
*
*
* string cpu_limits = 5;
*
* @param value The bytes for cpuLimits to set.
* @return This builder for chaining.
*/
public Builder setCpuLimitsBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
cpuLimits_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private java.lang.Object memory_ = "";
/**
*
*
*
* Memory specification (in bytes).
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to let the system decide.
*
*
* string memory = 2;
*
* @return The memory.
*/
public java.lang.String getMemory() {
java.lang.Object ref = memory_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
memory_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Memory specification (in bytes).
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to let the system decide.
*
*
* string memory = 2;
*
* @return The bytes for memory.
*/
public com.google.protobuf.ByteString getMemoryBytes() {
java.lang.Object ref = memory_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
memory_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Memory specification (in bytes).
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to let the system decide.
*
*
* string memory = 2;
*
* @param value The memory to set.
* @return This builder for chaining.
*/
public Builder setMemory(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
memory_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Memory specification (in bytes).
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to let the system decide.
*
*
* string memory = 2;
*
* @return This builder for chaining.
*/
public Builder clearMemory() {
memory_ = getDefaultInstance().getMemory();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
*
*
* Memory specification (in bytes).
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to let the system decide.
*
*
* string memory = 2;
*
* @param value The bytes for memory to set.
* @return This builder for chaining.
*/
public Builder setMemoryBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
memory_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private java.lang.Object memoryLimits_ = "";
/**
*
*
*
* Memory usage limits.
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to indicate no limit.
*
*
* string memory_limits = 6;
*
* @return The memoryLimits.
*/
public java.lang.String getMemoryLimits() {
java.lang.Object ref = memoryLimits_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
memoryLimits_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Memory usage limits.
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to indicate no limit.
*
*
* string memory_limits = 6;
*
* @return The bytes for memoryLimits.
*/
public com.google.protobuf.ByteString getMemoryLimitsBytes() {
java.lang.Object ref = memoryLimits_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
memoryLimits_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Memory usage limits.
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to indicate no limit.
*
*
* string memory_limits = 6;
*
* @param value The memoryLimits to set.
* @return This builder for chaining.
*/
public Builder setMemoryLimits(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
memoryLimits_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* Memory usage limits.
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to indicate no limit.
*
*
* string memory_limits = 6;
*
* @return This builder for chaining.
*/
public Builder clearMemoryLimits() {
memoryLimits_ = getDefaultInstance().getMemoryLimits();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
*
*
* Memory usage limits.
*
* Examples:
* "128974848", "129e6", "129M", "123Mi", ... correspond to
* 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
*
* Leave empty to indicate no limit.
*
*
* string memory_limits = 6;
*
* @param value The bytes for memoryLimits to set.
* @return This builder for chaining.
*/
public Builder setMemoryLimitsBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
memoryLimits_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
private int gpus_;
/**
*
*
*
* Number of gpus.
*
*
* int32 gpus = 3;
*
* @return The gpus.
*/
@java.lang.Override
public int getGpus() {
return gpus_;
}
/**
*
*
*
* Number of gpus.
*
*
* int32 gpus = 3;
*
* @param value The gpus to set.
* @return This builder for chaining.
*/
public Builder setGpus(int value) {
gpus_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* Number of gpus.
*
*
* int32 gpus = 3;
*
* @return This builder for chaining.
*/
public Builder clearGpus() {
bitField0_ = (bitField0_ & ~0x00000010);
gpus_ = 0;
onChanged();
return this;
}
private int latencyBudgetMs_;
/**
*
*
*
* The maximum latency that this operator may use to process an element.
*
* If non positive, then a system default will be used.
* Operator developers should arrange for the system compute resources to be
* aligned with this latency budget; e.g. if you want a ML model to produce
* results within 500ms, then you should make sure you request enough
* cpu/gpu/memory to achieve that.
*
*
* int32 latency_budget_ms = 4;
*
* @return The latencyBudgetMs.
*/
@java.lang.Override
public int getLatencyBudgetMs() {
return latencyBudgetMs_;
}
/**
*
*
*
* The maximum latency that this operator may use to process an element.
*
* If non positive, then a system default will be used.
* Operator developers should arrange for the system compute resources to be
* aligned with this latency budget; e.g. if you want a ML model to produce
* results within 500ms, then you should make sure you request enough
* cpu/gpu/memory to achieve that.
*
*
* int32 latency_budget_ms = 4;
*
* @param value The latencyBudgetMs to set.
* @return This builder for chaining.
*/
public Builder setLatencyBudgetMs(int value) {
latencyBudgetMs_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* The maximum latency that this operator may use to process an element.
*
* If non positive, then a system default will be used.
* Operator developers should arrange for the system compute resources to be
* aligned with this latency budget; e.g. if you want a ML model to produce
* results within 500ms, then you should make sure you request enough
* cpu/gpu/memory to achieve that.
*
*
* int32 latency_budget_ms = 4;
*
* @return This builder for chaining.
*/
public Builder clearLatencyBudgetMs() {
bitField0_ = (bitField0_ & ~0x00000020);
latencyBudgetMs_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.visionai.v1.ResourceSpecification)
}
// @@protoc_insertion_point(class_scope:google.cloud.visionai.v1.ResourceSpecification)
private static final com.google.cloud.visionai.v1.ResourceSpecification DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.visionai.v1.ResourceSpecification();
}
public static com.google.cloud.visionai.v1.ResourceSpecification getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ResourceSpecification parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.visionai.v1.ResourceSpecification getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy