use of org.apache.spark.SparkConf in project gatk by broadinstitute.
the class SparkContextFactoryUnitTest method testSetupSparkConf.
@Test(groups = "spark")
public void testSetupSparkConf() {
final String appName = "appName";
final String master = "master";
final SparkConf sparkConf = SparkContextFactory.setupSparkConf(appName, master, SUGGESTED, OVERRIDE);
Assert.assertEquals(sparkConf.get("spark.master"), master);
Assert.assertEquals(sparkConf.get("spark.app.name"), appName);
Assert.assertEquals(sparkConf.get(prop1), value1_override);
Assert.assertEquals(sparkConf.get(prop2), value2);
Assert.assertEquals(sparkConf.get(prop3), value3);
}
use of org.apache.spark.SparkConf in project gatk by broadinstitute.
the class SAMRecordSerializerUnitTest method testChangingContigsOnHeaderlessSAMRecord.
@Test
public void testChangingContigsOnHeaderlessSAMRecord() {
final SparkConf conf = new SparkConf().set("spark.kryo.registrator", "org.broadinstitute.hellbender.engine.spark.SAMRecordSerializerUnitTest$TestGATKRegistrator");
final SAMRecord read = ((SAMRecordToGATKReadAdapter) ArtificialReadUtils.createHeaderlessSamBackedRead("read1", "1", 100, 50)).getEncapsulatedSamRecord();
final SAMRecord roundTrippedRead = SparkTestUtils.roundTripInKryo(read, SAMRecord.class, conf);
Assert.assertEquals(roundTrippedRead, read, "\nActual read: " + roundTrippedRead.getSAMString() + "\nExpected read: " + read.getSAMString());
read.setReferenceName("2");
read.setAlignmentStart(1);
final SAMRecord roundTrippedRead2 = SparkTestUtils.roundTripInKryo(read, SAMRecord.class, conf);
Assert.assertEquals(roundTrippedRead2, read, "\nActual read: " + roundTrippedRead2.getSAMString() + "\nExpected read: " + read.getSAMString());
}
use of org.apache.spark.SparkConf in project gatk by broadinstitute.
the class SAMRecordSerializerUnitTest method testSerializerRoundTripHeaderlessSAMRecord.
@Test
public void testSerializerRoundTripHeaderlessSAMRecord() {
SparkConf conf = new SparkConf().set("spark.kryo.registrator", "org.broadinstitute.hellbender.engine.spark.SAMRecordSerializerUnitTest$TestGATKRegistrator");
// check round trip with no header
final SAMRecord read = ((SAMRecordToGATKReadAdapter) ArtificialReadUtils.createHeaderlessSamBackedRead("read1", "1", 100, 50)).getEncapsulatedSamRecord();
final SAMRecord roundTrippedRead = SparkTestUtils.roundTripInKryo(read, SAMRecord.class, conf);
Assert.assertEquals(roundTrippedRead, read, "\nActual read: " + roundTrippedRead.getSAMString() + "\nExpected read: " + read.getSAMString());
}
use of org.apache.spark.SparkConf in project gatk by broadinstitute.
the class SAMRecordToGATKReadAdapterSerializerUnitTest method testChangingContigsOnHeaderlessGATKRead.
@Test
public void testChangingContigsOnHeaderlessGATKRead() {
final SparkConf conf = new SparkConf().set("spark.kryo.registrator", "org.broadinstitute.hellbender.engine.spark.SAMRecordToGATKReadAdapterSerializerUnitTest$TestGATKRegistrator");
final GATKRead read = ArtificialReadUtils.createHeaderlessSamBackedRead("read1", "1", 100, 50);
final GATKRead roundTrippedRead = SparkTestUtils.roundTripInKryo(read, GATKRead.class, conf);
Assert.assertEquals(roundTrippedRead, read);
read.setPosition("2", 1);
final GATKRead roundTrippedRead2 = SparkTestUtils.roundTripInKryo(read, GATKRead.class, conf);
Assert.assertEquals(roundTrippedRead2, read);
}
use of org.apache.spark.SparkConf in project gatk by broadinstitute.
the class ReferenceMultiSourceUnitTest method testSerializeRoundTrip2Bit.
@Test
public void testSerializeRoundTrip2Bit() {
PipelineOptions options = null;
ReferenceMultiSource referenceMultiSource = new ReferenceMultiSource(options, twoBitRefURL, ReferenceWindowFunctions.IDENTITY_FUNCTION);
final ReferenceMultiSource roundTrippedReference = SparkTestUtils.roundTripInKryo(referenceMultiSource, ReferenceMultiSource.class, new SparkConf());
Assert.assertEquals(roundTrippedReference.getReferenceSequenceDictionary(null), referenceMultiSource.getReferenceSequenceDictionary(null), "\nActual ref: " + roundTrippedReference.getReferenceSequenceDictionary(null) + "\nExpected ref: " + referenceMultiSource.getReferenceSequenceDictionary(null));
Assert.assertNotNull(roundTrippedReference.getReferenceWindowFunction());
}
Aggregations