You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2018/05/13 12:19:42 UTC

[1/3] flink git commit: [hotfix] [network] Make time measurements with System.nanoTime()

Repository: flink
Updated Branches:
  refs/heads/master 0e5a157ae -> d82fbf452


[hotfix] [network] Make time measurements with System.nanoTime()


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

Branch: refs/heads/master
Commit: 908cf9338d336e468a0c5528af46b25502a93a17
Parents: 0e5a157
Author: Stephan Ewen <se...@apache.org>
Authored: Tue May 8 23:12:19 2018 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Sun May 13 13:41:24 2018 +0200

----------------------------------------------------------------------
 .../flink/runtime/io/network/netty/NettyClient.java     | 12 ++++++------
 .../flink/runtime/io/network/netty/NettyServer.java     | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/908cf933/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyClient.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyClient.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyClient.java
index 5fb083d..dd40190 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyClient.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyClient.java
@@ -63,7 +63,7 @@ class NettyClient {
 
 		this.protocol = protocol;
 
-		long start = System.currentTimeMillis();
+		final long start = System.nanoTime();
 
 		bootstrap = new Bootstrap();
 
@@ -117,8 +117,8 @@ class NettyClient {
 			throw new IOException("Failed to initialize SSL Context for the Netty client", e);
 		}
 
-		long end = System.currentTimeMillis();
-		LOG.info("Successful initialization (took {} ms).", (end - start));
+		final long duration = (System.nanoTime() - start) / 1_000_000;
+		LOG.info("Successful initialization (took {} ms).", duration);
 	}
 
 	NettyConfig getConfig() {
@@ -130,7 +130,7 @@ class NettyClient {
 	}
 
 	void shutdown() {
-		long start = System.currentTimeMillis();
+		final long start = System.nanoTime();
 
 		if (bootstrap != null) {
 			if (bootstrap.group() != null) {
@@ -139,8 +139,8 @@ class NettyClient {
 			bootstrap = null;
 		}
 
-		long end = System.currentTimeMillis();
-		LOG.info("Successful shutdown (took {} ms).", (end - start));
+		final long duration = (System.nanoTime() - start) / 1_000_000;
+		LOG.info("Successful shutdown (took {} ms).", duration);
 	}
 
 	private void initNioBootstrap() {

http://git-wip-us.apache.org/repos/asf/flink/blob/908cf933/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
index c6d09d0..81bc50d 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyServer.java
@@ -73,7 +73,7 @@ class NettyServer {
 	void init(final NettyProtocol protocol, NettyBufferPool nettyBufferPool) throws IOException {
 		checkState(bootstrap == null, "Netty server has already been initialized.");
 
-		long start = System.currentTimeMillis();
+		final long start = System.nanoTime();
 
 		bootstrap = new ServerBootstrap();
 
@@ -170,8 +170,8 @@ class NettyServer {
 
 		localAddress = (InetSocketAddress) bindFuture.channel().localAddress();
 
-		long end = System.currentTimeMillis();
-		LOG.info("Successful initialization (took {} ms). Listening on SocketAddress {}.", (end - start), bindFuture.channel().localAddress().toString());
+		final long duration = (System.nanoTime() - start) / 1_000_000;
+		LOG.info("Successful initialization (took {} ms). Listening on SocketAddress {}.", duration, localAddress);
 	}
 
 	NettyConfig getConfig() {
@@ -187,7 +187,7 @@ class NettyServer {
 	}
 
 	void shutdown() {
-		long start = System.currentTimeMillis();
+		final long start = System.nanoTime();
 		if (bindFuture != null) {
 			bindFuture.channel().close().awaitUninterruptibly();
 			bindFuture = null;
@@ -199,8 +199,8 @@ class NettyServer {
 			}
 			bootstrap = null;
 		}
-		long end = System.currentTimeMillis();
-		LOG.info("Successful shutdown (took {} ms).", (end - start));
+		final long duration = (System.nanoTime() - start) / 1_000_000;
+		LOG.info("Successful shutdown (took {} ms).", duration);
 	}
 
 	private void initNioBootstrap() {


[2/3] flink git commit: [hotfix] [network] Minor code cleanup in NettyTestUtil

Posted by se...@apache.org.
[hotfix] [network] Minor code cleanup in NettyTestUtil


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

Branch: refs/heads/master
Commit: 10c9f879e8217da9aceb7bcb527c34a417fc3689
Parents: 908cf93
Author: Stephan Ewen <se...@apache.org>
Authored: Wed May 9 12:27:19 2018 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Sun May 13 13:41:28 2018 +0200

----------------------------------------------------------------------
 .../runtime/io/network/netty/NettyTestUtil.java | 29 +++++++-------------
 1 file changed, 10 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/10c9f879/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java
index f664347..f0c1b80 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyTestUtil.java
@@ -21,7 +21,6 @@ package org.apache.flink.runtime.io.network.netty;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.util.NetUtils;
 
-import scala.Tuple2;
 import org.apache.flink.shaded.netty4.io.netty.channel.Channel;
 
 import java.net.InetAddress;
@@ -36,7 +35,7 @@ import static org.apache.flink.util.Preconditions.checkNotNull;
  */
 public class NettyTestUtil {
 
-	static int DEFAULT_SEGMENT_SIZE = 1024;
+	static final int DEFAULT_SEGMENT_SIZE = 1024;
 
 	// ---------------------------------------------------------------------------------------------
 	// NettyServer and NettyClient
@@ -145,32 +144,24 @@ public class NettyTestUtil {
 				config);
 	}
 
-	// ---------------------------------------------------------------------------------------------
+	// ------------------------------------------------------------------------
 
-	static class NettyServerAndClient extends Tuple2<NettyServer, NettyClient> {
+	static final class NettyServerAndClient {
 
-		private static final long serialVersionUID = 4440278728496341931L;
+		private final NettyServer server;
+		private final NettyClient client;
 
-		NettyServerAndClient(NettyServer _1, NettyClient _2) {
-			super(_1, _2);
+		NettyServerAndClient(NettyServer server, NettyClient client) {
+			this.server = checkNotNull(server);
+			this.client = checkNotNull(client);
 		}
 
 		NettyServer server() {
-			return _1();
+			return server;
 		}
 
 		NettyClient client() {
-			return _2();
-		}
-
-		@Override
-		public boolean canEqual(Object that) {
-			return false;
-		}
-
-		@Override
-		public boolean equals(Object that) {
-			return false;
+			return client;
 		}
 	}
 }


[3/3] flink git commit: [FLINK-9348] [docs] Scalastyle documentatiom for IntelliJ IDE setup

Posted by se...@apache.org.
[FLINK-9348] [docs] Scalastyle documentatiom for IntelliJ IDE setup

This closes #5999


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

Branch: refs/heads/master
Commit: d82fbf4529146b38d929a3c31a767843fed3d64e
Parents: 10c9f87
Author: Yazdan.JS <y_...@yahoo.com>
Authored: Sat May 12 17:00:54 2018 -0400
Committer: Stephan Ewen <se...@apache.org>
Committed: Sun May 13 13:51:00 2018 +0200

----------------------------------------------------------------------
 docs/internals/ide_setup.md | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/d82fbf45/docs/internals/ide_setup.md
----------------------------------------------------------------------
diff --git a/docs/internals/ide_setup.md b/docs/internals/ide_setup.md
index 340544d..dd72c6b 100644
--- a/docs/internals/ide_setup.md
+++ b/docs/internals/ide_setup.md
@@ -81,7 +81,7 @@ to enable support for Scala projects and files:
    files for the IDE to work with but without installing libraries.
 8. Build the Project (Build -> Make Project)
 
-### Checkstyle
+### Checkstyle For Java
 IntelliJ supports checkstyle within the IDE using the Checkstyle-IDEA plugin.
 
 1. Install the "Checkstyle-IDEA" plugin from the IntelliJ plugin repository.
@@ -108,10 +108,15 @@ Once the plugin is installed you can directly import `"tools/maven/checkstyle.xm
 You can scan an entire module by opening the Checkstyle tools window and
 clicking the "Check Module" button. The scan should report no errors.
 
+### Checkstyle For Scala
+
+Enable scalastyle in Intellij by selecting Settings -> Editor -> Inspections, then searching for "Scala style inspections". Also Place `"tools/maven/scalastyle_config.xml"` in the `"<root>/.idea"` or `"<root>/project"` directory.
+
 <span class="label label-info">Note</span> Some modules are not fully covered by checkstyle,
 which include `flink-core`, `flink-optimizer`, and `flink-runtime`.
 Nevertheless please make sure that code you add/modify in these modules still conforms to the checkstyle rules.
 
+
 ## Eclipse
 
 **NOTE:** From our experience, this setup does not work with Flink