Repository: flink
Updated Branches:
  refs/heads/release-1.1 445eaa986 -> cbce10d10


[FLINK-4302] [metrics] Add documentation to MetricConfig


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

Branch: refs/heads/release-1.1
Commit: cbce10d100a19247476035ed53ea8196d19051f5
Parents: 445eaa9
Author: zentol <[email protected]>
Authored: Wed Aug 10 16:23:54 2016 +0200
Committer: zentol <[email protected]>
Committed: Wed Aug 17 14:02:30 2016 +0200

----------------------------------------------------------------------
 .../org/apache/flink/metrics/MetricConfig.java  | 53 ++++++++++++++++++++
 .../flink/metrics/reporter/MetricReporter.java  |  2 +-
 2 files changed, 54 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/cbce10d1/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java
----------------------------------------------------------------------
diff --git 
a/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java
 
b/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java
index a611ae8..4a2e616 100644
--- 
a/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java
+++ 
b/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java
@@ -19,12 +19,25 @@ package org.apache.flink.metrics;
 
 import java.util.Properties;
 
+/**
+ * A properties class with added utility method to extract primitives.
+ */
 public class MetricConfig extends Properties {
 
        public String getString(String key, String defaultValue) {
                return getProperty(key, defaultValue);
        }
 
+       /**
+        * Searches for the property with the specified key in this property 
list.
+        * If the key is not found in this property list, the default property 
list,
+        * and its defaults, recursively, are then checked. The method returns 
the
+        * default value argument if the property is not found.
+        *
+        * @param key          the hashtable key.
+        * @param defaultValue a default value.
+        * @return the value in this property list with the specified key value 
parsed as an int.
+        */
        public int getInteger(String key, int defaultValue) {
                String argument = getProperty(key, null);
                return argument == null
@@ -32,6 +45,16 @@ public class MetricConfig extends Properties {
                        : Integer.parseInt(argument);
        }
 
+       /**
+        * Searches for the property with the specified key in this property 
list.
+        * If the key is not found in this property list, the default property 
list,
+        * and its defaults, recursively, are then checked. The method returns 
the
+        * default value argument if the property is not found.
+        *
+        * @param key          the hashtable key.
+        * @param defaultValue a default value.
+        * @return the value in this property list with the specified key value 
parsed as a long.
+        */
        public long getLong(String key, long defaultValue) {
                String argument = getProperty(key, null);
                return argument == null
@@ -39,6 +62,16 @@ public class MetricConfig extends Properties {
                        : Long.parseLong(argument);
        }
 
+       /**
+        * Searches for the property with the specified key in this property 
list.
+        * If the key is not found in this property list, the default property 
list,
+        * and its defaults, recursively, are then checked. The method returns 
the
+        * default value argument if the property is not found.
+        *
+        * @param key          the hashtable key.
+        * @param defaultValue a default value.
+        * @return the value in this property list with the specified key value 
parsed as a float.
+        */
        public float getFloat(String key, float defaultValue) {
                String argument = getProperty(key, null);
                return argument == null
@@ -46,6 +79,16 @@ public class MetricConfig extends Properties {
                        : Float.parseFloat(argument);
        }
 
+       /**
+        * Searches for the property with the specified key in this property 
list.
+        * If the key is not found in this property list, the default property 
list,
+        * and its defaults, recursively, are then checked. The method returns 
the
+        * default value argument if the property is not found.
+        *
+        * @param key          the hashtable key.
+        * @param defaultValue a default value.
+        * @return the value in this property list with the specified key value 
parsed as a double.
+        */
        public double getDouble(String key, double defaultValue) {
                String argument = getProperty(key, null);
                return argument == null
@@ -53,6 +96,16 @@ public class MetricConfig extends Properties {
                        : Double.parseDouble(argument);
        }
 
+       /**
+        * Searches for the property with the specified key in this property 
list.
+        * If the key is not found in this property list, the default property 
list,
+        * and its defaults, recursively, are then checked. The method returns 
the
+        * default value argument if the property is not found.
+        *
+        * @param key          the hashtable key.
+        * @param defaultValue a default value.
+        * @return the value in this property list with the specified key value 
parsed as a boolean.
+        */
        public boolean getBoolean(String key, boolean defaultValue) {
                String argument = getProperty(key, null);
                return argument == null

http://git-wip-us.apache.org/repos/asf/flink/blob/cbce10d1/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/reporter/MetricReporter.java
----------------------------------------------------------------------
diff --git 
a/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/reporter/MetricReporter.java
 
b/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/reporter/MetricReporter.java
index bd13be7..ee92a10 100644
--- 
a/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/reporter/MetricReporter.java
+++ 
b/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/reporter/MetricReporter.java
@@ -40,7 +40,7 @@ public interface MetricReporter {
         * 
         * <p>This method is always called first on a newly instantiated 
reporter.
         *
-        * @param config The configuration with all parameters.
+        * @param config A properties object that contains all parameters set 
for this reporter.
         */
        void open(MetricConfig config);
 

Reply via email to