Return-Path: X-Original-To: apmail-flink-commits-archive@minotaur.apache.org Delivered-To: apmail-flink-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 35BCC1801D for ; Mon, 25 Jan 2016 14:22:01 +0000 (UTC) Received: (qmail 21633 invoked by uid 500); 25 Jan 2016 14:22:01 -0000 Delivered-To: apmail-flink-commits-archive@flink.apache.org Received: (qmail 21585 invoked by uid 500); 25 Jan 2016 14:22:01 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 21576 invoked by uid 99); 25 Jan 2016 14:22:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jan 2016 14:22:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DF085E00B2; Mon, 25 Jan 2016 14:22:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sewen@apache.org To: commits@flink.apache.org Date: Mon, 25 Jan 2016 14:22:02 -0000 Message-Id: <854ce3b27cce4d818f9399f6d35654de@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/6] flink git commit: [hotfix] Remove use of StringUtils.stringifyException() where used is counterindicated [hotfix] Remove use of StringUtils.stringifyException() where used is counterindicated Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/6823895a Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/6823895a Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/6823895a Branch: refs/heads/master Commit: 6823895a2ef776060a437e0d4979a6d8bfef48f7 Parents: 257f0b1 Author: Stephan Ewen Authored: Mon Jan 18 18:51:53 2016 +0100 Committer: Stephan Ewen Committed: Mon Jan 25 15:07:16 2016 +0100 ---------------------------------------------------------------------- .../flink/api/common/io/BinaryInputFormat.java | 13 +++++--- .../java/org/apache/flink/util/TestLogger.java | 2 +- .../flink/runtime/util/SerializableHashMap.java | 8 ++--- .../apache/flink/runtime/blob/BlobKeyTest.java | 35 ++++++-------------- .../test/cancelling/CancelingTestBase.java | 6 ++-- 5 files changed, 27 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/6823895a/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java ---------------------------------------------------------------------- diff --git a/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java b/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java index e738d52..3789544 100644 --- a/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java +++ b/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java @@ -29,7 +29,6 @@ import org.apache.flink.core.fs.FileSystem; import org.apache.flink.core.fs.Path; import org.apache.flink.core.memory.DataInputView; import org.apache.flink.core.memory.DataInputViewStreamWrapper; -import org.apache.flink.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -169,13 +168,17 @@ public abstract class BinaryInputFormat extends FileInputFormat { return createStatistics(allFiles, stats); } catch (IOException ioex) { if (LOG.isWarnEnabled()) { - LOG.warn(String.format("Could not determine complete statistics for file '%s' due to an I/O error: %s", - this.filePath, StringUtils.stringifyException(ioex))); + LOG.warn( + String.format("Could not determine complete statistics for file '%s' due to an I/O error", + this.filePath), + ioex); } } catch (Throwable t) { if (LOG.isErrorEnabled()) { - LOG.error(String.format("Unexpected problem while getting the file statistics for file '%s' due to %s", - this.filePath, StringUtils.stringifyException(t))); + LOG.error( + String.format("Unexpected problem while getting the file statistics for file '%s'", + this.filePath), + t); } } // no stats available http://git-wip-us.apache.org/repos/asf/flink/blob/6823895a/flink-core/src/test/java/org/apache/flink/util/TestLogger.java ---------------------------------------------------------------------- diff --git a/flink-core/src/test/java/org/apache/flink/util/TestLogger.java b/flink-core/src/test/java/org/apache/flink/util/TestLogger.java index 7166d06..bf8d378 100644 --- a/flink-core/src/test/java/org/apache/flink/util/TestLogger.java +++ b/flink-core/src/test/java/org/apache/flink/util/TestLogger.java @@ -56,7 +56,7 @@ public class TestLogger { log.error("\n--------------------------------------------------------------------------------" + "\nTest {} failed with:\n{}" + "\n================================================================================" - , description, StringUtils.stringifyException(e)); + , description, ExceptionUtils.stringifyException(e)); } }; } http://git-wip-us.apache.org/repos/asf/flink/blob/6823895a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java b/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java index 2744fe8..dae1827 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/SerializableHashMap.java @@ -76,14 +76,14 @@ public class SerializableHashMap) Class.forName(keyType); } catch (ClassNotFoundException e) { - throw new IOException(StringUtils.stringifyException(e)); + throw new IOException(e); } K key = null; try { key = keyClass.newInstance(); } catch (Exception e) { - throw new IOException(StringUtils.stringifyException(e)); + throw new IOException(e); } key.read(in); @@ -93,14 +93,14 @@ public class SerializableHashMap) Class.forName(valueType); } catch (ClassNotFoundException e) { - throw new IOException(StringUtils.stringifyException(e)); + throw new IOException(e); } V value; try { value = valueClass.newInstance(); } catch (Exception e) { - throw new IOException(StringUtils.stringifyException(e)); + throw new IOException(e); } value.read(in); http://git-wip-us.apache.org/repos/asf/flink/blob/6823895a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java index 6f873de..4071a1c 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobKeyTest.java @@ -58,15 +58,9 @@ public final class BlobKeyTest { * Tests the serialization/deserialization of BLOB keys */ @Test - public void testSerialization() { + public void testSerialization() throws Exception { final BlobKey k1 = new BlobKey(KEY_ARRAY_1); - final BlobKey k2; - try { - k2 = CommonTestUtils.createCopySerializable(k1); - } catch (IOException ioe) { - fail(StringUtils.stringifyException(ioe)); - return; - } + final BlobKey k2 = CommonTestUtils.createCopySerializable(k1); assertEquals(k1, k2); assertEquals(k1.hashCode(), k2.hashCode()); assertEquals(0, k1.compareTo(k2)); @@ -100,25 +94,16 @@ public final class BlobKeyTest { * Test the serialization/deserialization using input/output streams. */ @Test - public void testStreams() { + public void testStreams() throws Exception { final BlobKey k1 = new BlobKey(KEY_ARRAY_1); final ByteArrayOutputStream baos = new ByteArrayOutputStream(20); - try { - k1.writeToOutputStream(baos); - baos.close(); - } catch (IOException ioe) { - fail(StringUtils.stringifyException(ioe)); - return; - } - final ByteArrayInputStream bais = new ByteArrayInputStream( - baos.toByteArray()); - final BlobKey k2; - try { - k2 = BlobKey.readFromInputStream(bais); - } catch (IOException ioe) { - fail(StringUtils.stringifyException(ioe)); - return; - } + + k1.writeToOutputStream(baos); + baos.close(); + + final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + final BlobKey k2 = BlobKey.readFromInputStream(bais); + assertEquals(k1, k2); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flink/blob/6823895a/flink-tests/src/test/java/org/apache/flink/test/cancelling/CancelingTestBase.java ---------------------------------------------------------------------- diff --git a/flink-tests/src/test/java/org/apache/flink/test/cancelling/CancelingTestBase.java b/flink-tests/src/test/java/org/apache/flink/test/cancelling/CancelingTestBase.java index f6361ca..9671fce 100644 --- a/flink-tests/src/test/java/org/apache/flink/test/cancelling/CancelingTestBase.java +++ b/flink-tests/src/test/java/org/apache/flink/test/cancelling/CancelingTestBase.java @@ -132,9 +132,11 @@ public abstract class CancelingTestBase extends TestLogger { JobManagerActorTestUtils.waitForJobStatus(jobGraph.getJobID(), JobStatus.CANCELED, executor.getLeaderGateway(TestingUtils.TESTING_DURATION()), TestingUtils.TESTING_DURATION()); - } catch (Exception e) { + } + catch (Exception e) { LOG.error("Exception found in runAndCancelJob.", e); - Assert.fail(StringUtils.stringifyException(e)); + e.printStackTrace(); + Assert.fail(e.getMessage()); } }