You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by sr...@apache.org on 2018/05/13 19:35:11 UTC
[1/2] storm git commit: STORM-3065: Reduce storm-server test fork
count to 1, fix some test-specific NPEs
Repository: storm
Updated Branches:
refs/heads/master 5deba40fc -> 3dbc67f4c
STORM-3065: Reduce storm-server test fork count to 1, fix some test-specific NPEs
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/d541e60b
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/d541e60b
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/d541e60b
Branch: refs/heads/master
Commit: d541e60bc41f9cbe3ba1469966bd9031ebaec207
Parents: 290458c
Author: Stig Rohde Døssing <sr...@apache.org>
Authored: Wed May 9 21:14:40 2018 +0200
Committer: Stig Rohde Døssing <sr...@apache.org>
Committed: Thu May 10 01:29:59 2018 +0200
----------------------------------------------------------------------
.../src/jvm/org/apache/storm/zookeeper/ClientZookeeper.java | 8 ++++----
storm-server/pom.xml | 7 +++++++
.../java/org/apache/storm/testing/InProcessZookeeper.java | 8 ++------
.../src/main/java/org/apache/storm/zookeeper/Zookeeper.java | 4 ++--
.../org/apache/storm/blobstore/LocalFsBlobStoreTest.java | 8 ++++----
5 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/d541e60b/storm-client/src/jvm/org/apache/storm/zookeeper/ClientZookeeper.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/zookeeper/ClientZookeeper.java b/storm-client/src/jvm/org/apache/storm/zookeeper/ClientZookeeper.java
index b31057f..d443984 100644
--- a/storm-client/src/jvm/org/apache/storm/zookeeper/ClientZookeeper.java
+++ b/storm-client/src/jvm/org/apache/storm/zookeeper/ClientZookeeper.java
@@ -77,14 +77,14 @@ public class ClientZookeeper {
// Deletes the state inside the zookeeper for a key, for which the
// contents of the key starts with nimbus host port information
public static void deleteNodeBlobstore(CuratorFramework zk, String parentPath, String hostPortInfo) {
- String normalizedPatentPath = normalizePath(parentPath);
+ String normalizedParentPath = normalizePath(parentPath);
List<String> childPathList = null;
- if (existsNode(zk, normalizedPatentPath, false)) {
- childPathList = getChildren(zk, normalizedPatentPath, false);
+ if (existsNode(zk, normalizedParentPath, false)) {
+ childPathList = getChildren(zk, normalizedParentPath, false);
for (String child : childPathList) {
if (child.startsWith(hostPortInfo)) {
LOG.debug("deleteNode child {}", child);
- deleteNode(zk, normalizedPatentPath + "/" + child);
+ deleteNode(zk, normalizedParentPath + "/" + child);
}
}
}
http://git-wip-us.apache.org/repos/asf/storm/blob/d541e60b/storm-server/pom.xml
----------------------------------------------------------------------
diff --git a/storm-server/pom.xml b/storm-server/pom.xml
index 236b4f1..d1b855c 100644
--- a/storm-server/pom.xml
+++ b/storm-server/pom.xml
@@ -119,6 +119,13 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkCount>1</forkCount>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<configuration>
<reportsDirectories>
http://git-wip-us.apache.org/repos/asf/storm/blob/d541e60b/storm-server/src/main/java/org/apache/storm/testing/InProcessZookeeper.java
----------------------------------------------------------------------
diff --git a/storm-server/src/main/java/org/apache/storm/testing/InProcessZookeeper.java b/storm-server/src/main/java/org/apache/storm/testing/InProcessZookeeper.java
index 38db6da..c18edcc 100644
--- a/storm-server/src/main/java/org/apache/storm/testing/InProcessZookeeper.java
+++ b/storm-server/src/main/java/org/apache/storm/testing/InProcessZookeeper.java
@@ -26,21 +26,17 @@ public class InProcessZookeeper implements AutoCloseable {
private final TmpPath zkTmp;
private final NIOServerCnxnFactory zookeeper;
- private final long zkPort;
public InProcessZookeeper() throws Exception {
zkTmp = new TmpPath();
- @SuppressWarnings("unchecked")
- List<Object> portAndHandle = Zookeeper.mkInprocessZookeeper(zkTmp.getPath(), null);
- zkPort = (Long) portAndHandle.get(0);
- zookeeper = (NIOServerCnxnFactory) portAndHandle.get(1);
+ zookeeper = Zookeeper.mkInprocessZookeeper(zkTmp.getPath(), null);
}
/**
* @return the port ZK is listening on (localhost)
*/
public long getPort() {
- return zkPort;
+ return zookeeper.getLocalPort();
}
@Override
http://git-wip-us.apache.org/repos/asf/storm/blob/d541e60b/storm-server/src/main/java/org/apache/storm/zookeeper/Zookeeper.java
----------------------------------------------------------------------
diff --git a/storm-server/src/main/java/org/apache/storm/zookeeper/Zookeeper.java b/storm-server/src/main/java/org/apache/storm/zookeeper/Zookeeper.java
index c5497b5..7a060f8 100644
--- a/storm-server/src/main/java/org/apache/storm/zookeeper/Zookeeper.java
+++ b/storm-server/src/main/java/org/apache/storm/zookeeper/Zookeeper.java
@@ -72,7 +72,7 @@ public class Zookeeper {
_instance = INSTANCE;
}
- public static List mkInprocessZookeeper(String localdir, Integer port) throws Exception {
+ public static NIOServerCnxnFactory mkInprocessZookeeper(String localdir, Integer port) throws Exception {
File localfile = new File(localdir);
ZooKeeperServer zk = new ZooKeeperServer(localfile, localfile, 2000);
NIOServerCnxnFactory factory = null;
@@ -96,7 +96,7 @@ public class Zookeeper {
}
LOG.info("Starting inprocess zookeeper at port {} and dir {}", report, localdir);
factory.startup(zk);
- return Arrays.asList((Object) new Long(report), (Object) factory);
+ return factory;
}
public static void shutdownInprocessZookeeper(NIOServerCnxnFactory handle) {
http://git-wip-us.apache.org/repos/asf/storm/blob/d541e60b/storm-server/src/test/java/org/apache/storm/blobstore/LocalFsBlobStoreTest.java
----------------------------------------------------------------------
diff --git a/storm-server/src/test/java/org/apache/storm/blobstore/LocalFsBlobStoreTest.java b/storm-server/src/test/java/org/apache/storm/blobstore/LocalFsBlobStoreTest.java
index 5499714..b2045bf 100644
--- a/storm-server/src/test/java/org/apache/storm/blobstore/LocalFsBlobStoreTest.java
+++ b/storm-server/src/test/java/org/apache/storm/blobstore/LocalFsBlobStoreTest.java
@@ -46,7 +46,6 @@ import org.slf4j.LoggerFactory;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
public class LocalFsBlobStoreTest {
@@ -67,7 +66,7 @@ public class LocalFsBlobStoreTest {
try {
zk = new InProcessZookeeper();
} catch (Exception e) {
- e.printStackTrace();
+ throw new RuntimeException(e);
}
}
@@ -77,7 +76,7 @@ public class LocalFsBlobStoreTest {
try {
zk.close();
} catch (Exception e) {
- e.printStackTrace();
+ throw new RuntimeException(e);
}
}
@@ -100,7 +99,8 @@ public class LocalFsBlobStoreTest {
conf.put(Config.STORM_ZOOKEEPER_PORT, zk.getPort());
conf.put(Config.STORM_LOCAL_DIR, baseFile.getAbsolutePath());
conf.put(Config.STORM_PRINCIPAL_TO_LOCAL_PLUGIN,"org.apache.storm.security.auth.DefaultPrincipalToLocal");
- spy.prepare(conf, null, mock(NimbusInfo.class), null);
+ NimbusInfo nimbusInfo = new NimbusInfo("localhost", 0, false);
+ spy.prepare(conf, null, nimbusInfo, null);
return spy;
}
[2/2] storm git commit: Merge branch 'STORM-3065' of
https://github.com/srdo/storm into STORM-3065-merge
Posted by sr...@apache.org.
Merge branch 'STORM-3065' of https://github.com/srdo/storm into STORM-3065-merge
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/3dbc67f4
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/3dbc67f4
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/3dbc67f4
Branch: refs/heads/master
Commit: 3dbc67f4c5cd1b8a77b365dd3b8dcf723af82e3c
Parents: 5deba40 d541e60
Author: Stig Rohde Døssing <sr...@apache.org>
Authored: Sun May 13 21:34:41 2018 +0200
Committer: Stig Rohde Døssing <sr...@apache.org>
Committed: Sun May 13 21:34:41 2018 +0200
----------------------------------------------------------------------
.../src/jvm/org/apache/storm/zookeeper/ClientZookeeper.java | 8 ++++----
storm-server/pom.xml | 7 +++++++
.../java/org/apache/storm/testing/InProcessZookeeper.java | 8 ++------
.../src/main/java/org/apache/storm/zookeeper/Zookeeper.java | 4 ++--
.../org/apache/storm/blobstore/LocalFsBlobStoreTest.java | 8 ++++----
5 files changed, 19 insertions(+), 16 deletions(-)
----------------------------------------------------------------------