ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Gura <ag...@gridgain.com>
Subject Re: Ignite and Spark Streaming Integration Using Java
Date Mon, 21 Dec 2015 15:06:51 GMT
Jennifer,

There is no need in ExampleNodes for this test.

On Mon, Dec 21, 2015 at 6:03 PM, Jennifer Coston <
Jennifer.Coston@raytheon.com> wrote:

> Andrey,
>
> Thank you for the feedback. I have updated my code with the changes that
> you provided, but I am seeing the following errors when I try to run it.
> When I run the test, I first start two ExampleNodes and then run the JUnit
> test. Is that still the proper procedure?
>
> class org.apache.ignite.IgniteException: Failed to start manager:
> GridManagerAdapter [enabled=true,
> name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
> at
> org.apache.ignite.internal.util.IgniteUtils.convertException(IgniteUtils.java:881)
> at org.apache.ignite.Ignition.start(Ignition.java:306)
> at
> wordCount_test.TestSparkIgniteWordCount.setUp(TestSparkIgniteWordCount.java:40)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
> at
> org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
> at
> org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
> at
> org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
> at
> org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
> at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start
> manager: GridManagerAdapter [enabled=true,
> name=org.apache.ignite.internal.managers.discovery.GridDiscoveryManager]
> at
> org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1488)
> at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:908)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:1617)
> at
> org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1484)
> at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:965)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:494)
> at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:470)
> at org.apache.ignite.Ignition.start(Ignition.java:303)
> ... 21 more
> Caused by: class org.apache.ignite.IgniteCheckedException: Remote node has
> peer class loading enabled flag different from local [locId8=3b7130ea,
> locPeerClassLoading=false, rmtId8=d92e93a6, rmtPeerClassLoading=true,
> rmtAddrs=[2601:151:c200:6d4:0:0:0:ef63/0:0:0:0:0:0:0:1,
> DULL-AI356580.us.ray.com/127.0.0.1,
> DULL-AI356580.us.ray.com/147.25.241.114, /2002:9319:f172:0:0:0:9319:f172,
> /2601:151:c200:6d4:0:0:0:ef63]]
> at
> org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.checkAttributes(GridDiscoveryManager.java:1028)
> at
> org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.start(GridDiscoveryManager.java:686)
> at
> org.apache.ignite.internal.IgniteKernal.startManager(IgniteKernal.java:1485)
> ... 28 more
>
>
> Here is my updated JUnit Test:
>
> package wordCount_test;
>
> import static org.junit.Assert.*;
>
> import java.io.File;
> import java.io.InputStream;
> import java.io.InputStreamReader;
> import java.io.LineNumberReader;
>
> import org.apache.ignite.lang.IgniteOutClosure;
> import org.apache.ignite.spark.JavaIgniteContext;
> import org.apache.ignite.cache.affinity.AffinityUuid;
> import org.apache.ignite.configuration.*;
> import org.apache.ignite.internal.util.typedef.F;
> import org.apache.ignite.Ignite;
> import org.apache.ignite.IgniteCache;
> import org.apache.ignite.IgniteDataStreamer;
> import org.apache.ignite.Ignition;
> import org.apache.spark.api.java.JavaPairRDD;
> import org.apache.spark.api.java.JavaRDD;
> import org.apache.spark.api.java.JavaSparkContext;
> import org.junit.After;
> import org.junit.Before;
> import org.junit.Test;
>
> import testWordCount.SparkIgniteWordCount;
> import testWordCount.CacheConfig;
> import testWordCount.ExamplesUtils;
>
> public class TestSparkIgniteWordCount {
>
> JavaSparkContext jsc;
> JavaIgniteContext<String, Integer> jic;
> File txtFile;
>
>
> //In order to run this test, you must first start two ExampleNodeStartup
> Servers
> @Before
> public void setUp() throws Exception {
> Ignite ignite = Ignition.start();
>     jsc = new JavaSparkContext("local[2]", "testSparkWordCount");
>     jic = new JavaIgniteContext<>(jsc, new
> IgniteOutClosure<IgniteConfiguration>(){
>     @Override public IgniteConfiguration apply() {
>             return new IgniteConfiguration();
>         }
>     });
>
>     txtFile = new File("AIW_WordCount");
>     if(txtFile.exists()){
>         txtFile.delete();
>     }
>
> }
>
> @After
> public void tearDown() throws Exception {
>     if(jsc != null){
>         jsc.stop();
>         jsc = null;
>     }
>     if(jic != null){
>     jic = null;
>     }
>     Ignition.stopAll(true);
> }
>
> @Test
> public void testSparkInit() {
>     assertNotNull(jsc.sc());
> }
>
> @Test
> public void testIgniteInit(){
> assertNotNull(jic);
> }
>
> @Test
> public void testSparkWordCount() {
> SparkIgniteWordCount streamWords = new SparkIgniteWordCount();
>
> try {
> JavaRDD<String> textFile = jsc
> .textFile("alice-in-wonderland.txt");
> JavaPairRDD<String, Integer> wordCounts = streamWords
> .countWords(textFile);
>
> wordCounts.saveAsTextFile("AIW_WordCount");
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> assertTrue(true);
> }
>
> }
>
>
>    Thank you,
>    Jennifer
>
>


-- 
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com

Mime
View raw message