Package org.apache.flink.util
Class Utils
- java.lang.Object
-
- org.apache.flink.util.Utils
-
@Internal public final class Utils extends Object
Utility class that contains helper methods to work with Java APIs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUtils.ChecksumHashCodeAccumulator ofUtils.ChecksumHashCode.static classUtils.ChecksumHashCodeHelper<T>static classUtils.CollectHelper<T>Utility sink function that collects elements into an accumulator, from which it they can be retrieved by the client.static classUtils.CountHelper<T>Utility sink function that counts elements and writes the count into an accumulator, from which it can be retrieved by the client.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetCallLocationName()static StringgetCallLocationName(int depth)static StringgetKeyFromArgs(String[] args, int index)Get the key from the given args.static <T> StringgetSerializerTree(TypeInformation<T> ti)Debugging utility to understand the hierarchy of serializers created by the Java API.static <T> Optional<T>resolveFactory(ThreadLocal<T> threadLocalFactory, T staticFactory)Resolves the given factories.
-
-
-
Field Detail
-
RNG
public static final Random RNG
-
-
Method Detail
-
getCallLocationName
public static String getCallLocationName()
-
getCallLocationName
public static String getCallLocationName(int depth)
-
getSerializerTree
public static <T> String getSerializerTree(TypeInformation<T> ti)
Debugging utility to understand the hierarchy of serializers created by the Java API. Tested in GroupReduceITCase.testGroupByGenericType()
-
resolveFactory
public static <T> Optional<T> resolveFactory(ThreadLocal<T> threadLocalFactory, @Nullable T staticFactory)
Resolves the given factories. The thread local factory has preference over the static factory. If none is set, the method returnsOptional.empty().- Type Parameters:
T- type of factory- Parameters:
threadLocalFactory- containing the thread local factorystaticFactory- containing the global factory- Returns:
- Optional containing the resolved factory if it exists, otherwise it's empty
-
-