Package org.apache.heron.streamlet
Class Config
- java.lang.Object
-
- org.apache.heron.streamlet.Config
-
- All Implemented Interfaces:
Serializable
public final class Config extends Object implements Serializable
Config is the way users configure the execution of the topology. Things like streamlet delivery semantics, resources used, as well as user-defined key/value pairs are passed on to the topology runner via this class.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfig.Builderstatic classConfig.DeliverySemanticsAn enum encapsulating the delivery semantics that can be applied to Heron topologies.static classConfig.SerializerAn enum encapsulating the serializers that can be used for data in the topology.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConfigdefaultConfig()Sets the topology to use the default configuration: 100 megabytes of RAM per container, 1.0 CPUs per container, at-most-once delivery semantics, and the Kryo serializer.Config.DeliverySemanticsgetDeliverySemantics()Gets the delivery semantics applied to the topologyConfiggetHeronConfig()doublegetPerContainerCpu()Gets the CPU used per topology containerlonggetPerContainerRam()Gets the RAM used per topology container as a number of byteslonggetPerContainerRamAsBytes()Gets the RAM used per topology container as a number of byteslonggetPerContainerRamAsGigabytes()Gets the RAM used per topology container as a number of gigabyteslonggetPerContainerRamAsMegabytes()Gets the RAM used per topology container as a number of megabytesConfig.SerializergetSerializer()Gets the serializer used by the topologystatic Config.BuildernewBuilder()Returns a newConfig.Builderthat can be used to create a configuration object for Streamlet API topologies
-
-
-
Method Detail
-
defaultConfig
public static Config defaultConfig()
Sets the topology to use the default configuration: 100 megabytes of RAM per container, 1.0 CPUs per container, at-most-once delivery semantics, and the Kryo serializer.
-
newBuilder
public static Config.Builder newBuilder()
Returns a newConfig.Builderthat can be used to create a configuration object for Streamlet API topologies
-
getHeronConfig
public Config getHeronConfig()
-
getPerContainerCpu
public double getPerContainerCpu()
Gets the CPU used per topology container- Returns:
- the per-container CPU as a double
-
getPerContainerRam
public long getPerContainerRam()
Gets the RAM used per topology container as a number of bytes- Returns:
- the per-container RAM in bytes
-
getPerContainerRamAsBytes
public long getPerContainerRamAsBytes()
Gets the RAM used per topology container as a number of bytes- Returns:
- the per-container RAM in bytes
-
getPerContainerRamAsMegabytes
public long getPerContainerRamAsMegabytes()
Gets the RAM used per topology container as a number of megabytes- Returns:
- the per-container RAM in megabytes
-
getPerContainerRamAsGigabytes
public long getPerContainerRamAsGigabytes()
Gets the RAM used per topology container as a number of gigabytes- Returns:
- the per-container RAM in gigabytes
-
getDeliverySemantics
public Config.DeliverySemantics getDeliverySemantics()
Gets the delivery semantics applied to the topology- Returns:
- the delivery semantics as an enum
-
getSerializer
public Config.Serializer getSerializer()
Gets the serializer used by the topology- Returns:
- the serializer as an enum
-
-