-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DISQ-29] Use a separate instance of VCFCodec for each partition #30
Changes from all commits
d8a8d0c
9a4eef8
8f6dfc1
a62a09f
d3370a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
import htsjdk.variant.variantcontext.writer.VariantContextWriter; | ||
import htsjdk.variant.variantcontext.writer.VariantContextWriterBuilder; | ||
import htsjdk.variant.vcf.VCFHeader; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import org.apache.hadoop.conf.Configuration; | ||
|
@@ -33,7 +34,7 @@ public VcfRecordWriter(Configuration conf, Path file, VCFHeader header, String e | |
boolean compressed = | ||
extension.endsWith(BGZFCodec.DEFAULT_EXTENSION) || extension.endsWith(".gz"); | ||
if (compressed) { | ||
out = new BlockCompressedOutputStream(out, null); | ||
out = new BlockCompressedOutputStream(out, (File) null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How much I miss in htsjdk a method to set the filename/source (as a |
||
} | ||
variantContextWriter = | ||
new VariantContextWriterBuilder().clearOptions().setOutputVCFStream(out).build(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ public abstract class BaseTest { | |
public static void setup() { | ||
SparkConf sparkConf = new SparkConf(); | ||
sparkConf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer"); | ||
jsc = new JavaSparkContext("local", "myapp", sparkConf); | ||
jsc = new JavaSparkContext("local[*]", "myapp", sparkConf); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be possible to have both kind of tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would need some more work. I think it's most useful to test with multiple cores as it's most likely to expose concurrency issues (as it did in this case). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But having consistency between both versions might be also beneficial, right? Maybe we can open an issue if someone wants to look at refactoring to test both... |
||
} | ||
|
||
@AfterClass | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate htsjdk.
Anyone object to making an assertion in this library that all method parameters should be nonnull by default?
https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained#using-and-avoiding-null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heuermh I'm not very familiar with the various nullness annotations. What does adding that do? Is it just a statement of principle or is enforced somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, a statement of principle, although there may be tools that use that annotation in static code analysis.
Throughout the guava library method parameters are checked via
Preconditions
to fail fast on nulls. Adding a dependency on guava comes with its own set of problems though.I'd be happy to simply say we're not going to design our API to accept nulls as method parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to not allowing nulls in the API. I'd rather not have a Guava dependency though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 also for non-null (I am trying the same in htsjdk-next). Maybe it is worth to check the Bean Validation project for constraints in the library (I am planning to propose this also in htsjdk-next).