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 class
Config.Builder
static class
Config.DeliverySemantics
An enum encapsulating the delivery semantics that can be applied to Heron topologies.static class
Config.Serializer
An 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 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.Config.DeliverySemantics
getDeliverySemantics()
Gets the delivery semantics applied to the topologyConfig
getHeronConfig()
double
getPerContainerCpu()
Gets the CPU used per topology containerlong
getPerContainerRam()
Gets the RAM used per topology container as a number of byteslong
getPerContainerRamAsBytes()
Gets the RAM used per topology container as a number of byteslong
getPerContainerRamAsGigabytes()
Gets the RAM used per topology container as a number of gigabyteslong
getPerContainerRamAsMegabytes()
Gets the RAM used per topology container as a number of megabytesConfig.Serializer
getSerializer()
Gets the serializer used by the topologystatic Config.Builder
newBuilder()
Returns a newConfig.Builder
that 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.Builder
that 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
-
-