Interface Service

All Superinterfaces:
com.yahoo.config.ConfigInstance.Producer, ConfigProducer, NetworkPortRequestor
All Known Implementing Classes:
AbstractService, ApplicationContainer, ClusterControllerContainer, ConfigProxy, ConfigSentinel, Configserver, Container, ContentNode, Distributor, Logd, LogForwarder, Logserver, LogserverContainer, MetricsProxyContainer, SearchNode, Slobrok, StorageNode, TransactionLogServer

public interface Service extends ConfigProducer, NetworkPortRequestor
Representation of a process which runs a service
Author:
gjoranv
  • Method Details

    • getStartupCommand

      Optional<String> getStartupCommand()
      Services that should be started by config-sentinel must return a non-empty value. The returned value will be used in config-sentinel configuration.
    • getEnvVars

      Map<String,Object> getEnvVars()
    • getLogctlSpecs

      default List<LogctlSpec> getLogctlSpecs()
    • getPreShutdownCommand

      Optional<String> getPreShutdownCommand()
      Services that wish that a command should be run before shutdown should return the command here. The command will be executed by the config sentinel before sending SIGTERM to the service. The command is executed without a timeout.
    • getPortsMeta

      PortsMeta getPortsMeta()
      Returns a PortsMeta object, giving access to more information about the different ports of this service.
    • getHost

      HostResource getHost()
      Returns the physical host resource on which this service runs.
    • getServiceInfo

      com.yahoo.config.model.api.ServiceInfo getServiceInfo()
      Get meta information about service.
      Returns:
      an instance of ServiceInfo
    • getHostName

      String getHostName()
      Returns the hostname on which this service runs.
    • getJvmOptions

      String getJvmOptions()
      Optional JVM execution options for this service
    • getRelativePort

      int getRelativePort(int i)
      Computes and returns the i'th port for this service, based on this Service's baseport.
      Parameters:
      i - the offset from 'basePort' of the port to return
      Returns:
      the i'th port relative to the base port
      Throws:
      IllegalStateException - if i is out of range
    • getServicePropertyString

      String getServicePropertyString(String key, String defStr)
      Gets a service property value mapped to the given key as a String, or the value in defStr if no such key exists.
      Parameters:
      key - a key used for lookup in the service properties
      defStr - default String value returned if no value for key found
      Returns:
      the associated String value for the given key
    • getHealthPort

      int getHealthPort()
    • getDefaultMetricDimensions

      HashMap<String,String> getDefaultMetricDimensions()
      Returns a HashMap of default dimensions for metrics.
    • getAffinity

      Optional<Affinity> getAffinity()
      Returns the Affinity of this service if it has.