Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: proto/clarifai/api/resources.proto
package com.clarifai.grpc.api;
/**
*
* It might be better to do this as runner autoscaling so that resources
* of a model are very simply what that model needs at minimum.
* Note that resources for things like modes inside runners are not
* related to how many replicas of those runners are needed to handle traffic.
*
*
* Protobuf type {@code clarifai.api.AutoscaleConfig}
*/
public final class AutoscaleConfig extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:clarifai.api.AutoscaleConfig)
AutoscaleConfigOrBuilder {
private static final long serialVersionUID = 0L;
// Use AutoscaleConfig.newBuilder() to construct.
private AutoscaleConfig(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private AutoscaleConfig() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new AutoscaleConfig();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private AutoscaleConfig(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
minReplicas_ = input.readUInt32();
break;
}
case 16: {
maxReplicas_ = input.readUInt32();
break;
}
case 24: {
trafficHistorySeconds_ = input.readUInt32();
break;
}
case 32: {
scaleDownDelaySeconds_ = input.readUInt32();
break;
}
case 40: {
scaleUpDelaySeconds_ = input.readUInt32();
break;
}
case 48: {
enablePacking_ = input.readBool();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_AutoscaleConfig_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_AutoscaleConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.AutoscaleConfig.class, com.clarifai.grpc.api.AutoscaleConfig.Builder.class);
}
public static final int MIN_REPLICAS_FIELD_NUMBER = 1;
private int minReplicas_;
/**
*
* The minimum number of replicas for the runner to have.
* Defaults to 0 which means autoscaling can scale down to zero.
* If you want a replica always up then set to >= 1.
*
*
* uint32 min_replicas = 1;
* @return The minReplicas.
*/
@java.lang.Override
public int getMinReplicas() {
return minReplicas_;
}
public static final int MAX_REPLICAS_FIELD_NUMBER = 2;
private int maxReplicas_;
/**
*
* The maximium number of replicas to scale up the runner to.
*
*
* uint32 max_replicas = 2;
* @return The maxReplicas.
*/
@java.lang.Override
public int getMaxReplicas() {
return maxReplicas_;
}
public static final int TRAFFIC_HISTORY_SECONDS_FIELD_NUMBER = 3;
private int trafficHistorySeconds_;
/**
*
* The number of seconds of traffic history to consider when autoscaling.
*
*
* uint32 traffic_history_seconds = 3;
* @return The trafficHistorySeconds.
*/
@java.lang.Override
public int getTrafficHistorySeconds() {
return trafficHistorySeconds_;
}
public static final int SCALE_DOWN_DELAY_SECONDS_FIELD_NUMBER = 4;
private int scaleDownDelaySeconds_;
/**
*
* The time to wait before scaling down after the last request.
*
*
* uint32 scale_down_delay_seconds = 4;
* @return The scaleDownDelaySeconds.
*/
@java.lang.Override
public int getScaleDownDelaySeconds() {
return scaleDownDelaySeconds_;
}
public static final int SCALE_UP_DELAY_SECONDS_FIELD_NUMBER = 5;
private int scaleUpDelaySeconds_;
/**
*
* The time to wait between scaling up replicas without burst traffic.
*
*
* uint32 scale_up_delay_seconds = 5;
* @return The scaleUpDelaySeconds.
*/
@java.lang.Override
public int getScaleUpDelaySeconds() {
return scaleUpDelaySeconds_;
}
public static final int ENABLE_PACKING_FIELD_NUMBER = 6;
private boolean enablePacking_;
/**
*
* Depending on your plan you may be able to enable packing of resources into a single node
* for more compute and cost efficiency.
*
* It might be better to do this as runner autoscaling so that resources
* of a model are very simply what that model needs at minimum.
* Note that resources for things like modes inside runners are not
* related to how many replicas of those runners are needed to handle traffic.
*
*
* Protobuf type {@code clarifai.api.AutoscaleConfig}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:clarifai.api.AutoscaleConfig)
com.clarifai.grpc.api.AutoscaleConfigOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_AutoscaleConfig_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_AutoscaleConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.AutoscaleConfig.class, com.clarifai.grpc.api.AutoscaleConfig.Builder.class);
}
// Construct using com.clarifai.grpc.api.AutoscaleConfig.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
minReplicas_ = 0;
maxReplicas_ = 0;
trafficHistorySeconds_ = 0;
scaleDownDelaySeconds_ = 0;
scaleUpDelaySeconds_ = 0;
enablePacking_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.clarifai.grpc.api.Resources.internal_static_clarifai_api_AutoscaleConfig_descriptor;
}
@java.lang.Override
public com.clarifai.grpc.api.AutoscaleConfig getDefaultInstanceForType() {
return com.clarifai.grpc.api.AutoscaleConfig.getDefaultInstance();
}
@java.lang.Override
public com.clarifai.grpc.api.AutoscaleConfig build() {
com.clarifai.grpc.api.AutoscaleConfig result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.clarifai.grpc.api.AutoscaleConfig buildPartial() {
com.clarifai.grpc.api.AutoscaleConfig result = new com.clarifai.grpc.api.AutoscaleConfig(this);
result.minReplicas_ = minReplicas_;
result.maxReplicas_ = maxReplicas_;
result.trafficHistorySeconds_ = trafficHistorySeconds_;
result.scaleDownDelaySeconds_ = scaleDownDelaySeconds_;
result.scaleUpDelaySeconds_ = scaleUpDelaySeconds_;
result.enablePacking_ = enablePacking_;
onBuilt();
return result;
}
@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.clarifai.grpc.api.AutoscaleConfig) {
return mergeFrom((com.clarifai.grpc.api.AutoscaleConfig)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.clarifai.grpc.api.AutoscaleConfig other) {
if (other == com.clarifai.grpc.api.AutoscaleConfig.getDefaultInstance()) return this;
if (other.getMinReplicas() != 0) {
setMinReplicas(other.getMinReplicas());
}
if (other.getMaxReplicas() != 0) {
setMaxReplicas(other.getMaxReplicas());
}
if (other.getTrafficHistorySeconds() != 0) {
setTrafficHistorySeconds(other.getTrafficHistorySeconds());
}
if (other.getScaleDownDelaySeconds() != 0) {
setScaleDownDelaySeconds(other.getScaleDownDelaySeconds());
}
if (other.getScaleUpDelaySeconds() != 0) {
setScaleUpDelaySeconds(other.getScaleUpDelaySeconds());
}
if (other.getEnablePacking() != false) {
setEnablePacking(other.getEnablePacking());
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.clarifai.grpc.api.AutoscaleConfig parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.clarifai.grpc.api.AutoscaleConfig) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int minReplicas_ ;
/**
*
* The minimum number of replicas for the runner to have.
* Defaults to 0 which means autoscaling can scale down to zero.
* If you want a replica always up then set to >= 1.
*
*
* uint32 min_replicas = 1;
* @return The minReplicas.
*/
@java.lang.Override
public int getMinReplicas() {
return minReplicas_;
}
/**
*
* The minimum number of replicas for the runner to have.
* Defaults to 0 which means autoscaling can scale down to zero.
* If you want a replica always up then set to >= 1.
*
*
* uint32 min_replicas = 1;
* @param value The minReplicas to set.
* @return This builder for chaining.
*/
public Builder setMinReplicas(int value) {
minReplicas_ = value;
onChanged();
return this;
}
/**
*
* The minimum number of replicas for the runner to have.
* Defaults to 0 which means autoscaling can scale down to zero.
* If you want a replica always up then set to >= 1.
*
*
* uint32 min_replicas = 1;
* @return This builder for chaining.
*/
public Builder clearMinReplicas() {
minReplicas_ = 0;
onChanged();
return this;
}
private int maxReplicas_ ;
/**
*
* The maximium number of replicas to scale up the runner to.
*
*
* uint32 max_replicas = 2;
* @return The maxReplicas.
*/
@java.lang.Override
public int getMaxReplicas() {
return maxReplicas_;
}
/**
*
* The maximium number of replicas to scale up the runner to.
*
*
* uint32 max_replicas = 2;
* @param value The maxReplicas to set.
* @return This builder for chaining.
*/
public Builder setMaxReplicas(int value) {
maxReplicas_ = value;
onChanged();
return this;
}
/**
*
* The maximium number of replicas to scale up the runner to.
*
*
* uint32 max_replicas = 2;
* @return This builder for chaining.
*/
public Builder clearMaxReplicas() {
maxReplicas_ = 0;
onChanged();
return this;
}
private int trafficHistorySeconds_ ;
/**
*
* The number of seconds of traffic history to consider when autoscaling.
*
*
* uint32 traffic_history_seconds = 3;
* @return The trafficHistorySeconds.
*/
@java.lang.Override
public int getTrafficHistorySeconds() {
return trafficHistorySeconds_;
}
/**
*
* The number of seconds of traffic history to consider when autoscaling.
*
*
* uint32 traffic_history_seconds = 3;
* @param value The trafficHistorySeconds to set.
* @return This builder for chaining.
*/
public Builder setTrafficHistorySeconds(int value) {
trafficHistorySeconds_ = value;
onChanged();
return this;
}
/**
*
* The number of seconds of traffic history to consider when autoscaling.
*
*
* uint32 traffic_history_seconds = 3;
* @return This builder for chaining.
*/
public Builder clearTrafficHistorySeconds() {
trafficHistorySeconds_ = 0;
onChanged();
return this;
}
private int scaleDownDelaySeconds_ ;
/**
*
* The time to wait before scaling down after the last request.
*
*
* uint32 scale_down_delay_seconds = 4;
* @return The scaleDownDelaySeconds.
*/
@java.lang.Override
public int getScaleDownDelaySeconds() {
return scaleDownDelaySeconds_;
}
/**
*
* The time to wait before scaling down after the last request.
*
*
* uint32 scale_down_delay_seconds = 4;
* @param value The scaleDownDelaySeconds to set.
* @return This builder for chaining.
*/
public Builder setScaleDownDelaySeconds(int value) {
scaleDownDelaySeconds_ = value;
onChanged();
return this;
}
/**
*
* The time to wait before scaling down after the last request.
*
*
* uint32 scale_down_delay_seconds = 4;
* @return This builder for chaining.
*/
public Builder clearScaleDownDelaySeconds() {
scaleDownDelaySeconds_ = 0;
onChanged();
return this;
}
private int scaleUpDelaySeconds_ ;
/**
*
* The time to wait between scaling up replicas without burst traffic.
*
*
* uint32 scale_up_delay_seconds = 5;
* @return The scaleUpDelaySeconds.
*/
@java.lang.Override
public int getScaleUpDelaySeconds() {
return scaleUpDelaySeconds_;
}
/**
*
* The time to wait between scaling up replicas without burst traffic.
*
*
* uint32 scale_up_delay_seconds = 5;
* @param value The scaleUpDelaySeconds to set.
* @return This builder for chaining.
*/
public Builder setScaleUpDelaySeconds(int value) {
scaleUpDelaySeconds_ = value;
onChanged();
return this;
}
/**
*
* The time to wait between scaling up replicas without burst traffic.
*
*
* uint32 scale_up_delay_seconds = 5;
* @return This builder for chaining.
*/
public Builder clearScaleUpDelaySeconds() {
scaleUpDelaySeconds_ = 0;
onChanged();
return this;
}
private boolean enablePacking_ ;
/**
*
* Depending on your plan you may be able to enable packing of resources into a single node
* for more compute and cost efficiency.
*