Package org.apache.heron.spi.common
Class Config
- java.lang.Object
-
- org.apache.heron.spi.common.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 theConfig.toLocalMode
orConfig.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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Config.Builder
-
Constructor Summary
Constructors Modifier Constructor Description protected
Config(Config.Builder build)
-
Method Summary
-
-
-
Constructor Detail
-
Config
protected Config(Config.Builder build)
-
-
Method Detail
-
newBuilder
public static Config.Builder newBuilder()
-
newBuilder
public static Config.Builder newBuilder(boolean loadDefaults)
-
size
public int size()
-
getByteAmountValue
public org.apache.heron.common.basics.ByteAmount getByteAmountValue(Key key)
-
getPackageType
public org.apache.heron.common.basics.PackageType getPackageType(Key key)
-
getDurationValue
public Duration getDurationValue(String key, TemporalUnit unit, Duration defaultValue)
-
containsKey
public boolean containsKey(Key key)
-
-