You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by kamleshbhatt <gi...@git.apache.org> on 2016/12/24 06:54:01 UTC

[GitHub] storm pull request #1839: STORM-1292

GitHub user kamleshbhatt opened a pull request:

    https://github.com/apache/storm/pull/1839

    STORM-1292

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kamleshbhatt/storm storm_branch_1292

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/1839.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1839
    
----
commit da1c92c1f1a3c659532ce03d11a3ea376aa16e6c
Author: kamleshbhatt <kb...@gmail.com>
Date:   2016-12-05T18:52:33Z

    STORM-1308: tick-tuple-test conversion to Java

commit eb2ca1cc12ad44525fba8025b0f6f19b19cc4a51
Author: kamleshbhatt <kb...@gmail.com>
Date:   2016-12-11T06:47:34Z

    Merge branch 'master' of https://github.com/apache/storm

commit 50bebd90eabcce0bdaf4d5cb7d65e92bbfbe4985
Author: kamleshbhatt <kb...@gmail.com>
Date:   2016-12-11T06:51:07Z

    fix

commit ffcefd5c5e020a7d149b3fe5bc3d3b1173d35552
Author: kamleshbhatt <kb...@gmail.com>
Date:   2016-12-11T06:56:35Z

    remove unwanted file

commit ffc00dc44b1180312df750351778385e236cdffc
Author: kamleshbhatt <kb...@gmail.com>
Date:   2016-12-11T06:58:58Z

    removed old clj test

commit 8f6409d7b6a00fd6e7a13f76ddcbbb20d912603f
Author: kamleshbhatt <kb...@gmail.com>
Date:   2016-12-24T05:55:17Z

    Merge branch 'master' of https://github.com/apache/storm into storm_branch_1292

commit ec6e6169b046ad279f3c347e91d03863186a52a7
Author: kamleshbhatt <kb...@gmail.com>
Date:   2016-12-24T05:58:41Z

    merge

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94470914
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    +            //List<String> seeds = new ArrayList<>();
    --- End diff --
    
    remove the commented code


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94784021
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    +            //List<String> seeds = new ArrayList<>();
    +            //seeds.add("localhost");
    +            //stormConf.put(Config.NIMBUS_HOST, "localhost");
    +            //stormConf.put(Config.NIMBUS_SEEDS, seeds);
    +            //stormConf.put("storm.cluster.mode", "local");
    +            //stormConf.put(Config.STORM_LOCAL_HOSTNAME, "localhost");
    +
    +            ILocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().withSupervisors(1).withPortsPerSupervisor(2)
    +                    .withDaemonConf(stormConf).build();
    +            Thrift.SpoutDetails spoutDetails = Thrift.prepareSpoutDetails(new TestWordSpout(false), 2);
    +            Map<GlobalStreamId, Grouping> inputs = new HashMap<>();
    +            inputs.put(Utils.getGlobalStreamId("1", null), Thrift.prepareShuffleGrouping());
    +            Thrift.BoltDetails boltDetails = Thrift.prepareBoltDetails(inputs, new TestGlobalCount(), 6);
    +            Map<String, Thrift.SpoutDetails> spoutMap = new HashMap<>();
    +            spoutMap.put("1", spoutDetails);
    +            Map<String, Thrift.BoltDetails> boltMap = new HashMap<>();
    +            boltMap.put("2", boltDetails);
    +            StormTopology stormTopology = Thrift.buildTopology(spoutMap, boltMap);
    +            //TopologyBuilder builder = new TopologyBuilder();
    +            //builder.setSpout("1", new TestWordSpout(false), 2);
    +            //builder.setBolt("2", new TestGlobalCount(), 6).shuffleGrouping("1");
    +            //StormTopology stormTopology = builder.createTopology();
    +            FixedTuple[] fixedTuple = {new FixedTuple((List<Object>) Collections.singletonList((Object) "a")), new FixedTuple((List<Object>) Collections.singletonList((Object) "b")),
    --- End diff --
    
    Actually this code is not used any more `fixedTuples` with an s right below this is the one that is put into the data set.  Please delete this code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm issue #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on the issue:

    https://github.com/apache/storm/pull/1839
  
    @kamleshbhatt please take a look at other prs and edit the title of the PR to add the full JIRA id and title. Also squash your commits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm issue #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on the issue:

    https://github.com/apache/storm/pull/1839
  
    @kamleshbhatt can you add the full JIRA title to the PR . Also squash your commits.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94470723
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    --- End diff --
    
    avoid wild card imports


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94471297
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    +            //List<String> seeds = new ArrayList<>();
    +            //seeds.add("localhost");
    +            //stormConf.put(Config.NIMBUS_HOST, "localhost");
    +            //stormConf.put(Config.NIMBUS_SEEDS, seeds);
    +            //stormConf.put("storm.cluster.mode", "local");
    +            //stormConf.put(Config.STORM_LOCAL_HOSTNAME, "localhost");
    +
    +            ILocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().withSupervisors(1).withPortsPerSupervisor(2)
    +                    .withDaemonConf(stormConf).build();
    +            Thrift.SpoutDetails spoutDetails = Thrift.prepareSpoutDetails(new TestWordSpout(false), 2);
    +            Map<GlobalStreamId, Grouping> inputs = new HashMap<>();
    +            inputs.put(Utils.getGlobalStreamId("1", null), Thrift.prepareShuffleGrouping());
    +            Thrift.BoltDetails boltDetails = Thrift.prepareBoltDetails(inputs, new TestGlobalCount(), 6);
    +            Map<String, Thrift.SpoutDetails> spoutMap = new HashMap<>();
    +            spoutMap.put("1", spoutDetails);
    +            Map<String, Thrift.BoltDetails> boltMap = new HashMap<>();
    +            boltMap.put("2", boltDetails);
    +            StormTopology stormTopology = Thrift.buildTopology(spoutMap, boltMap);
    +            //TopologyBuilder builder = new TopologyBuilder();
    --- End diff --
    
    remove the commented code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm issue #1839: STORM-1292

Posted by kamleshbhatt <gi...@git.apache.org>.
Github user kamleshbhatt commented on the issue:

    https://github.com/apache/storm/pull/1839
  
    STORM-1292: port backtype.storm.messaging-test to java


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by kamleshbhatt <gi...@git.apache.org>.
Github user kamleshbhatt closed the pull request at:

    https://github.com/apache/storm/pull/1839


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94471136
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    +            //List<String> seeds = new ArrayList<>();
    +            //seeds.add("localhost");
    +            //stormConf.put(Config.NIMBUS_HOST, "localhost");
    +            //stormConf.put(Config.NIMBUS_SEEDS, seeds);
    +            //stormConf.put("storm.cluster.mode", "local");
    +            //stormConf.put(Config.STORM_LOCAL_HOSTNAME, "localhost");
    +
    +            ILocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().withSupervisors(1).withPortsPerSupervisor(2)
    --- End diff --
    
    can you indent this properly.
    LocalCluster.Builder().withSimulatedTime()
                                         .withSupervisors(1)
                                         .withPortsPerSupervisor(2)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94782513
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    --- End diff --
    
    This was in the original code https://github.com/apache/storm/blob/d5acec9e3b9473a0e8cf39c7e12393626a3ca426/storm-core/test/clj/org/apache/storm/messaging_test.clj#L32-L33
    
    But yes it should be optional.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94471598
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    +            //List<String> seeds = new ArrayList<>();
    +            //seeds.add("localhost");
    +            //stormConf.put(Config.NIMBUS_HOST, "localhost");
    +            //stormConf.put(Config.NIMBUS_SEEDS, seeds);
    +            //stormConf.put("storm.cluster.mode", "local");
    +            //stormConf.put(Config.STORM_LOCAL_HOSTNAME, "localhost");
    +
    +            ILocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().withSupervisors(1).withPortsPerSupervisor(2)
    +                    .withDaemonConf(stormConf).build();
    +            Thrift.SpoutDetails spoutDetails = Thrift.prepareSpoutDetails(new TestWordSpout(false), 2);
    +            Map<GlobalStreamId, Grouping> inputs = new HashMap<>();
    +            inputs.put(Utils.getGlobalStreamId("1", null), Thrift.prepareShuffleGrouping());
    +            Thrift.BoltDetails boltDetails = Thrift.prepareBoltDetails(inputs, new TestGlobalCount(), 6);
    +            Map<String, Thrift.SpoutDetails> spoutMap = new HashMap<>();
    +            spoutMap.put("1", spoutDetails);
    +            Map<String, Thrift.BoltDetails> boltMap = new HashMap<>();
    +            boltMap.put("2", boltDetails);
    +            StormTopology stormTopology = Thrift.buildTopology(spoutMap, boltMap);
    +            //TopologyBuilder builder = new TopologyBuilder();
    +            //builder.setSpout("1", new TestWordSpout(false), 2);
    +            //builder.setBolt("2", new TestGlobalCount(), 6).shuffleGrouping("1");
    +            //StormTopology stormTopology = builder.createTopology();
    +            FixedTuple[] fixedTuple = {new FixedTuple((List<Object>) Collections.singletonList((Object) "a")), new FixedTuple((List<Object>) Collections.singletonList((Object) "b")),
    --- End diff --
    
    I guess you are trying to create an arrray. Can we simplify this instead of hard coding into collections.singletonList?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94470860
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    --- End diff --
    
    Any reason for adding this will be used by default.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94470696
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    --- End diff --
    
    avoid wild card imports.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94782323
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    --- End diff --
    
    This is OK but for anything more complex it might be good to use https://github.com/junit-team/junit4/wiki/Parameterized-tests instead


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94783130
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    +            //List<String> seeds = new ArrayList<>();
    +            //seeds.add("localhost");
    +            //stormConf.put(Config.NIMBUS_HOST, "localhost");
    +            //stormConf.put(Config.NIMBUS_SEEDS, seeds);
    +            //stormConf.put("storm.cluster.mode", "local");
    +            //stormConf.put(Config.STORM_LOCAL_HOSTNAME, "localhost");
    +
    +            ILocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().withSupervisors(1).withPortsPerSupervisor(2)
    --- End diff --
    
    This needs to be in a try block, so the autoclose in cluster is called properly.
    
    ```
    try (ILocalCluster cluster = new LocalCluster.Builder()....build()) {
      //Rest of the test that used cluster
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94783485
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    +            //List<String> seeds = new ArrayList<>();
    +            //seeds.add("localhost");
    +            //stormConf.put(Config.NIMBUS_HOST, "localhost");
    +            //stormConf.put(Config.NIMBUS_SEEDS, seeds);
    +            //stormConf.put("storm.cluster.mode", "local");
    +            //stormConf.put(Config.STORM_LOCAL_HOSTNAME, "localhost");
    +
    +            ILocalCluster cluster = new LocalCluster.Builder().withSimulatedTime().withSupervisors(1).withPortsPerSupervisor(2)
    +                    .withDaemonConf(stormConf).build();
    +            Thrift.SpoutDetails spoutDetails = Thrift.prepareSpoutDetails(new TestWordSpout(false), 2);
    +            Map<GlobalStreamId, Grouping> inputs = new HashMap<>();
    +            inputs.put(Utils.getGlobalStreamId("1", null), Thrift.prepareShuffleGrouping());
    +            Thrift.BoltDetails boltDetails = Thrift.prepareBoltDetails(inputs, new TestGlobalCount(), 6);
    +            Map<String, Thrift.SpoutDetails> spoutMap = new HashMap<>();
    +            spoutMap.put("1", spoutDetails);
    +            Map<String, Thrift.BoltDetails> boltMap = new HashMap<>();
    +            boltMap.put("2", boltDetails);
    +            StormTopology stormTopology = Thrift.buildTopology(spoutMap, boltMap);
    +            //TopologyBuilder builder = new TopologyBuilder();
    +            //builder.setSpout("1", new TestWordSpout(false), 2);
    +            //builder.setBolt("2", new TestGlobalCount(), 6).shuffleGrouping("1");
    +            //StormTopology stormTopology = builder.createTopology();
    +            FixedTuple[] fixedTuple = {new FixedTuple((List<Object>) Collections.singletonList((Object) "a")), new FixedTuple((List<Object>) Collections.singletonList((Object) "b")),
    --- End diff --
    
    Or better yet if the commented out code works use it instead.  It is a lot smaller and fits the java API better.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1839: STORM-1292

Posted by harshach <gi...@git.apache.org>.
Github user harshach commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1839#discussion_r94470992
  
    --- Diff: storm-core/test/jvm/org/apache/storm/MessagingTest.java ---
    @@ -0,0 +1,97 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.storm;
    +
    +import org.apache.storm.generated.GlobalStreamId;
    +import org.apache.storm.generated.Grouping;
    +import org.apache.storm.generated.StormTopology;
    +import org.apache.storm.testing.*;
    +import org.apache.storm.utils.Utils;
    +import org.junit.Assert;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.*;
    +
    +public class MessagingTest {
    +    private final static Logger LOG = LoggerFactory.getLogger(MessagingTest.class);
    +
    +    @Test
    +    public void testLocalTransport() throws Exception {
    +        Config stormConf = new Config();
    +        //stormConf.putAll(Utils.readDefaultConfig());
    +        stormConf.put(Config.TOPOLOGY_WORKERS, 2);
    +        stormConf.put(Config.STORM_MESSAGING_TRANSPORT , "org.apache.storm.messaging.netty.Context");
    +        boolean[] transportOptions = {true, false};
    +        for(boolean transportOn:transportOptions) {
    +            stormConf.put(Config.STORM_LOCAL_MODE_ZMQ, transportOn);
    --- End diff --
    
    we stopped supporting ZMQ for a while now don't think this is necessary


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---