Class Config


  • public class Config
    extends Object
    Config is an Immutable Map of <String, Object> The get/set API that uses Key objects should be favored over Strings. Usage of the String API should be refactored out. A newly created Config object holds configs that might include wildcard tokens, like ${HERON_HOME}/bin, ${HERON_LIB}/packing/*. Token substitution can be done by converting that config to a local or cluster config by using the Config.toLocalMode or Config.toClusterMode methods. Local mode is for a config to be used to run Heron locally, where HERON_HOME might be an install dir on the local host (e.g. HERON_HOME=/usr/bin/heron). Cluster mode is to be used when building configs for a remote process run on a service, where all directories might be relative to the current dir by default (e.g. HERON_HOME=~/heron-core).
    • Method Detail

      • newBuilder

        public static Config.Builder newBuilder​(boolean loadDefaults)
      • toLocalMode

        public static Config toLocalMode​(Config config)
      • toClusterMode

        public static Config toClusterMode​(Config config)
      • size

        public int size()
      • getStringValue

        public String getStringValue​(String key)
      • getStringValue

        public String getStringValue​(Key key)
      • getBooleanValue

        public Boolean getBooleanValue​(Key key)
      • getBooleanValue

        public Boolean getBooleanValue​(String key,
                                       boolean defaultValue)
      • getByteAmountValue

        public org.apache.heron.common.basics.ByteAmount getByteAmountValue​(Key key)
      • getPackageType

        public org.apache.heron.common.basics.PackageType getPackageType​(Key key)
      • getLongValue

        public Long getLongValue​(Key key)
      • getLongValue

        public Long getLongValue​(String key,
                                 long defaultValue)
      • getIntegerValue

        public Integer getIntegerValue​(Key key)
      • getIntegerValue

        public Integer getIntegerValue​(String key,
                                       int defaultValue)
      • getDoubleValue

        public Double getDoubleValue​(Key key)
      • containsKey

        public boolean containsKey​(Key key)