flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [4/4] flink git commit: [runtime] Rename internal field of Netty error message
Date Mon, 01 Jun 2015 07:24:56 GMT
[runtime] Rename internal field of Netty error message

This closes #746.


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

Branch: refs/heads/master
Commit: 93e960d8ba2a52bd070609fd6ded86b2731596eb
Parents: 6182180
Author: Ufuk Celebi <uce@apache.org>
Authored: Fri May 29 10:54:16 2015 +0200
Committer: Ufuk Celebi <uce@apache.org>
Committed: Mon Jun 1 09:24:17 2015 +0200

----------------------------------------------------------------------
 .../flink/runtime/io/network/netty/NettyMessage.java  | 14 +++++++-------
 .../network/netty/PartitionRequestClientHandler.java  |  6 +++---
 .../network/netty/NettyMessageSerializationTest.java  | 12 ++++++------
 .../io/network/netty/PartitionRequestQueueTest.java   |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/93e960d8/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
index d0840b0..53afd03 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/NettyMessage.java
@@ -264,19 +264,19 @@ abstract class NettyMessage {
 
 		private static final byte ID = 1;
 
-		Throwable error;
+		Throwable cause;
 
 		InputChannelID receiverId;
 
 		public ErrorResponse() {
 		}
 
-		ErrorResponse(Throwable error) {
-			this.error = error;
+		ErrorResponse(Throwable cause) {
+			this.cause = cause;
 		}
 
-		ErrorResponse(Throwable error, InputChannelID receiverId) {
-			this.error = error;
+		ErrorResponse(Throwable cause, InputChannelID receiverId) {
+			this.cause = cause;
 			this.receiverId = receiverId;
 		}
 
@@ -297,7 +297,7 @@ abstract class NettyMessage {
 
 				oos = new ObjectOutputStream(new DataOutputViewStream(outputView));
 
-				oos.writeObject(error);
+				oos.writeObject(cause);
 
 				if (receiverId != null) {
 					result.writeBoolean(true);
@@ -338,7 +338,7 @@ abstract class NettyMessage {
 					throw new ClassCastException("Read object expected to be of type Throwable, " +
 							"actual type is " + obj.getClass() + ".");
 				} else {
-					error = (Throwable) obj;
+					cause = (Throwable) obj;
 
 					if (buffer.readBoolean()) {
 						receiverId = InputChannelID.fromByteBuf(buffer);

http://git-wip-us.apache.org/repos/asf/flink/blob/93e960d8/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java
index 985e2a5..508cac9 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/PartitionRequestClientHandler.java
@@ -222,19 +222,19 @@ class PartitionRequestClientHandler extends ChannelInboundHandlerAdapter
{
 			if (error.isFatalError()) {
 				notifyAllChannelsOfErrorAndClose(new RemoteTransportException(
 						"Fatal error at remote task manager '" + remoteAddr + "'.",
-						remoteAddr, error.error));
+						remoteAddr, error.cause));
 			}
 			else {
 				RemoteInputChannel inputChannel = inputChannels.get(error.receiverId);
 
 				if (inputChannel != null) {
-					if (error.error.getClass() == PartitionNotFoundException.class) {
+					if (error.cause.getClass() == PartitionNotFoundException.class) {
 						inputChannel.onFailedPartitionRequest();
 					}
 					else {
 						inputChannel.onError(new RemoteTransportException(
 								"Error at remote task manager '" + remoteAddr + "'.",
-										remoteAddr, error.error));
+										remoteAddr, error.cause));
 					}
 				}
 			}

http://git-wip-us.apache.org/repos/asf/flink/blob/93e960d8/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyMessageSerializationTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyMessageSerializationTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyMessageSerializationTest.java
index b464692..b1315be 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyMessageSerializationTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/NettyMessageSerializationTest.java
@@ -93,8 +93,8 @@ public class NettyMessageSerializationTest {
 				NettyMessage.ErrorResponse expected = new NettyMessage.ErrorResponse(expectedError, receiverId);
 				NettyMessage.ErrorResponse actual = encodeAndDecode(expected);
 
-				assertEquals(expected.error.getClass(), actual.error.getClass());
-				assertEquals(expected.error.getMessage(), actual.error.getMessage());
+				assertEquals(expected.cause.getClass(), actual.cause.getClass());
+				assertEquals(expected.cause.getMessage(), actual.cause.getMessage());
 				assertEquals(receiverId, actual.receiverId);
 			}
 
@@ -105,8 +105,8 @@ public class NettyMessageSerializationTest {
 				NettyMessage.ErrorResponse expected = new NettyMessage.ErrorResponse(expectedError, receiverId);
 				NettyMessage.ErrorResponse actual = encodeAndDecode(expected);
 
-				assertEquals(expected.error.getClass(), actual.error.getClass());
-				assertEquals(expected.error.getMessage(), actual.error.getMessage());
+				assertEquals(expected.cause.getClass(), actual.cause.getClass());
+				assertEquals(expected.cause.getMessage(), actual.cause.getMessage());
 				assertEquals(receiverId, actual.receiverId);
 			}
 
@@ -116,8 +116,8 @@ public class NettyMessageSerializationTest {
 				NettyMessage.ErrorResponse expected = new NettyMessage.ErrorResponse(expectedError);
 				NettyMessage.ErrorResponse actual = encodeAndDecode(expected);
 
-				assertEquals(expected.error.getClass(), actual.error.getClass());
-				assertEquals(expected.error.getMessage(), actual.error.getMessage());
+				assertEquals(expected.cause.getClass(), actual.cause.getClass());
+				assertEquals(expected.cause.getMessage(), actual.cause.getMessage());
 				assertNull(actual.receiverId);
 				assertTrue(actual.isFatalError());
 			}

http://git-wip-us.apache.org/repos/asf/flink/blob/93e960d8/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java
index 594c686..3f281bd 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/netty/PartitionRequestQueueTest.java
@@ -51,6 +51,6 @@ public class PartitionRequestQueueTest {
 		assertEquals(msg.getClass(), NettyMessage.ErrorResponse.class);
 
 		NettyMessage.ErrorResponse err = (NettyMessage.ErrorResponse) msg;
-		assertTrue(err.error instanceof CancelTaskException);
+		assertTrue(err.cause instanceof CancelTaskException);
 	}
 }


Mime
View raw message