public class JobId extends Descriptor implements Comparable<JobId>
Has a string representation in JSON of:
"name:version:hashvalue"
The hash value is so that if you are talking to multiple clusters, and the job definitions are slightly different, even though they have the same name and version, they will still be uniquely identifiable. This is most important when executing commands against multiple clusters.
Many endpoints taking JobId can take an abbreviated JobId. That is, one without a the final colon and hash value.
| Modifier and Type | Class and Description |
|---|---|
static class |
JobId.Builder |
| Constructor and Description |
|---|
JobId(String name,
String version)
Create a new job id with a specific name and version.
|
JobId(String name,
String version,
String hash)
Create a fully qualified job id with name, version and hash.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(JobId jobId) |
boolean |
equals(Object obj) |
static JobId |
fromString(String id)
Parse a job id string.
|
String |
getHash() |
String |
getName() |
String |
getVersion() |
int |
hashCode() |
boolean |
isFullyQualified() |
static JobId.Builder |
newBuilder() |
static JobId |
parse(String id)
Parse a job id string.
|
String |
toShortString() |
String |
toString() |
parse, parse, toJsonBytes, toJsonStringpublic JobId(String name, String version, String hash)
name - The name of the job.version - The version of the job.hash - The hash of the job.public static JobId fromString(String id)
This parsing method can be used when input is trusted, i.e. failing to parse it indicates programming error and not bad input.
id - A string representation of the job ID.parse(String)public static JobId parse(String id) throws JobIdParseException
This parsing method can be used when input is not know to be correct. I.e. when parsing a job id supplied by the user in the cli or when parsing a request in the master rest interface.
id - A string representation of the job ID.JobIdParseException - If the ID cannot be parsed.fromString(String)public String toShortString()
public String getName()
public String getVersion()
public String getHash()
public int compareTo(JobId jobId)
compareTo in interface Comparable<JobId>public static JobId.Builder newBuilder()
public boolean isFullyQualified()
Copyright © 2017. All rights reserved.