flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hsapu...@apache.org
Subject flink git commit: [FLINK-2775] [CLEANUP] Cleanup code as part of theme to be more consistent on Utils classes
Date Tue, 29 Sep 2015 22:02:36 GMT
Repository: flink
Updated Branches:
  refs/heads/master 2598709fa -> 136347da8


[FLINK-2775] [CLEANUP] Cleanup code as part of theme to be more consistent on Utils classes

As part of continuing theme and effort to help make the code more consistent, adding cleanup
to Utils classes:
-) Add final class modifier to the XXXUtils and XXXUtil classes to make sure can not be extended.
-) Add missing Javadoc header classs to some public classes.
-) Add private constructor to Utils classes to avoid instantiation.
-) Remove unused test/java/org/apache/flink/test/recordJobs/util/ConfigUtils.java class

Author: hsaputra <hsaputra@apache.org>

Closes #1189 from hsaputra/add_missing_javadocs_class and squashes the following commits:

0dfba19 [hsaputra] Cleanup code as part of theme to be more consistent: -) Add final class
modifier to the XXXUtils and XXXUtil classes to make sure could not be extended. -) Add missing
Javadoc header classs to some public classes. -) Add private constructor to Utils classes
to avoid instantiation. -) Remove unused test/java/org/apache/flink/test/recordJobs/util/ConfigUtils.java
class


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/136347da
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/136347da
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/136347da

Branch: refs/heads/master
Commit: 136347da8b555475d2ee3e33ab763a73ec827b3b
Parents: 2598709
Author: hsaputra <hsaputra@apache.org>
Authored: Tue Sep 29 15:02:00 2015 -0700
Committer: hsaputra <hsaputra@apache.org>
Committed: Tue Sep 29 15:02:00 2015 -0700

----------------------------------------------------------------------
 .../contrib/streaming/DataStreamUtils.java      |  9 ++-
 .../common/functions/util/FunctionUtils.java    | 12 +++-
 .../java/org/apache/flink/types/ValueUtil.java  |  9 ++-
 .../org/apache/flink/util/ExceptionUtils.java   |  9 ++-
 .../apache/flink/util/InstantiationUtil.java    |  2 +-
 .../org/apache/flink/util/ReflectionUtil.java   |  9 ++-
 .../apache/flink/testutils/TestConfigUtils.java |  8 +--
 .../java/org/apache/flink/api/java/Utils.java   | 13 +++-
 .../api/java/functions/SemanticPropUtil.java    | 11 +++-
 .../java/hadoop/mapred/utils/HadoopUtils.java   | 13 +++-
 .../hadoop/mapreduce/utils/HadoopUtils.java     | 12 +++-
 .../api/java/operators/UdfOperatorUtils.java    | 12 +++-
 .../flink/api/java/sca/UdfAnalyzerUtils.java    | 10 ++++
 .../flink/api/java/typeutils/PojoField.java     |  3 +
 .../flink/api/java/utils/DataSetUtils.java      |  9 ++-
 .../org/apache/flink/optimizer/util/Utils.java  | 16 ++---
 .../apache/flink/runtime/blob/BlobUtils.java    | 10 ++++
 .../flink/runtime/security/SecurityUtils.java   | 13 +++-
 .../flink/runtime/util/ClassLoaderUtil.java     |  9 ++-
 .../flink/runtime/util/LeaderElectionUtils.java | 12 +++-
 .../runtime/util/LeaderRetrievalUtils.java      | 10 ++++
 .../apache/flink/runtime/util/MathUtils.java    |  8 +--
 .../flink/runtime/util/StandaloneUtils.java     | 12 +++-
 .../flink/runtime/util/ZooKeeperUtils.java      | 12 +++-
 .../runtime/webmonitor/WebMonitorUtils.java     |  9 ++-
 .../network/api/serialization/types/Util.java   | 12 +++-
 .../flink/graph/example/utils/ExampleUtils.java | 15 +++--
 .../streaming/api/windowing/WindowUtils.java    | 10 ++++
 .../streaming/runtime/io/InputGateUtil.java     |  7 +++
 .../flink/streaming/util/ClusterUtil.java       | 13 +++-
 .../streaming/util/keys/KeySelectorUtil.java    | 15 ++++-
 .../flink/test/recordJobs/util/ConfigUtils.java | 63 --------------------
 .../main/java/org/apache/flink/yarn/Utils.java  | 12 +++-
 33 files changed, 287 insertions(+), 112 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-contrib/flink-streaming-contrib/src/main/java/org/apache/flink/contrib/streaming/DataStreamUtils.java
----------------------------------------------------------------------
diff --git a/flink-contrib/flink-streaming-contrib/src/main/java/org/apache/flink/contrib/streaming/DataStreamUtils.java
b/flink-contrib/flink-streaming-contrib/src/main/java/org/apache/flink/contrib/streaming/DataStreamUtils.java
index 276409d..c965aa8 100644
--- a/flink-contrib/flink-streaming-contrib/src/main/java/org/apache/flink/contrib/streaming/DataStreamUtils.java
+++ b/flink-contrib/flink-streaming-contrib/src/main/java/org/apache/flink/contrib/streaming/DataStreamUtils.java
@@ -29,7 +29,7 @@ import org.apache.flink.streaming.api.environment.RemoteStreamEnvironment;
 import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
 import org.apache.flink.runtime.net.NetUtils;
 
-public class DataStreamUtils {
+public final class DataStreamUtils {
 
 	/**
 	 * Returns an iterator to iterate over the elements of the DataStream.
@@ -83,4 +83,11 @@ public class DataStreamUtils {
 			}
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private DataStreamUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-core/src/main/java/org/apache/flink/api/common/functions/util/FunctionUtils.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/functions/util/FunctionUtils.java
b/flink-core/src/main/java/org/apache/flink/api/common/functions/util/FunctionUtils.java
index 62e07ac..e59626b 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/functions/util/FunctionUtils.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/functions/util/FunctionUtils.java
@@ -25,7 +25,10 @@ import org.apache.flink.api.common.functions.RichFunction;
 import org.apache.flink.api.common.functions.RuntimeContext;
 import org.apache.flink.configuration.Configuration;
 
-public class FunctionUtils {
+/**
+ * Utility class that contains helper methods to work with Flink {@link Function} class.
+ */
+public final class FunctionUtils {
 
 	public static void openFunction(Function function, Configuration parameters) throws Exception{
 		if (function instanceof RichFunction) {
@@ -124,4 +127,11 @@ public class FunctionUtils {
 			throw new RuntimeException("Could not extract lambda method out of function: " + e.getClass().getSimpleName()
+ " - " + e.getMessage(), e);
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private FunctionUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-core/src/main/java/org/apache/flink/types/ValueUtil.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/types/ValueUtil.java b/flink-core/src/main/java/org/apache/flink/types/ValueUtil.java
index 409e5c7..723906a 100644
--- a/flink-core/src/main/java/org/apache/flink/types/ValueUtil.java
+++ b/flink-core/src/main/java/org/apache/flink/types/ValueUtil.java
@@ -22,7 +22,7 @@ package org.apache.flink.types;
 /**
  * convert the java.lang type into a value type
  */
-public class ValueUtil {
+public final class ValueUtil {
 	public static Value toFlinkValueType(Object java)  {
 		if (java == null) {
 			return NullValue.getInstance();
@@ -56,4 +56,11 @@ public class ValueUtil {
 		}
 		throw new IllegalArgumentException("unsupported Java value");
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private ValueUtil() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java b/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java
index 9784844..092e2ba 100644
--- a/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java
+++ b/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java
@@ -28,7 +28,7 @@ import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
-public class ExceptionUtils {
+public final class ExceptionUtils {
 
 	/**
 	 * Makes a string representation of the exception's stack trace, or "(null)", if the
@@ -113,4 +113,11 @@ public class ExceptionUtils {
 			throw (Error) t;
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private ExceptionUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java b/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
index 2a158e7..de04dc4 100644
--- a/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
+++ b/flink-core/src/main/java/org/apache/flink/util/InstantiationUtil.java
@@ -39,7 +39,7 @@ import java.util.HashMap;
 /**
  * Utility class to create instances from class objects and checking failure reasons.
  */
-public class InstantiationUtil {
+public final class InstantiationUtil {
 	
 	/**
 	 * A custom ObjectInputStream that can also load user-code using a

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-core/src/main/java/org/apache/flink/util/ReflectionUtil.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/util/ReflectionUtil.java b/flink-core/src/main/java/org/apache/flink/util/ReflectionUtil.java
index 92f9e42..94c7db4 100644
--- a/flink-core/src/main/java/org/apache/flink/util/ReflectionUtil.java
+++ b/flink-core/src/main/java/org/apache/flink/util/ReflectionUtil.java
@@ -22,7 +22,7 @@ package org.apache.flink.util;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 
-public class ReflectionUtil {
+public final class ReflectionUtil {
 	public static <T> T newInstance(Class<T> clazz) {
 		try {
 			return clazz.newInstance();
@@ -138,4 +138,11 @@ public class ReflectionUtil {
 		}
 		return types;
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private ReflectionUtil() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-core/src/test/java/org/apache/flink/testutils/TestConfigUtils.java
----------------------------------------------------------------------
diff --git a/flink-core/src/test/java/org/apache/flink/testutils/TestConfigUtils.java b/flink-core/src/test/java/org/apache/flink/testutils/TestConfigUtils.java
index cb70af9..6096f69 100644
--- a/flink-core/src/test/java/org/apache/flink/testutils/TestConfigUtils.java
+++ b/flink-core/src/test/java/org/apache/flink/testutils/TestConfigUtils.java
@@ -26,11 +26,11 @@ import java.io.IOException;
 import org.apache.flink.configuration.GlobalConfiguration;
 
 /**
- *
+ * Utility class to help test the Flink configuration.
  */
-public class TestConfigUtils {
+public final class TestConfigUtils {
 	
-	public static final void loadGlobalConf(String[] keys, String[] values) throws IOException
{
+	public static void loadGlobalConf(String[] keys, String[] values) throws IOException {
 		loadGlobalConf(getConfAsString(keys, values));
 	}
 	
@@ -62,7 +62,7 @@ public class TestConfigUtils {
 		}
 	}
 	
-	public static final String getConfAsString(String[] keys, String[] values) {
+	public static String getConfAsString(String[] keys, String[] values) {
 		if (keys == null || values == null || keys.length != values.length) {
 			throw new IllegalArgumentException();
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/Utils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/Utils.java b/flink-java/src/main/java/org/apache/flink/api/java/Utils.java
index 785f3ce..45a14a3 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/Utils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/Utils.java
@@ -36,8 +36,10 @@ import org.apache.flink.configuration.Configuration;
 import org.apache.flink.util.Collector;
 import static org.apache.flink.api.java.functions.FunctionAnnotation.SkipCodeAnalysis;
 
-
-public class Utils {
+/**
+ * Utility class that contains helper methods to work with Java APIs.
+ */
+public final class Utils {
 	
 	public static final Random RNG = new Random();
 
@@ -177,4 +179,11 @@ public class Utils {
 		}
 		return ret;
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private Utils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
b/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
index 7640e2c..761eeb3 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/functions/SemanticPropUtil.java
@@ -48,7 +48,10 @@ import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-public class SemanticPropUtil {
+/**
+ * Utility class that contains helper methods to work with {@link SemanticProperties}.
+ */
+public final class SemanticPropUtil {
 
 	private final static String REGEX_WILDCARD = "[\\"+ Keys.ExpressionKeys.SELECT_ALL_CHAR+"\\"+
Keys.ExpressionKeys.SELECT_ALL_CHAR_SCALA+"]";
 	private final static String REGEX_SINGLE_FIELD = "[\\p{L}\\p{Digit}_\\$]+";
@@ -698,4 +701,10 @@ public class SemanticPropUtil {
 		}
 	}
 
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private SemanticPropUtil() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapred/utils/HadoopUtils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapred/utils/HadoopUtils.java
b/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapred/utils/HadoopUtils.java
index d4dc297..9bfc09a 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapred/utils/HadoopUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapred/utils/HadoopUtils.java
@@ -34,8 +34,10 @@ import org.apache.hadoop.mapred.TaskAttemptID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-public class HadoopUtils {
+/**
+ * Utility class to work with Apache Hadoop MapRed classes.
+ */
+public final class HadoopUtils {
 
 	private static final Logger LOG = LoggerFactory.getLogger(HadoopUtils.class);
 
@@ -151,4 +153,11 @@ public class HadoopUtils {
 		}
 		return retConf;
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private HadoopUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/utils/HadoopUtils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/utils/HadoopUtils.java
b/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/utils/HadoopUtils.java
index fe8f8cc..fd530c4 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/utils/HadoopUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/utils/HadoopUtils.java
@@ -27,7 +27,10 @@ import org.apache.hadoop.mapreduce.JobID;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
 import org.apache.hadoop.mapreduce.TaskAttemptID;
 
-public class HadoopUtils {
+/**
+ * Utility class to work with next generatio of Apache Hadoop MapReduce classes.
+ */
+public final class HadoopUtils {
 	
 	/**
 	 * Merge HadoopConfiguration into Configuration. This is necessary for the HDFS configuration.
@@ -79,4 +82,11 @@ public class HadoopUtils {
 			throw new Exception("Could not create instance of TaskAttemptContext.");
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private HadoopUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
b/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
index 52a0d08..c55d919 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/UdfOperatorUtils.java
@@ -29,7 +29,10 @@ import org.apache.flink.api.java.sca.UdfAnalyzer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class UdfOperatorUtils {
+/**
+ * Utility class that contains helper methods to work with UDF operators.
+ */
+public final class UdfOperatorUtils {
 
 	private static final Logger LOG = LoggerFactory.getLogger(UdfOperatorUtils.class);
 
@@ -100,4 +103,11 @@ public abstract class UdfOperatorUtils {
 			}
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private UdfOperatorUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
index eccdeac..6f07c33 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
@@ -43,6 +43,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+/**
+ * Utility class to work with {@link UdfAnalyzer}
+ */
 public final class UdfAnalyzerUtils {
 
 	public static TaggedValue convertTypeInfoToTaggedValue(TaggedValue.Input input, TypeInformation<?>
typeInfo,
@@ -339,4 +342,11 @@ public final class UdfAnalyzerUtils {
 		}
 		return null;
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private UdfAnalyzerUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java b/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java
index 4ad0ac2..1b008c0 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/typeutils/PojoField.java
@@ -28,6 +28,9 @@ import java.util.Objects;
 import com.google.common.base.Preconditions;
 import org.apache.flink.api.common.typeinfo.TypeInformation;
 
+/**
+ * Represent a field definition for {@link PojoTypeInfo} type of objects.
+ */
 public class PojoField implements Serializable {
 
 	private static final long serialVersionUID = 1975295846436559363L;

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
index 722fc6b..8f9fa3f 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
@@ -41,7 +41,7 @@ import java.util.List;
  * This class provides simple utility methods for zipping elements in a data set with an
index
  * or with a unique identifier.
  */
-public class DataSetUtils {
+public final class DataSetUtils {
 
 	/**
 	 * Method that goes over all the elements in each partition in order to retrieve
@@ -260,4 +260,11 @@ public class DataSetUtils {
 			return 32 - Integer.numberOfLeadingZeros((int)value);
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private DataSetUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
----------------------------------------------------------------------
diff --git a/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java b/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
index d8f33a2..ac44a09 100644
--- a/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
+++ b/flink-optimizer/src/main/java/org/apache/flink/optimizer/util/Utils.java
@@ -29,11 +29,11 @@ import org.apache.flink.optimizer.CompilerException;
 
 
 /**
- * 
+ * Utility class that contains helper methods for optimizer.
  */
-public class Utils
-{
-	public static final FieldList createOrderedFromSet(FieldSet set) {
+public final class Utils {
+
+	public static FieldList createOrderedFromSet(FieldSet set) {
 		if (set instanceof FieldList) {
 			return (FieldList) set;
 		} else {
@@ -43,7 +43,7 @@ public class Utils
 		}
 	}
 	
-	public static final Ordering createOrdering(FieldList fields, boolean[] directions) {
+	public static Ordering createOrdering(FieldList fields, boolean[] directions) {
 		final Ordering o = new Ordering();
 		for (int i = 0; i < fields.size(); i++) {
 			o.appendOrdering(fields.get(i), null, directions == null || directions[i] ? Order.ASCENDING
: Order.DESCENDING);
@@ -51,7 +51,7 @@ public class Utils
 		return o;
 	}
 	
-	public static final Ordering createOrdering(FieldList fields) {
+	public static Ordering createOrdering(FieldList fields) {
 		final Ordering o = new Ordering();
 		for (int i = 0; i < fields.size(); i++) {
 			o.appendOrdering(fields.get(i), null, Order.ANY);
@@ -77,5 +77,7 @@ public class Utils
 	/**
 	 * No instantiation.
 	 */
-	private Utils() {}
+	private Utils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java
index b7cd42e..c47ecf2 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobUtils.java
@@ -36,6 +36,9 @@ import java.util.UUID;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
+/**
+ * Utility class to work with blob data.
+ */
 public class BlobUtils {
 
 	/**
@@ -322,4 +325,11 @@ public class BlobUtils {
 			}
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private BlobUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/security/SecurityUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/security/SecurityUtils.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/security/SecurityUtils.java
index 4c0d49a..8747efe 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/security/SecurityUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/security/SecurityUtils.java
@@ -30,7 +30,7 @@ import java.security.PrivilegedExceptionAction;
  * 
  * The secure context will for example pick up authentication information from Kerberos.
  */
-public class SecurityUtils {
+public final class SecurityUtils {
 
 	private static final Logger LOG = LoggerFactory.getLogger(SecurityUtils.class);
 
@@ -58,7 +58,14 @@ public class SecurityUtils {
 		});
 	}
 
-	public static interface FlinkSecuredRunner<T> {
-		public T run() throws Exception;
+	public interface FlinkSecuredRunner<T> {
+		T run() throws Exception;
+	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private SecurityUtils() {
+		throw new RuntimeException();
 	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java
index c0145b5..8ccf9b2 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/ClassLoaderUtil.java
@@ -29,7 +29,7 @@ import java.util.jar.JarFile;
  * Utilities for information with respect to class loaders, specifically class loaders for
  * the dynamic loading of user defined classes.
  */
-public class ClassLoaderUtil {
+public final class ClassLoaderUtil {
 
 	/**
 	 * Gets information about URL class loaders. The returned info string contains all URLs
of the
@@ -129,4 +129,11 @@ public class ClassLoaderUtil {
 			return false;
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private ClassLoaderUtil() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderElectionUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderElectionUtils.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderElectionUtils.java
index 76657d3..5f867a5 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderElectionUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderElectionUtils.java
@@ -24,7 +24,10 @@ import org.apache.flink.runtime.jobmanager.RecoveryMode;
 import org.apache.flink.runtime.leaderelection.LeaderElectionService;
 import org.apache.flink.runtime.leaderelection.StandaloneLeaderElectionService;
 
-public class LeaderElectionUtils {
+/**
+ * Utility class to help working with {@link LeaderElectionService} class.
+ */
+public final class LeaderElectionUtils {
 
 	/**
 	 * Creates a {@link LeaderElectionService} based on the provided {@link Configuration} object.
@@ -54,4 +57,11 @@ public class LeaderElectionUtils {
 
 		return leaderElectionService;
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private LeaderElectionUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderRetrievalUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderRetrievalUtils.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderRetrievalUtils.java
index 201db03..704a482 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderRetrievalUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/LeaderRetrievalUtils.java
@@ -40,6 +40,9 @@ import scala.concurrent.duration.FiniteDuration;
 import java.net.InetAddress;
 import java.util.UUID;
 
+/**
+ * Utility class to work with {@link LeaderRetrievalService} class.
+ */
 public class LeaderRetrievalUtils {
 
 	private static final Logger LOG = LoggerFactory.getLogger(LeaderRetrievalUtils.class);
@@ -241,4 +244,11 @@ public class LeaderRetrievalUtils {
 			}
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private LeaderRetrievalUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/util/MathUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/MathUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/util/MathUtils.java
index ed3cdc2..939a2e1 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/MathUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/MathUtils.java
@@ -34,7 +34,7 @@ public final class MathUtils {
 	 * @return The logarithm (rounded down) to the base of 2.
 	 * @throws ArithmeticException Thrown, if the given value is zero.
 	 */
-	public static final int log2floor(int value) throws ArithmeticException {
+	public static int log2floor(int value) throws ArithmeticException {
 		if (value == 0) {
 			throw new ArithmeticException("Logarithm of zero is undefined.");
 		}
@@ -56,7 +56,7 @@ public final class MathUtils {
 	 * @throws ArithmeticException Thrown, if the given value is zero.
 	 * @throws IllegalArgumentException Thrown, if the given value is not a power of two.
 	 */
-	public static final int log2strict(int value) throws ArithmeticException, IllegalArgumentException
{
+	public static int log2strict(int value) throws ArithmeticException, IllegalArgumentException
{
 		if (value == 0) {
 			throw new ArithmeticException("Logarithm of zero is undefined.");
 		}
@@ -79,7 +79,7 @@ public final class MathUtils {
 	 * @param value The value to round down.
 	 * @return The closest value that is a power of to and less or equal than the given value.
 	 */
-	public static final int roundDownToPowerOf2(int value) {
+	public static int roundDownToPowerOf2(int value) {
 		return Integer.highestOneBit(value);
 	}
 	
@@ -93,7 +93,7 @@ public final class MathUtils {
 	 * @param value The value to be cast to an integer.
 	 * @return The given value as an integer.
 	 */
-	public static final int checkedDownCast(long value) {
+	public static int checkedDownCast(long value) {
 		if (value > Integer.MAX_VALUE) {
 			throw new IllegalArgumentException("Cannot downcast long value " + value + " to integer.");
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/util/StandaloneUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/StandaloneUtils.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/StandaloneUtils.java
index ebb7965..4cdc4f8 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/StandaloneUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/StandaloneUtils.java
@@ -29,7 +29,10 @@ import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 
-public class StandaloneUtils {
+/**
+ * Utility class to work with Flink standalone mode.
+ */
+public final class StandaloneUtils {
 
 	/**
 	 * Creates a {@link StandaloneLeaderRetrievalService} from the given configuration. The
@@ -81,4 +84,11 @@ public class StandaloneUtils {
 
 		return new StandaloneLeaderRetrievalService(jobManagerAkkaUrl);
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private StandaloneUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
index 14afb7b..d2d3945 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
@@ -30,7 +30,10 @@ import org.apache.flink.runtime.leaderretrieval.ZooKeeperLeaderRetrievalService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ZooKeeperUtils {
+/**
+ * Utility class to work with Apache Zookeeper for Flink runtime.
+ */
+public final class ZooKeeperUtils {
 
 	private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperUtils.class);
 
@@ -148,4 +151,11 @@ public class ZooKeeperUtils {
 
 		return new ZooKeeperLeaderElectionService(client, latchPath, leaderPath);
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private ZooKeeperUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
index 41ad2dc..31d9aae 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
@@ -30,7 +30,7 @@ import org.apache.flink.runtime.messages.webmonitor.JobDetails;
  * messages with aggregate information about the state of an execution graph, to be send
  * to the web server.
  */
-public class WebMonitorUtils {
+public final class WebMonitorUtils {
 
 	public static JobDetails createDetailsForJob(ExecutionGraph job) {
 		JobStatus status = job.getState();
@@ -81,4 +81,11 @@ public class WebMonitorUtils {
 	private static final int CANCELING_POS = ExecutionState.CANCELING.ordinal();
 	private static final int CANCELED_POS = ExecutionState.CANCELED.ordinal();
 	private static final int FAILED_POS = ExecutionState.FAILED.ordinal();
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private WebMonitorUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/types/Util.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/types/Util.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/types/Util.java
index 037fbaf..110f7ce 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/types/Util.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/api/serialization/types/Util.java
@@ -22,7 +22,10 @@ import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Random;
 
-public class Util {
+/**
+ * Utility class to help serialization for testing.
+ */
+public final class Util {
 
 	private static final long SEED = 64871654635745873L;
 
@@ -93,4 +96,11 @@ public class Util {
 
 		abstract protected SerializationTestType getRecord();
 	}
+
+	/**
+	 * No instantiation.
+	 */
+	private Util() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/utils/ExampleUtils.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/utils/ExampleUtils.java
b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/utils/ExampleUtils.java
index d986478..7fbee46 100644
--- a/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/utils/ExampleUtils.java
+++ b/flink-staging/flink-gelly/src/main/java/org/apache/flink/graph/example/utils/ExampleUtils.java
@@ -116,9 +116,7 @@ public class ExampleUtils {
 		return env.generateSequence(1, numVertices).flatMap(
 				new FlatMapFunction<Long, Edge<Long, NullValue>>() {
 					@Override
-					public void flatMap(Long key,
-							Collector<Edge<Long, NullValue>> out)
-							throws Exception {
+					public void flatMap(Long key, Collector<Edge<Long, NullValue>> out) throws
Exception {
 						int numOutEdges = (int) (Math.random() * (numVertices / 2));
 						for (int i = 0; i < numOutEdges; i++) {
 							long target = (long) (Math.random() * numVertices) + 1;
@@ -129,7 +127,7 @@ public class ExampleUtils {
 				});
 	}
 
-	public static final DataSet<Vertex<Long, Double>> getLongDoubleVertexData(
+	public static DataSet<Vertex<Long, Double>> getLongDoubleVertexData(
 			ExecutionEnvironment env) {
 		List<Vertex<Long, Double>> vertices = new ArrayList<Vertex<Long, Double>>();
 		vertices.add(new Vertex<Long, Double>(1L, 1.0));
@@ -141,7 +139,7 @@ public class ExampleUtils {
 		return env.fromCollection(vertices);
 	}
 
-	public static final DataSet<Edge<Long, Double>> getLongDoubleEdgeData(
+	public static DataSet<Edge<Long, Double>> getLongDoubleEdgeData(
 			ExecutionEnvironment env) {
 		List<Edge<Long, Double>> edges = new ArrayList<Edge<Long, Double>>();
 		edges.add(new Edge<Long, Double>(1L, 2L, 12.0));
@@ -154,4 +152,11 @@ public class ExampleUtils {
 
 		return env.fromCollection(edges);
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private ExampleUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/windowing/WindowUtils.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/windowing/WindowUtils.java
b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/windowing/WindowUtils.java
index dd62a44..a899b74 100644
--- a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/windowing/WindowUtils.java
+++ b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/windowing/WindowUtils.java
@@ -29,6 +29,9 @@ import org.apache.flink.streaming.api.windowing.policy.TimeTriggerPolicy;
 import org.apache.flink.streaming.api.windowing.policy.TriggerPolicy;
 import org.apache.flink.streaming.api.windowing.policy.TumblingEvictionPolicy;
 
+/**
+ * Utility class that contains helper methods to work with stream windowing.
+ */
 public class WindowUtils {
 
 	public enum WindowTransformation {
@@ -190,4 +193,11 @@ public class WindowUtils {
 			return false;
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private WindowUtils() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/runtime/io/InputGateUtil.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/runtime/io/InputGateUtil.java
b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/runtime/io/InputGateUtil.java
index 01e16fb..f11e9a1 100644
--- a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/runtime/io/InputGateUtil.java
+++ b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/runtime/io/InputGateUtil.java
@@ -49,4 +49,11 @@ public class InputGateUtil {
 			return new UnionInputGate(inputGates);
 		}
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private InputGateUtil() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/ClusterUtil.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/ClusterUtil.java
b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/ClusterUtil.java
index 4a7eec1..d4569fe 100644
--- a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/ClusterUtil.java
+++ b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/ClusterUtil.java
@@ -26,8 +26,10 @@ import org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-public class ClusterUtil {
+/**
+ * Utility class to manage mini cluster for Apache Flink.
+ */
+public final class ClusterUtil {
 	
 	private static final Logger LOG = LoggerFactory.getLogger(ClusterUtil.class);
 
@@ -84,4 +86,11 @@ public class ClusterUtil {
 	public static void startOnMiniCluster(JobGraph jobGraph, int parallelism) throws Exception
{
 		runOnMiniCluster(jobGraph, parallelism, -1, true, true, null);
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private ClusterUtil() {
+		throw new RuntimeException();
+	}
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
----------------------------------------------------------------------
diff --git a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
index f758147..d8839a0 100644
--- a/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
+++ b/flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/util/keys/KeySelectorUtil.java
@@ -29,7 +29,10 @@ import org.apache.flink.api.java.functions.KeySelector;
 import org.apache.flink.api.java.operators.Keys;
 import org.apache.flink.api.java.tuple.Tuple;
 
-public class KeySelectorUtil {
+/**
+ * Utility class that contains helper methods to manipulating {@link KeySelector} for streaming.
+ */
+public final class KeySelectorUtil {
 
 	public static <X> KeySelector<X, Tuple> getSelectorForKeys(Keys<X> keys,
TypeInformation<X> typeInfo, ExecutionConfig executionConfig) {
 		if (!(typeInfo instanceof CompositeType)) {
@@ -70,8 +73,14 @@ public class KeySelectorUtil {
 		return new OneKeySelector<X, K>(comparator);
 	}
 
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private KeySelectorUtil() {
+		throw new RuntimeException();
+	}
 	
-	public static class OneKeySelector<IN, K> implements KeySelector<IN, K> {
+	public static final class OneKeySelector<IN, K> implements KeySelector<IN, K>
{
 
 		private static final long serialVersionUID = 1L;
 
@@ -102,7 +111,7 @@ public class KeySelectorUtil {
 	 *
 	 * @param <IN> The type from which the key is extracted.
 	 */
-	public static class ComparableKeySelector<IN> implements KeySelector<IN, Tuple>
{
+	public static final class ComparableKeySelector<IN> implements KeySelector<IN,
Tuple> {
 
 		private static final long serialVersionUID = 1L;
 

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-tests/src/test/java/org/apache/flink/test/recordJobs/util/ConfigUtils.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recordJobs/util/ConfigUtils.java
b/flink-tests/src/test/java/org/apache/flink/test/recordJobs/util/ConfigUtils.java
deleted file mode 100644
index 431da04..0000000
--- a/flink-tests/src/test/java/org/apache/flink/test/recordJobs/util/ConfigUtils.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.flink.test.recordJobs.util;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.flink.configuration.Configuration;
-
-public class ConfigUtils {
-
-	private ConfigUtils() {}
-
-	public static int asInteger(String key, Configuration parameters) {
-		int value = parameters.getInteger(key, -1);
-		if (value == -1) {
-			throw new IllegalStateException();
-		}
-		return value;
-	}
-
-	public static double asDouble(String key, Configuration parameters) {
-		double value = parameters.getDouble(key, Double.NaN);
-		if (Double.isNaN(value)) {
-			throw new IllegalStateException();
-		}
-		return value;
-	}
-
-	public static long asLong(String key, Configuration parameters) {
-		long value = parameters.getLong(key, Long.MIN_VALUE);
-		if (value == Long.MIN_VALUE) {
-			throw new IllegalStateException();
-		}
-		return value;
-	}
-
-	public static Set<Integer> asIntSet(String key, Configuration parameters) {
-		String[] tokens = parameters.getString(key, "").split(",");
-		Set<Integer> intSet = new HashSet<Integer>(tokens.length);
-		for (String token : tokens) {
-			intSet.add(Integer.parseInt(token));
-		}
-		return intSet;
-	}
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/136347da/flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
----------------------------------------------------------------------
diff --git a/flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java b/flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
index f246ebf..c562cdc 100644
--- a/flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
+++ b/flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
@@ -47,7 +47,10 @@ import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.util.ConverterUtils;
 
-public class Utils {
+/**
+ * Utility class that provides helper methods to work with Apache Hadoop YARN.
+ */
+public final class Utils {
 	
 	private static final Logger LOG = LoggerFactory.getLogger(Utils.class);
 
@@ -160,4 +163,11 @@ public class Utils {
 		environment.put(StringInterner.weakIntern(variable),
 				StringInterner.weakIntern(val));
 	}
+
+	/**
+	 * Private constructor to prevent instantiation.
+	 */
+	private Utils() {
+		throw new RuntimeException();
+	}
 }


Mime
View raw message