com.amazonaws.services.batch.model.EksContainerResourceRequirements Maven / Gradle / Ivy
Show all versions of aws-java-sdk-batch Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
package com.amazonaws.services.batch.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The type and amount of resources to assign to a container. The supported resources include memory
,
* cpu
, and nvidia.com/gpu
. For more information, see Resource management for pods
* and containers in the Kubernetes documentation.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EksContainerResourceRequirements implements Serializable, Cloneable, StructuredPojo {
/**
*
* The type and quantity of the resources to reserve for the container. The values vary based on the
* name
that's specified. Resources can be requested using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both places, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
* To maximize your resource utilization, provide your jobs with as much memory as possible for the specific
* instance type that you are using. To learn how, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that's reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both places, then the value that's specified in limits
must be at least as large as the
* value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that's reserved for the container. Values must be a whole integer. memory
can be
* specified in limits
, requests
, or both. If memory
is specified in both
* places, then the value that's specified in limits
must be equal to the value that's specified in
* requests
.
*
*
*
*/
private java.util.Map limits;
/**
*
* The type and quantity of the resources to request for the container. The values vary based on the
* name
that's specified. Resources can be requested by using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both, then the value that's specified in limits
must be equal to
* the value that's specified in requests
.
*
*
*
* If you're trying to maximize your resource utilization by providing your jobs as much memory as possible for a
* particular instance type, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that are reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both, then the value that's specified in limits
must be at least as large as the value
* that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that are reserved for the container. Values must be a whole integer.
* nvidia.com/gpu
can be specified in limits
, requests
, or both. If
* nvidia.com/gpu
is specified in both, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
*/
private java.util.Map requests;
/**
*
* The type and quantity of the resources to reserve for the container. The values vary based on the
* name
that's specified. Resources can be requested using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both places, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
* To maximize your resource utilization, provide your jobs with as much memory as possible for the specific
* instance type that you are using. To learn how, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that's reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both places, then the value that's specified in limits
must be at least as large as the
* value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that's reserved for the container. Values must be a whole integer. memory
can be
* specified in limits
, requests
, or both. If memory
is specified in both
* places, then the value that's specified in limits
must be equal to the value that's specified in
* requests
.
*
*
*
*
* @return The type and quantity of the resources to reserve for the container. The values vary based on the
* name
that's specified. Resources can be requested using either the limits
or
* the requests
objects.
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your
* container attempts to exceed the memory specified, the container is terminated. You must specify at least
* 4 MiB of memory for a job. memory
can be specified in limits
,
* requests
, or both. If memory
is specified in both places, then the value that's
* specified in limits
must be equal to the value that's specified in requests
.
*
*
*
* To maximize your resource utilization, provide your jobs with as much memory as possible for the specific
* instance type that you are using. To learn how, see Memory management in
* the Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that's reserved for the container. Values must be an even multiple of
* 0.25
. cpu
can be specified in limits
, requests
, or
* both. If cpu
is specified in both places, then the value that's specified in
* limits
must be at least as large as the value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that's reserved for the container. Values must be a whole integer. memory
* can be specified in limits
, requests
, or both. If memory
is
* specified in both places, then the value that's specified in limits
must be equal to the
* value that's specified in requests
.
*
*
*/
public java.util.Map getLimits() {
return limits;
}
/**
*
* The type and quantity of the resources to reserve for the container. The values vary based on the
* name
that's specified. Resources can be requested using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both places, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
* To maximize your resource utilization, provide your jobs with as much memory as possible for the specific
* instance type that you are using. To learn how, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that's reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both places, then the value that's specified in limits
must be at least as large as the
* value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that's reserved for the container. Values must be a whole integer. memory
can be
* specified in limits
, requests
, or both. If memory
is specified in both
* places, then the value that's specified in limits
must be equal to the value that's specified in
* requests
.
*
*
*
*
* @param limits
* The type and quantity of the resources to reserve for the container. The values vary based on the
* name
that's specified. Resources can be requested using either the limits
or the
* requests
objects.
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your
* container attempts to exceed the memory specified, the container is terminated. You must specify at least
* 4 MiB of memory for a job. memory
can be specified in limits
,
* requests
, or both. If memory
is specified in both places, then the value that's
* specified in limits
must be equal to the value that's specified in requests
.
*
*
*
* To maximize your resource utilization, provide your jobs with as much memory as possible for the specific
* instance type that you are using. To learn how, see Memory management in
* the Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that's reserved for the container. Values must be an even multiple of 0.25
. cpu
can be specified in limits
, requests
, or both. If
* cpu
is specified in both places, then the value that's specified in limits
must
* be at least as large as the value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that's reserved for the container. Values must be a whole integer. memory
* can be specified in limits
, requests
, or both. If memory
is
* specified in both places, then the value that's specified in limits
must be equal to the
* value that's specified in requests
.
*
*
*/
public void setLimits(java.util.Map limits) {
this.limits = limits;
}
/**
*
* The type and quantity of the resources to reserve for the container. The values vary based on the
* name
that's specified. Resources can be requested using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both places, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
* To maximize your resource utilization, provide your jobs with as much memory as possible for the specific
* instance type that you are using. To learn how, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that's reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both places, then the value that's specified in limits
must be at least as large as the
* value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that's reserved for the container. Values must be a whole integer. memory
can be
* specified in limits
, requests
, or both. If memory
is specified in both
* places, then the value that's specified in limits
must be equal to the value that's specified in
* requests
.
*
*
*
*
* @param limits
* The type and quantity of the resources to reserve for the container. The values vary based on the
* name
that's specified. Resources can be requested using either the limits
or the
* requests
objects.
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your
* container attempts to exceed the memory specified, the container is terminated. You must specify at least
* 4 MiB of memory for a job. memory
can be specified in limits
,
* requests
, or both. If memory
is specified in both places, then the value that's
* specified in limits
must be equal to the value that's specified in requests
.
*
*
*
* To maximize your resource utilization, provide your jobs with as much memory as possible for the specific
* instance type that you are using. To learn how, see Memory management in
* the Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that's reserved for the container. Values must be an even multiple of 0.25
. cpu
can be specified in limits
, requests
, or both. If
* cpu
is specified in both places, then the value that's specified in limits
must
* be at least as large as the value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that's reserved for the container. Values must be a whole integer. memory
* can be specified in limits
, requests
, or both. If memory
is
* specified in both places, then the value that's specified in limits
must be equal to the
* value that's specified in requests
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EksContainerResourceRequirements withLimits(java.util.Map limits) {
setLimits(limits);
return this;
}
/**
* Add a single Limits entry
*
* @see EksContainerResourceRequirements#withLimits
* @returns a reference to this object so that method calls can be chained together.
*/
public EksContainerResourceRequirements addLimitsEntry(String key, String value) {
if (null == this.limits) {
this.limits = new java.util.HashMap();
}
if (this.limits.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.limits.put(key, value);
return this;
}
/**
* Removes all the entries added into Limits.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EksContainerResourceRequirements clearLimitsEntries() {
this.limits = null;
return this;
}
/**
*
* The type and quantity of the resources to request for the container. The values vary based on the
* name
that's specified. Resources can be requested by using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both, then the value that's specified in limits
must be equal to
* the value that's specified in requests
.
*
*
*
* If you're trying to maximize your resource utilization by providing your jobs as much memory as possible for a
* particular instance type, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that are reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both, then the value that's specified in limits
must be at least as large as the value
* that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that are reserved for the container. Values must be a whole integer.
* nvidia.com/gpu
can be specified in limits
, requests
, or both. If
* nvidia.com/gpu
is specified in both, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
*
* @return The type and quantity of the resources to request for the container. The values vary based on the
* name
that's specified. Resources can be requested by using either the limits
or
* the requests
objects.
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your
* container attempts to exceed the memory specified, the container is terminated. You must specify at least
* 4 MiB of memory for a job. memory
can be specified in limits
,
* requests
, or both. If memory
is specified in both, then the value that's
* specified in limits
must be equal to the value that's specified in requests
.
*
*
*
* If you're trying to maximize your resource utilization by providing your jobs as much memory as possible
* for a particular instance type, see Memory management in
* the Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that are reserved for the container. Values must be an even multiple of
* 0.25
. cpu
can be specified in limits
, requests
, or
* both. If cpu
is specified in both, then the value that's specified in limits
* must be at least as large as the value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that are reserved for the container. Values must be a whole integer.
* nvidia.com/gpu
can be specified in limits
, requests
, or both. If
* nvidia.com/gpu
is specified in both, then the value that's specified in limits
* must be equal to the value that's specified in requests
.
*
*
*/
public java.util.Map getRequests() {
return requests;
}
/**
*
* The type and quantity of the resources to request for the container. The values vary based on the
* name
that's specified. Resources can be requested by using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both, then the value that's specified in limits
must be equal to
* the value that's specified in requests
.
*
*
*
* If you're trying to maximize your resource utilization by providing your jobs as much memory as possible for a
* particular instance type, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that are reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both, then the value that's specified in limits
must be at least as large as the value
* that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that are reserved for the container. Values must be a whole integer.
* nvidia.com/gpu
can be specified in limits
, requests
, or both. If
* nvidia.com/gpu
is specified in both, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
*
* @param requests
* The type and quantity of the resources to request for the container. The values vary based on the
* name
that's specified. Resources can be requested by using either the limits
or
* the requests
objects.
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your
* container attempts to exceed the memory specified, the container is terminated. You must specify at least
* 4 MiB of memory for a job. memory
can be specified in limits
,
* requests
, or both. If memory
is specified in both, then the value that's
* specified in limits
must be equal to the value that's specified in requests
.
*
*
*
* If you're trying to maximize your resource utilization by providing your jobs as much memory as possible
* for a particular instance type, see Memory management in
* the Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that are reserved for the container. Values must be an even multiple of
* 0.25
. cpu
can be specified in limits
, requests
, or
* both. If cpu
is specified in both, then the value that's specified in limits
* must be at least as large as the value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that are reserved for the container. Values must be a whole integer.
* nvidia.com/gpu
can be specified in limits
, requests
, or both. If
* nvidia.com/gpu
is specified in both, then the value that's specified in limits
* must be equal to the value that's specified in requests
.
*
*
*/
public void setRequests(java.util.Map requests) {
this.requests = requests;
}
/**
*
* The type and quantity of the resources to request for the container. The values vary based on the
* name
that's specified. Resources can be requested by using either the limits
or the
* requests
objects.
*
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your container
* attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory
* for a job. memory
can be specified in limits
, requests
, or both. If
* memory
is specified in both, then the value that's specified in limits
must be equal to
* the value that's specified in requests
.
*
*
*
* If you're trying to maximize your resource utilization by providing your jobs as much memory as possible for a
* particular instance type, see Memory management in the
* Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that are reserved for the container. Values must be an even multiple of 0.25
.
* cpu
can be specified in limits
, requests
, or both. If cpu
is
* specified in both, then the value that's specified in limits
must be at least as large as the value
* that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that are reserved for the container. Values must be a whole integer.
* nvidia.com/gpu
can be specified in limits
, requests
, or both. If
* nvidia.com/gpu
is specified in both, then the value that's specified in limits
must be
* equal to the value that's specified in requests
.
*
*
*
*
* @param requests
* The type and quantity of the resources to request for the container. The values vary based on the
* name
that's specified. Resources can be requested by using either the limits
or
* the requests
objects.
*
* - memory
* -
*
* The memory hard limit (in MiB) for the container, using whole integers, with a "Mi" suffix. If your
* container attempts to exceed the memory specified, the container is terminated. You must specify at least
* 4 MiB of memory for a job. memory
can be specified in limits
,
* requests
, or both. If memory
is specified in both, then the value that's
* specified in limits
must be equal to the value that's specified in requests
.
*
*
*
* If you're trying to maximize your resource utilization by providing your jobs as much memory as possible
* for a particular instance type, see Memory management in
* the Batch User Guide.
*
*
* - cpu
* -
*
* The number of CPUs that are reserved for the container. Values must be an even multiple of
* 0.25
. cpu
can be specified in limits
, requests
, or
* both. If cpu
is specified in both, then the value that's specified in limits
* must be at least as large as the value that's specified in requests
.
*
*
* - nvidia.com/gpu
* -
*
* The number of GPUs that are reserved for the container. Values must be a whole integer.
* nvidia.com/gpu
can be specified in limits
, requests
, or both. If
* nvidia.com/gpu
is specified in both, then the value that's specified in limits
* must be equal to the value that's specified in requests
.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EksContainerResourceRequirements withRequests(java.util.Map requests) {
setRequests(requests);
return this;
}
/**
* Add a single Requests entry
*
* @see EksContainerResourceRequirements#withRequests
* @returns a reference to this object so that method calls can be chained together.
*/
public EksContainerResourceRequirements addRequestsEntry(String key, String value) {
if (null == this.requests) {
this.requests = new java.util.HashMap();
}
if (this.requests.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.requests.put(key, value);
return this;
}
/**
* Removes all the entries added into Requests.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EksContainerResourceRequirements clearRequestsEntries() {
this.requests = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getLimits() != null)
sb.append("Limits: ").append(getLimits()).append(",");
if (getRequests() != null)
sb.append("Requests: ").append(getRequests());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EksContainerResourceRequirements == false)
return false;
EksContainerResourceRequirements other = (EksContainerResourceRequirements) obj;
if (other.getLimits() == null ^ this.getLimits() == null)
return false;
if (other.getLimits() != null && other.getLimits().equals(this.getLimits()) == false)
return false;
if (other.getRequests() == null ^ this.getRequests() == null)
return false;
if (other.getRequests() != null && other.getRequests().equals(this.getRequests()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLimits() == null) ? 0 : getLimits().hashCode());
hashCode = prime * hashCode + ((getRequests() == null) ? 0 : getRequests().hashCode());
return hashCode;
}
@Override
public EksContainerResourceRequirements clone() {
try {
return (EksContainerResourceRequirements) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.batch.model.transform.EksContainerResourceRequirementsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}