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/26 19:16:22 UTC
[13/15] flink git commit: [FLINK-6701] Activate strict checkstyle for
flink-yarn
http://git-wip-us.apache.org/repos/asf/flink/blob/77b0fb9f/flink-yarn/src/test/java/org/apache/flink/yarn/highavailability/YarnPreConfiguredMasterHaServicesTest.java
----------------------------------------------------------------------
diff --git a/flink-yarn/src/test/java/org/apache/flink/yarn/highavailability/YarnPreConfiguredMasterHaServicesTest.java b/flink-yarn/src/test/java/org/apache/flink/yarn/highavailability/YarnPreConfiguredMasterHaServicesTest.java
index 07c952a..30c2d1e 100644
--- a/flink-yarn/src/test/java/org/apache/flink/yarn/highavailability/YarnPreConfiguredMasterHaServicesTest.java
+++ b/flink-yarn/src/test/java/org/apache/flink/yarn/highavailability/YarnPreConfiguredMasterHaServicesTest.java
@@ -29,7 +29,6 @@ import org.apache.flink.util.TestLogger;
import org.apache.flink.yarn.configuration.YarnConfigOptions;
import org.apache.hadoop.hdfs.MiniDFSCluster;
-
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.Before;
@@ -44,14 +43,17 @@ import java.io.FileNotFoundException;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+/**
+ * Tests for YarnPreConfiguredMasterNonHaServices.
+ */
public class YarnPreConfiguredMasterHaServicesTest extends TestLogger {
@ClassRule
public static final TemporaryFolder TEMP_DIR = new TemporaryFolder();
- private static MiniDFSCluster HDFS_CLUSTER;
+ private static MiniDFSCluster hdfsCluster;
- private static Path HDFS_ROOT_PATH;
+ private static Path hdfsRootPath;
private org.apache.hadoop.conf.Configuration hadoopConfig;
@@ -69,23 +71,23 @@ public class YarnPreConfiguredMasterHaServicesTest extends TestLogger {
hdConf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, tempDir.getAbsolutePath());
MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(hdConf);
- HDFS_CLUSTER = builder.build();
- HDFS_ROOT_PATH = new Path(HDFS_CLUSTER.getURI());
+ hdfsCluster = builder.build();
+ hdfsRootPath = new Path(hdfsCluster.getURI());
}
@AfterClass
public static void destroyHDFS() {
- if (HDFS_CLUSTER != null) {
- HDFS_CLUSTER.shutdown();
+ if (hdfsCluster != null) {
+ hdfsCluster.shutdown();
}
- HDFS_CLUSTER = null;
- HDFS_ROOT_PATH = null;
+ hdfsCluster = null;
+ hdfsRootPath = null;
}
@Before
public void initConfig() {
hadoopConfig = new org.apache.hadoop.conf.Configuration();
- hadoopConfig.set(org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY, HDFS_ROOT_PATH.toString());
+ hadoopConfig.set(org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY, hdfsRootPath.toString());
}
// ------------------------------------------------------------------------
@@ -142,9 +144,9 @@ public class YarnPreConfiguredMasterHaServicesTest extends TestLogger {
HighAvailabilityServicesUtils.AddressResolution.NO_ADDRESS_RESOLUTION);
services.closeAndCleanupAllData();
- final FileSystem fileSystem = HDFS_ROOT_PATH.getFileSystem();
- final Path workDir = new Path(HDFS_CLUSTER.getFileSystem().getWorkingDirectory().toString());
-
+ final FileSystem fileSystem = hdfsRootPath.getFileSystem();
+ final Path workDir = new Path(hdfsCluster.getFileSystem().getWorkingDirectory().toString());
+
try {
fileSystem.getFileStatus(new Path(workDir, YarnHighAvailabilityServices.FLINK_RECOVERY_DATA_DIR));
fail("Flink recovery data directory still exists");
@@ -181,7 +183,6 @@ public class YarnPreConfiguredMasterHaServicesTest extends TestLogger {
fail();
} catch (UnsupportedOperationException ignored) {}
-
services.close();
// all these methods should fail now
http://git-wip-us.apache.org/repos/asf/flink/blob/77b0fb9f/flink-yarn/src/test/java/org/apache/flink/yarn/messages/NotifyWhenResourcesRegistered.java
----------------------------------------------------------------------
diff --git a/flink-yarn/src/test/java/org/apache/flink/yarn/messages/NotifyWhenResourcesRegistered.java b/flink-yarn/src/test/java/org/apache/flink/yarn/messages/NotifyWhenResourcesRegistered.java
index ad5e683..77633ac 100644
--- a/flink-yarn/src/test/java/org/apache/flink/yarn/messages/NotifyWhenResourcesRegistered.java
+++ b/flink-yarn/src/test/java/org/apache/flink/yarn/messages/NotifyWhenResourcesRegistered.java
@@ -18,6 +18,9 @@
package org.apache.flink.yarn.messages;
+/**
+ * Test message that causes the sender to be notified then a set number of resources were registered.
+ */
public class NotifyWhenResourcesRegistered {
private final int numberResources;
http://git-wip-us.apache.org/repos/asf/flink/blob/77b0fb9f/flink-yarn/src/test/java/org/apache/flink/yarn/messages/RequestNumberOfRegisteredResources.java
----------------------------------------------------------------------
diff --git a/flink-yarn/src/test/java/org/apache/flink/yarn/messages/RequestNumberOfRegisteredResources.java b/flink-yarn/src/test/java/org/apache/flink/yarn/messages/RequestNumberOfRegisteredResources.java
index ccccbab..f84b794 100644
--- a/flink-yarn/src/test/java/org/apache/flink/yarn/messages/RequestNumberOfRegisteredResources.java
+++ b/flink-yarn/src/test/java/org/apache/flink/yarn/messages/RequestNumberOfRegisteredResources.java
@@ -18,8 +18,11 @@
package org.apache.flink.yarn.messages;
+/**
+ * Test message that returns the number of registered resources.
+ */
public class RequestNumberOfRegisteredResources {
- public static RequestNumberOfRegisteredResources Instance = new RequestNumberOfRegisteredResources();
+ public static final RequestNumberOfRegisteredResources INSTANCE = new RequestNumberOfRegisteredResources();
private RequestNumberOfRegisteredResources() {}
}