You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2017/05/25 11:06:38 UTC

[1/4] flink git commit: [FLINK-6669] set inputEncoding to UTF-8 in scalastyle-maven-plugin

Repository: flink
Updated Branches:
  refs/heads/release-1.3 0f86deed2 -> 401e99759


[FLINK-6669] set inputEncoding to UTF-8 in scalastyle-maven-plugin


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

Branch: refs/heads/release-1.3
Commit: 401e997593631399e4311511f942692a0187e4bb
Parents: d1ae1cd
Author: lingjinjiang <li...@gmail.com>
Authored: Tue May 23 10:51:46 2017 +0800
Committer: zentol <ch...@apache.org>
Committed: Wed May 24 16:52:02 2017 +0200

----------------------------------------------------------------------
 pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/401e9975/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cda1b9c..09e56ff 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1306,6 +1306,7 @@ under the License.
 						<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
 						<testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
 						<outputFile>${project.basedir}/target/scalastyle-output.xml</outputFile>
+						<inputEncoding>UTF-8</inputEncoding>
 						<outputEncoding>UTF-8</outputEncoding>
 					</configuration>
 				</plugin>


[4/4] flink git commit: [FLINK-6659] fix RocksDBMergeIteratorTest leaving temporary data behind

Posted by ch...@apache.org.
[FLINK-6659] fix RocksDBMergeIteratorTest leaving temporary data behind

-> use a JUnit '@Rule' that does the cleanup


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

Branch: refs/heads/release-1.3
Commit: 0824333ead39ed383be10e5a1fe13440dbd5fa88
Parents: 0f86dee
Author: Nico Kruber <ni...@data-artisans.com>
Authored: Mon May 22 16:47:35 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Wed May 24 16:52:02 2017 +0200

----------------------------------------------------------------------
 .../state/RocksDBMergeIteratorTest.java          | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/0824333e/flink-contrib/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBMergeIteratorTest.java
----------------------------------------------------------------------
diff --git a/flink-contrib/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBMergeIteratorTest.java b/flink-contrib/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBMergeIteratorTest.java
index 956ef2f..f5bcf86 100644
--- a/flink-contrib/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBMergeIteratorTest.java
+++ b/flink-contrib/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBMergeIteratorTest.java
@@ -21,16 +21,16 @@ package org.apache.flink.contrib.streaming.state;
 import org.apache.flink.api.java.tuple.Tuple2;
 import org.apache.flink.configuration.ConfigConstants;
 import org.apache.flink.core.memory.ByteArrayOutputStreamWithPos;
-import org.apache.flink.runtime.testutils.CommonTestUtils;
 import org.junit.Assert;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
 import org.rocksdb.ColumnFamilyDescriptor;
 import org.rocksdb.ColumnFamilyHandle;
 import org.rocksdb.RocksDB;
 import org.rocksdb.RocksIterator;
 
 import java.io.DataOutputStream;
-import java.io.File;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
@@ -43,6 +43,9 @@ public class RocksDBMergeIteratorTest {
 	private static final int NUM_KEY_VAL_STATES = 50;
 	private static final int MAX_NUM_KEYS = 20;
 
+	@Rule
+	public TemporaryFolder tempFolder = new TemporaryFolder();
+
 	@Test
 	public void testEmptyMergeIterator() throws IOException {
 		RocksDBKeyedStateBackend.RocksDBMergeIterator emptyIterator =
@@ -51,19 +54,23 @@ public class RocksDBMergeIteratorTest {
 	}
 
 	@Test
-	public void testMergeIterator() throws Exception {
+	public void testMergeIteratorByte() throws Exception {
 		Assert.assertTrue(MAX_NUM_KEYS <= Byte.MAX_VALUE);
 
 		testMergeIterator(Byte.MAX_VALUE);
+	}
+
+	@Test
+	public void testMergeIteratorShort() throws Exception {
+		Assert.assertTrue(MAX_NUM_KEYS <= Byte.MAX_VALUE);
+
 		testMergeIterator(Short.MAX_VALUE);
 	}
 
 	public void testMergeIterator(int maxParallelism) throws Exception {
 		Random random = new Random(1234);
 
-		File tmpDir = CommonTestUtils.createTempDirectory();
-
-		RocksDB rocksDB = RocksDB.open(tmpDir.getAbsolutePath());
+		RocksDB rocksDB = RocksDB.open(tempFolder.getRoot().getAbsolutePath());
 		try {
 			List<Tuple2<RocksIterator, Integer>> rocksIteratorsWithKVStateId = new ArrayList<>();
 			List<Tuple2<ColumnFamilyHandle, Integer>> columnFamilyHandlesWithKeyCount = new ArrayList<>();


[2/4] flink git commit: [FLINK-6659] fix SavepointITCase leaving temporary data behind

Posted by ch...@apache.org.
[FLINK-6659] fix SavepointITCase leaving temporary data behind

-> use a JUnit '@Rule' that does the cleanup

This closes #3962.


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

Branch: refs/heads/release-1.3
Commit: 4767f84b4c22fba40de31a3c0c81dfc97cec6a7e
Parents: 0824333
Author: Nico Kruber <ni...@data-artisans.com>
Authored: Mon May 22 16:55:39 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Wed May 24 16:52:02 2017 +0200

----------------------------------------------------------------------
 .../org/apache/flink/test/checkpointing/SavepointITCase.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/4767f84b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
index 72a1b63..1c8a429 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/SavepointITCase.java
@@ -68,7 +68,6 @@ import org.apache.flink.runtime.testingUtils.TestingJobManagerMessages.ResponseS
 import org.apache.flink.runtime.testingUtils.TestingJobManagerMessages.WaitForAllVerticesToBeRunning;
 import org.apache.flink.runtime.testingUtils.TestingTaskManagerMessages;
 import org.apache.flink.runtime.testingUtils.TestingTaskManagerMessages.ResponseSubmitTaskListener;
-import org.apache.flink.runtime.testutils.CommonTestUtils;
 import org.apache.flink.streaming.api.checkpoint.ListCheckpointed;
 import org.apache.flink.streaming.api.datastream.DataStream;
 import org.apache.flink.streaming.api.datastream.IterativeStream;
@@ -143,7 +142,7 @@ public class SavepointITCase extends TestLogger {
 		final int numSlotsPerTaskManager = 2;
 		final int parallelism = numTaskManagers * numSlotsPerTaskManager;
 		final Deadline deadline = new FiniteDuration(5, TimeUnit.MINUTES).fromNow();
-		final File testRoot = folder.newFolder();
+		final File testRoot = folder.getRoot();
 
 		TestingCluster flink = null;
 
@@ -424,7 +423,7 @@ public class SavepointITCase extends TestLogger {
 		// Test deadline
 		final Deadline deadline = new FiniteDuration(5, TimeUnit.MINUTES).fromNow();
 
-		final File tmpDir = CommonTestUtils.createTempDirectory();
+		final File tmpDir = folder.getRoot();
 		final File savepointDir = new File(tmpDir, "savepoints");
 
 		TestingCluster flink = null;
@@ -494,7 +493,7 @@ public class SavepointITCase extends TestLogger {
 		// Test deadline
 		final Deadline deadline = new FiniteDuration(5, TimeUnit.MINUTES).fromNow();
 
-		final File tmpDir = CommonTestUtils.createTempDirectory();
+		final File tmpDir = folder.getRoot();
 		final File savepointDir = new File(tmpDir, "savepoints");
 
 		TestingCluster flink = null;


[3/4] flink git commit: [FLINK-6320] fix unit test failing sometimes when deleting a temp directory

Posted by ch...@apache.org.
[FLINK-6320] fix unit test failing sometimes when deleting a temp directory

This closes #3966.


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

Branch: refs/heads/release-1.3
Commit: d1ae1cd73665c6870111a1d1d413e41dd77da095
Parents: 4767f84
Author: Nico Kruber <ni...@data-artisans.com>
Authored: Mon May 22 16:31:08 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Wed May 24 16:52:02 2017 +0200

----------------------------------------------------------------------
 .../JobManagerHAJobGraphRecoveryITCase.java     | 36 ++++++--------------
 1 file changed, 10 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/d1ae1cd7/flink-tests/src/test/java/org/apache/flink/test/recovery/JobManagerHAJobGraphRecoveryITCase.java
----------------------------------------------------------------------
diff --git a/flink-tests/src/test/java/org/apache/flink/test/recovery/JobManagerHAJobGraphRecoveryITCase.java b/flink-tests/src/test/java/org/apache/flink/test/recovery/JobManagerHAJobGraphRecoveryITCase.java
index 052195a..80b8e18 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/recovery/JobManagerHAJobGraphRecoveryITCase.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/recovery/JobManagerHAJobGraphRecoveryITCase.java
@@ -49,7 +49,6 @@ import org.apache.flink.runtime.taskmanager.TaskManager;
 import org.apache.flink.runtime.testingUtils.TestingCluster;
 import org.apache.flink.runtime.testingUtils.TestingUtils;
 import org.apache.flink.runtime.testtasks.BlockingNoOpInvokable;
-import org.apache.flink.runtime.testutils.CommonTestUtils;
 import org.apache.flink.runtime.testutils.JobManagerActorTestUtils;
 import org.apache.flink.runtime.testutils.JobManagerProcess;
 import org.apache.flink.runtime.testutils.ZooKeeperTestUtils;
@@ -58,7 +57,9 @@ import org.apache.flink.util.TestLogger;
 import org.apache.zookeeper.data.Stat;
 import org.junit.AfterClass;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
 import scala.Option;
 import scala.Some;
 import scala.Tuple2;
@@ -68,7 +69,6 @@ import scala.concurrent.duration.Deadline;
 import scala.concurrent.duration.FiniteDuration;
 
 import java.io.File;
-import java.io.IOException;
 import java.util.Collection;
 import java.util.Queue;
 import java.util.UUID;
@@ -88,32 +88,16 @@ public class JobManagerHAJobGraphRecoveryITCase extends TestLogger {
 
 	private final static FiniteDuration TestTimeOut = new FiniteDuration(5, TimeUnit.MINUTES);
 
-	private static final File FileStateBackendBasePath;
-
-	static {
-		try {
-			FileStateBackendBasePath = CommonTestUtils.createTempDirectory();
-		}
-		catch (IOException e) {
-			throw new RuntimeException("Error in test setup. Could not create directory.", e);
-		}
-	}
+	@Rule
+	public TemporaryFolder tempFolder = new TemporaryFolder();
 
 	@AfterClass
 	public static void tearDown() throws Exception {
 		ZooKeeper.shutdown();
-
-		if (FileStateBackendBasePath != null) {
-			FileUtils.deleteDirectory(FileStateBackendBasePath);
-		}
 	}
 
 	@Before
 	public void cleanUp() throws Exception {
-		if (FileStateBackendBasePath != null) {
-			FileUtils.cleanDirectory(FileStateBackendBasePath);
-		}
-
 		ZooKeeper.deleteAll();
 	}
 
@@ -125,7 +109,7 @@ public class JobManagerHAJobGraphRecoveryITCase extends TestLogger {
 	@Test
 	public void testJobPersistencyWhenJobManagerShutdown() throws Exception {
 		Configuration config = ZooKeeperTestUtils.createZooKeeperHAConfig(
-				ZooKeeper.getConnectString(), FileStateBackendBasePath.getPath());
+				ZooKeeper.getConnectString(), tempFolder.getRoot().getPath());
 
 		// Configure the cluster
 		config.setInteger(ConfigConstants.LOCAL_NUMBER_JOB_MANAGER, 1);
@@ -172,7 +156,7 @@ public class JobManagerHAJobGraphRecoveryITCase extends TestLogger {
 	@Test
 	public void testClientNonDetachedListeningBehaviour() throws Exception {
 		Configuration config = ZooKeeperTestUtils.createZooKeeperHAConfig(
-				ZooKeeper.getConnectString(), FileStateBackendBasePath.getPath());
+				ZooKeeper.getConnectString(), tempFolder.getRoot().getPath());
 
 		// Test actor system
 		ActorSystem testSystem = null;
@@ -397,10 +381,10 @@ public class JobManagerHAJobGraphRecoveryITCase extends TestLogger {
 	/**
 	 * Fails the test if the recovery state (file state backend and ZooKeeper) is not clean.
 	 */
-	private static void verifyCleanRecoveryState(Configuration config) throws Exception {
+	private void verifyCleanRecoveryState(Configuration config) throws Exception {
 		// File state backend empty
 		Collection<File> stateHandles = FileUtils.listFiles(
-				FileStateBackendBasePath, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+				tempFolder.getRoot(), TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
 
 		if (!stateHandles.isEmpty()) {
 			fail("File state backend is not clean: " + stateHandles);
@@ -429,10 +413,10 @@ public class JobManagerHAJobGraphRecoveryITCase extends TestLogger {
 	/**
 	 * Fails the test if the recovery state (file state backend and ZooKeeper) has been cleaned.
 	 */
-	private static void verifyRecoveryState(Configuration config) throws Exception {
+	private void verifyRecoveryState(Configuration config) throws Exception {
 		// File state backend empty
 		Collection<File> stateHandles = FileUtils.listFiles(
-			FileStateBackendBasePath, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+				tempFolder.getRoot(), TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
 
 		if (stateHandles.isEmpty()) {
 			fail("File state backend has been cleaned: " + stateHandles);