Package org.apache.heron.api.utils
Class Utils
- java.lang.Object
-
- org.apache.heron.api.utils.Utils
-
public final class Utils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_STREAM_ID
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntegerassignKeyToTask(int key, List<Integer> taskIds)static Objectdeserialize(byte[] serialized)static <S,T>
Tget(Map<S,T> m, S key, T defaultValue)static org.apache.heron.api.generated.TopologyAPI.Config.BuildergetConfigBuilder(Config config)Converts a Heron Config object into a TopologyAPI.Config.Builder.static ObjectnewInstance(String klass)static Map<String,String>readCommandLineOpts()static byte[]serialize(Object obj)static voidsleep(long millis)static byte[]toByteArray(ByteBuffer buffer)static List<Object>tuple(Object... values)static doublezeroIfNaNOrInf(double x)
-
-
-
Field Detail
-
DEFAULT_STREAM_ID
public static final String DEFAULT_STREAM_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
sleep
public static void sleep(long millis)
-
serialize
public static byte[] serialize(Object obj)
-
deserialize
public static Object deserialize(byte[] serialized)
-
toByteArray
public static byte[] toByteArray(ByteBuffer buffer)
-
get
public static <S,T> T get(Map<S,T> m, S key, T defaultValue)
-
getConfigBuilder
public static org.apache.heron.api.generated.TopologyAPI.Config.Builder getConfigBuilder(Config config)
Converts a Heron Config object into a TopologyAPI.Config.Builder. Config entries with null keys or values are ignored.- Parameters:
config- heron Config object- Returns:
- TopologyAPI.Config.Builder with values loaded from config
-
zeroIfNaNOrInf
public static double zeroIfNaNOrInf(double x)
-
-