public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
UNRESERVED_ROLE
The special 'unreserved' role.
|
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.mesos.Protos.Resource |
cpus(double amount)
Construct a cpu resource.
|
static org.apache.mesos.Protos.Resource |
cpus(String role,
double amount)
Construct a cpu resource.
|
static org.apache.mesos.Protos.Resource |
disk(double amount)
Construct a disk resource.
|
static org.apache.mesos.Protos.Resource |
disk(String role,
double amount)
Construct a disk resource.
|
static org.apache.mesos.Protos.Resource |
gpus(double amount)
Construct a gpu resource.
|
static org.apache.mesos.Protos.Resource |
gpus(String role,
double amount)
Construct a gpu resource.
|
static org.apache.mesos.Protos.Resource |
mem(double amount)
Construct a mem resource.
|
static org.apache.mesos.Protos.Resource |
mem(String role,
double amount)
Construct a mem resource.
|
static org.apache.mesos.Protos.Resource |
network(double amount)
Construct a network resource.
|
static org.apache.mesos.Protos.Resource |
network(String role,
double amount)
Construct a network resource.
|
static org.apache.mesos.Protos.Resource |
ports(org.apache.mesos.Protos.Value.Range... ranges)
Construct a port resource.
|
static org.apache.mesos.Protos.Resource |
ports(String role,
org.apache.mesos.Protos.Value.Range... ranges)
Construct a port resource.
|
static org.apache.mesos.Protos.Value.Range |
range(long begin,
long end)
Construct a range value.
|
static org.apache.mesos.Protos.Resource |
ranges(String name,
String role,
org.apache.mesos.Protos.Value.Range... ranges)
Construct a range resource.
|
static java.util.stream.LongStream |
rangeValues(Collection<org.apache.mesos.Protos.Resource> resources)
Gets a stream of values from a collection of range resources.
|
static java.util.stream.LongStream |
rangeValues(org.apache.mesos.Protos.Value.Range range)
Gets a stream of values from a range.
|
static List<org.apache.mesos.Protos.Resource> |
resources(org.apache.mesos.Protos.Resource... resources)
Construct a list of resources.
|
static org.apache.mesos.Protos.Resource |
scalar(String name,
String role,
double value)
Construct a scalar resource.
|
static String |
toString(Collection<org.apache.mesos.Protos.Resource> resources)
Gets a string representation of a collection of resources.
|
static String |
toString(org.apache.mesos.Protos.Resource resource)
Gets a string representation of a resource.
|
static String |
toString(org.apache.mesos.Protos.Value.Range range)
Gets a string representation of a range.
|
static String |
toString(org.apache.mesos.Protos.Value.Ranges ranges)
Gets a string representation of a collection of ranges.
|
static org.apache.mesos.Protos.CommandInfo.URI |
uri(MesosArtifactResolver resolver,
ContainerSpecification.Artifact artifact)
Construct a Mesos URI.
|
static org.apache.mesos.Protos.CommandInfo.URI |
uri(URL url,
boolean cacheable)
Construct a Mesos URI.
|
static org.apache.mesos.Protos.Environment.Variable |
variable(String name,
String value)
Construct a Mesos environment variable.
|
public static final String UNRESERVED_ROLE
public static org.apache.mesos.Protos.Environment.Variable variable(String name, String value)
public static org.apache.mesos.Protos.CommandInfo.URI uri(URL url, boolean cacheable)
public static org.apache.mesos.Protos.CommandInfo.URI uri(MesosArtifactResolver resolver, ContainerSpecification.Artifact artifact)
public static List<org.apache.mesos.Protos.Resource> resources(org.apache.mesos.Protos.Resource... resources)
public static org.apache.mesos.Protos.Resource cpus(double amount)
public static org.apache.mesos.Protos.Resource cpus(String role, double amount)
public static org.apache.mesos.Protos.Resource gpus(double amount)
public static org.apache.mesos.Protos.Resource gpus(String role, double amount)
public static org.apache.mesos.Protos.Resource mem(double amount)
public static org.apache.mesos.Protos.Resource mem(String role, double amount)
public static org.apache.mesos.Protos.Resource network(double amount)
public static org.apache.mesos.Protos.Resource network(String role, double amount)
public static org.apache.mesos.Protos.Resource disk(double amount)
public static org.apache.mesos.Protos.Resource disk(String role, double amount)
public static org.apache.mesos.Protos.Resource ports(org.apache.mesos.Protos.Value.Range... ranges)
public static org.apache.mesos.Protos.Resource ports(String role, org.apache.mesos.Protos.Value.Range... ranges)
public static org.apache.mesos.Protos.Resource scalar(String name, String role, double value)
public static org.apache.mesos.Protos.Value.Range range(long begin, long end)
public static org.apache.mesos.Protos.Resource ranges(String name, String role, org.apache.mesos.Protos.Value.Range... ranges)
public static java.util.stream.LongStream rangeValues(Collection<org.apache.mesos.Protos.Resource> resources)
public static java.util.stream.LongStream rangeValues(org.apache.mesos.Protos.Value.Range range)
public static String toString(Collection<org.apache.mesos.Protos.Resource> resources)
public static String toString(org.apache.mesos.Protos.Resource resource)
public static String toString(org.apache.mesos.Protos.Value.Ranges ranges)
public static String toString(org.apache.mesos.Protos.Value.Range range)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.