Search in sources :

Example 6 with SparkConf

use of org.apache.spark.SparkConf in project deeplearning4j by deeplearning4j.

the class BaseSparkTest method getContext.

/**
     *
     * @return
     */
public JavaSparkContext getContext() {
    if (sc != null)
        return sc;
    // set to test mode
    SparkConf sparkConf = new SparkConf().setMaster("local[" + numExecutors() + "]").setAppName("sparktest");
    sc = new JavaSparkContext(sparkConf);
    return sc;
}
Also used : JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) SparkConf(org.apache.spark.SparkConf)

Example 7 with SparkConf

use of org.apache.spark.SparkConf in project deeplearning4j by deeplearning4j.

the class TestKryoWarning method testKryoMessageMLNCorrectConfigKryo.

@Test
@Ignore
public void testKryoMessageMLNCorrectConfigKryo() {
    //Should NOT print warning message
    SparkConf sparkConf = new SparkConf().setMaster("local[*]").setAppName("sparktest").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer").set("spark.kryo.registrator", "org.nd4j.Nd4jRegistrator");
    doTestMLN(sparkConf);
}
Also used : SparkConf(org.apache.spark.SparkConf) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 8 with SparkConf

use of org.apache.spark.SparkConf in project deeplearning4j by deeplearning4j.

the class TestKryoWarning method testKryoMessageMLNCorrectConfigNoKryo.

@Test
@Ignore
public void testKryoMessageMLNCorrectConfigNoKryo() {
    //Should NOT print warning message
    SparkConf sparkConf = new SparkConf().setMaster("local[*]").setAppName("sparktest");
    doTestMLN(sparkConf);
}
Also used : SparkConf(org.apache.spark.SparkConf) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 9 with SparkConf

use of org.apache.spark.SparkConf in project deeplearning4j by deeplearning4j.

the class TestKryoWarning method testKryoMessageCGIncorrectConfig.

@Test
@Ignore
public void testKryoMessageCGIncorrectConfig() {
    //Should print warning message
    SparkConf sparkConf = new SparkConf().setMaster("local[*]").setAppName("sparktest").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer");
    doTestCG(sparkConf);
}
Also used : SparkConf(org.apache.spark.SparkConf) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 10 with SparkConf

use of org.apache.spark.SparkConf in project deeplearning4j by deeplearning4j.

the class TestKryoWarning method testKryoMessageCGCorrectConfigKryo.

@Test
@Ignore
public void testKryoMessageCGCorrectConfigKryo() {
    //Should NOT print warning message
    SparkConf sparkConf = new SparkConf().setMaster("local[*]").setAppName("sparktest").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer").set("spark.kryo.registrator", "org.nd4j.Nd4jRegistrator");
    doTestCG(sparkConf);
}
Also used : SparkConf(org.apache.spark.SparkConf) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

SparkConf (org.apache.spark.SparkConf)83 JavaSparkContext (org.apache.spark.api.java.JavaSparkContext)46 Test (org.junit.Test)21 ArrayList (java.util.ArrayList)20 Configuration (org.apache.hadoop.conf.Configuration)20 Tuple2 (scala.Tuple2)15 Graph (uk.gov.gchq.gaffer.graph.Graph)13 DataOutputStream (java.io.DataOutputStream)11 File (java.io.File)10 HashSet (java.util.HashSet)10 ByteArrayOutputStream (org.apache.commons.io.output.ByteArrayOutputStream)10 Edge (uk.gov.gchq.gaffer.data.element.Edge)10 Element (uk.gov.gchq.gaffer.data.element.Element)10 Entity (uk.gov.gchq.gaffer.data.element.Entity)10 User (uk.gov.gchq.gaffer.user.User)10 Ignore (org.junit.Ignore)6 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)5 JavaHBaseContext (org.apache.hadoop.hbase.spark.JavaHBaseContext)5 Test (org.testng.annotations.Test)5 AddElements (uk.gov.gchq.gaffer.operation.impl.add.AddElements)5