flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [02/14] flink git commit: [hotfix] [web-dashboard] Various dashboard code cleanups
Date Thu, 31 Dec 2015 14:33:25 GMT
http://git-wip-us.apache.org/repos/asf/flink/blob/6f2d9d79/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Hardware.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Hardware.java b/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Hardware.java
index 6ab198d..c393d68 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Hardware.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/instance/Hardware.java
@@ -88,13 +88,9 @@ public class Hardware {
 	 * @return the size of the physical memory in bytes or <code>-1</code> if
 	 *         the size could not be determined
 	 */
-	@SuppressWarnings("resource")
 	private static long getSizeOfPhysicalMemoryForLinux() {
-		BufferedReader lineReader = null;
-		try {
-			lineReader = new BufferedReader(new FileReader(LINUX_MEMORY_INFO_PATH));
-
-			String line = null;
+		try (BufferedReader lineReader = new BufferedReader(new FileReader(LINUX_MEMORY_INFO_PATH)))
{
+			String line;
 			while ((line = lineReader.readLine()) != null) {
 				Matcher matcher = LINUX_MEMORY_REGEX.matcher(line);
 				if (matcher.matches()) {
@@ -102,7 +98,6 @@ public class Hardware {
 					return Long.parseLong(totalMemory) * 1024L; // Convert from kilobyte to byte
 				}
 			}
-			
 			// expected line did not come
 			LOG.error("Cannot determine the size of the physical memory for Linux host (using '/proc/meminfo').
Unexpected format.");
 			return -1;
@@ -115,14 +110,6 @@ public class Hardware {
 			LOG.error("Cannot determine the size of the physical memory for Linux host (using '/proc/meminfo'):
" + t.getMessage(), t);
 			return -1;
 		}
-		finally {
-			// Make sure we always close the file handle
-			try {
-				if (lineReader != null) {
-					lineReader.close();
-				}
-			} catch (Throwable t) {}
-		}
 	}
 
 	/**
@@ -160,8 +147,7 @@ public class Hardware {
 			if (bi != null) {
 				try {
 					bi.close();
-				} catch (IOException ioe) {
-				}
+				} catch (IOException ignored) {}
 			}
 		}
 		return -1;
@@ -202,8 +188,7 @@ public class Hardware {
 			if (bi != null) {
 				try {
 					bi.close();
-				} catch (IOException ioe) {
-				}
+				} catch (IOException ignored) {}
 			}
 		}
 	}
@@ -249,7 +234,7 @@ public class Hardware {
 			if (bi != null) {
 				try {
 					bi.close();
-				} catch (Throwable t) {}
+				} catch (Throwable ignored) {}
 			}
 		}
 	}

http://git-wip-us.apache.org/repos/asf/flink/blob/6f2d9d79/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
index a7e3f9b..20e05c1 100644
--- a/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
+++ b/flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
@@ -1719,7 +1719,7 @@ object JobManager {
         0
       }
       else {
-        LOG.info("Staring JobManager without high-availability")
+        LOG.info("Starting JobManager without high-availability")
   
         configuration.getInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY,
             ConfigConstants.DEFAULT_JOB_MANAGER_IPC_PORT)

http://git-wip-us.apache.org/repos/asf/flink/blob/6f2d9d79/flink-tests/src/test/java/org/apache/flink/test/web/WebFrontendITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/web/WebFrontendITCase.java b/flink-tests/src/test/java/org/apache/flink/test/web/WebFrontendITCase.java
index 6e234e6..7720afd 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/web/WebFrontendITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/web/WebFrontendITCase.java
@@ -15,10 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.flink.test.web;
 
+package org.apache.flink.test.web;
 
 import org.apache.commons.io.FileUtils;
+
 import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.runtime.webmonitor.WebMonitor;
 import org.apache.flink.runtime.webmonitor.WebMonitorUtils;
@@ -140,5 +141,4 @@ public class WebFrontendITCase extends MultipleProgramsTestBase {
 			Assert.fail(e.getMessage());
 		}
 	}
-
 }

http://git-wip-us.apache.org/repos/asf/flink/blob/6f2d9d79/flink-tests/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/resources/log4j-test.properties b/flink-tests/src/test/resources/log4j-test.properties
index f55d9e2..7bfcee5 100644
--- a/flink-tests/src/test/resources/log4j-test.properties
+++ b/flink-tests/src/test/resources/log4j-test.properties
@@ -18,7 +18,7 @@
 
 # Set root logger level to OFF to not flood build logs
 # set manually to INFO for debugging purposes
-log4j.rootLogger=OFF, testlogger
+log4j.rootLogger=INFO, testlogger
 
 # A1 is set to be a ConsoleAppender.
 log4j.appender.testlogger=org.apache.log4j.ConsoleAppender


Mime
View raw message