Skip to content

Commit

Permalink
Warn on unrecognized options (fixes #25) (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite authored Sep 9, 2019
1 parent 8cfd528 commit 8dd2362
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/disq_bio/disq/HtsjdkReadsRddStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
import org.disq_bio.disq.impl.file.NioFileSystemWrapper;
import org.disq_bio.disq.impl.formats.sam.AbstractSamSource;
import org.disq_bio.disq.impl.formats.sam.SamFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** The entry point for reading or writing a {@link HtsjdkReadsRdd}. */
public class HtsjdkReadsRddStorage {

private static final Logger logger = LoggerFactory.getLogger(HtsjdkReadsRddStorage.class);

private JavaSparkContext sparkContext;
private int splitSize;
private ValidationStringency validationStringency = ValidationStringency.DEFAULT_STRINGENCY;
Expand Down Expand Up @@ -199,6 +203,8 @@ public void write(HtsjdkReadsRdd htsjdkReadsRdd, String path, WriteOption... wri
indexesToEnable.add(CraiWriteOption.getIndexExtension());
} else if (writeOption instanceof SbiWriteOption && writeOption == SbiWriteOption.ENABLE) {
indexesToEnable.add(SbiWriteOption.getIndexExtension());
} else {
logger.warn("Unrecognized write option: {}", writeOption);
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/disq_bio/disq/HtsjdkVariantsRddStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@
import org.apache.spark.api.java.JavaSparkContext;
import org.disq_bio.disq.impl.formats.vcf.VcfFormat;
import org.disq_bio.disq.impl.formats.vcf.VcfSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** The entry point for reading or writing a {@link HtsjdkVariantsRdd}. */
public class HtsjdkVariantsRddStorage {

private static final Logger logger = LoggerFactory.getLogger(HtsjdkVariantsRddStorage.class);

private JavaSparkContext sparkContext;
private int splitSize;

Expand Down Expand Up @@ -122,6 +126,8 @@ public void write(HtsjdkVariantsRdd htsjdkVariantsRdd, String path, WriteOption.
} else if (writeOption instanceof TabixIndexWriteOption
&& writeOption == TabixIndexWriteOption.ENABLE) {
indexesToEnable.add(TabixIndexWriteOption.getIndexExtension());
} else {
logger.warn("Unrecognized write option: {}", writeOption);
}
}

Expand Down

0 comments on commit 8dd2362

Please sign in to comment.