public class DefaultServiceSpec extends java.lang.Object implements ServiceSpec
ServiceSpec.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultServiceSpec.Builder
DefaultServiceSpec builder static inner class. |
static class |
DefaultServiceSpec.Comparator
Comparer which checks for equality of
DefaultServiceSpecs. |
static class |
DefaultServiceSpec.ConfigFactory
Factory which performs the inverse of
Configuration.getBytes(). |
static class |
DefaultServiceSpec.Generator
Generates a
ServiceSpec from a given YAML definition in the form of a RawServiceSpec. |
CHARSET| Constructor and Description |
|---|
DefaultServiceSpec(java.lang.String name,
java.lang.String role,
java.lang.String principal,
java.lang.String webUrl,
java.lang.String zookeeperConnection,
java.util.List<PodSpec> pods,
ReplacementFailurePolicy replacementFailurePolicy,
java.lang.String user) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static ConfigurationComparator<ServiceSpec> |
getComparatorInstance()
Returns a
ConfigurationComparator which may be used to compare
DefaultServiceSpecs. |
static ConfigurationFactory<ServiceSpec> |
getConfigurationFactory(ServiceSpec serviceSpec)
Returns a
DefaultServiceSpec.ConfigFactory which may be used to deserialize
DefaultServiceSpecs, which has been confirmed to successfully and
consistently serialize/deserialize the provided ServiceSpecification instance. |
static ConfigurationFactory<ServiceSpec> |
getConfigurationFactory(ServiceSpec serviceSpec,
java.util.Collection<java.lang.Class<?>> additionalSubtypesToRegister)
Returns a
DefaultServiceSpec.ConfigFactory which may be used to deserialize
DefaultServiceSpecs, which has been confirmed to successfully and
consistently serialize/deserialize the provided ServiceSpecification instance. |
java.lang.String |
getName() |
java.util.List<PodSpec> |
getPods() |
java.lang.String |
getPrincipal() |
java.util.Optional<ReplacementFailurePolicy> |
getReplacementFailurePolicy() |
java.lang.String |
getRole() |
java.lang.String |
getUser() |
(package private) static java.lang.String |
getUser(java.lang.String user,
java.util.List<PodSpec> podSpecs) |
java.lang.String |
getWebUrl() |
java.lang.String |
getZookeeperConnection() |
int |
hashCode() |
static DefaultServiceSpec.Builder |
newBuilder() |
static DefaultServiceSpec.Builder |
newBuilder(ServiceSpec copy) |
static DefaultServiceSpec.Generator |
newGenerator(java.io.File rawServiceSpecFile,
SchedulerConfig schedulerConfig)
Used by unit tests.
|
static DefaultServiceSpec.Generator |
newGenerator(RawServiceSpec rawServiceSpec,
SchedulerConfig schedulerConfig,
java.io.File configTemplateDir)
Returns a new generator with the provided configuration.
|
static DefaultServiceSpec.Generator |
newGenerator(RawServiceSpec rawServiceSpec,
SchedulerConfig schedulerConfig,
java.util.Map<java.lang.String,java.lang.String> schedulerEnvironment,
java.io.File configTemplateDir)
Used by unit tests.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetBytes, toJsonStringpublic DefaultServiceSpec(java.lang.String name,
java.lang.String role,
java.lang.String principal,
java.lang.String webUrl,
java.lang.String zookeeperConnection,
java.util.List<PodSpec> pods,
ReplacementFailurePolicy replacementFailurePolicy,
java.lang.String user)
static java.lang.String getUser(java.lang.String user,
java.util.List<PodSpec> podSpecs)
public static DefaultServiceSpec.Generator newGenerator(RawServiceSpec rawServiceSpec, SchedulerConfig schedulerConfig, java.io.File configTemplateDir)
rawServiceSpec - The object model representation of a Service Specification YAML fileschedulerConfig - Scheduler configuration containing operator-facing knobsconfigTemplateDir - Path to the directory containing any config templates for the service, often the same
directory as the Service Specification YAML filepublic static DefaultServiceSpec.Generator newGenerator(java.io.File rawServiceSpecFile, SchedulerConfig schedulerConfig) throws java.lang.Exception
java.lang.Exceptionpublic static DefaultServiceSpec.Generator newGenerator(RawServiceSpec rawServiceSpec, SchedulerConfig schedulerConfig, java.util.Map<java.lang.String,java.lang.String> schedulerEnvironment, java.io.File configTemplateDir) throws java.lang.Exception
java.lang.Exceptionpublic static DefaultServiceSpec.Builder newBuilder()
public static DefaultServiceSpec.Builder newBuilder(ServiceSpec copy)
public java.lang.String getName()
getName in interface ServiceSpecpublic java.lang.String getRole()
getRole in interface ServiceSpecpublic java.lang.String getPrincipal()
getPrincipal in interface ServiceSpecpublic java.lang.String getWebUrl()
getWebUrl in interface ServiceSpecpublic java.lang.String getZookeeperConnection()
getZookeeperConnection in interface ServiceSpecpublic java.util.List<PodSpec> getPods()
getPods in interface ServiceSpecpublic java.util.Optional<ReplacementFailurePolicy> getReplacementFailurePolicy()
getReplacementFailurePolicy in interface ServiceSpecpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static ConfigurationComparator<ServiceSpec> getComparatorInstance()
ConfigurationComparator which may be used to compare
DefaultServiceSpecs.public java.lang.String getUser()
getUser in interface ServiceSpecpublic static ConfigurationFactory<ServiceSpec> getConfigurationFactory(ServiceSpec serviceSpec) throws ConfigStoreException
DefaultServiceSpec.ConfigFactory which may be used to deserialize
DefaultServiceSpecs, which has been confirmed to successfully and
consistently serialize/deserialize the provided ServiceSpecification instance.serviceSpec - specification to test for successful serialization/deserializationConfigStoreException - if testing the provided specification failspublic static ConfigurationFactory<ServiceSpec> getConfigurationFactory(ServiceSpec serviceSpec, java.util.Collection<java.lang.Class<?>> additionalSubtypesToRegister) throws ConfigStoreException
DefaultServiceSpec.ConfigFactory which may be used to deserialize
DefaultServiceSpecs, which has been confirmed to successfully and
consistently serialize/deserialize the provided ServiceSpecification instance.serviceSpec - specification to test for successful serialization/deserializationadditionalSubtypesToRegister - any class subtypes which should be registered with
Jackson for deserialization. any custom placement rule implementations
must be providedConfigStoreException - if testing the provided specification fails