diff --git a/java/src/org/broadinstitute/sting/gatk/executive/LinearMicroScheduler.java b/java/src/org/broadinstitute/sting/gatk/executive/LinearMicroScheduler.java index 8744221af..0be399f48 100644 --- a/java/src/org/broadinstitute/sting/gatk/executive/LinearMicroScheduler.java +++ b/java/src/org/broadinstitute/sting/gatk/executive/LinearMicroScheduler.java @@ -55,7 +55,7 @@ public class LinearMicroScheduler extends MicroScheduler { SAMDataSource dataSource = getReadsDataSource(); walker.initialize(); - Object accumulator = ((LocusWalker) walker).reduceInit(); + Object accumulator = walker.reduceInit(); for (Shard shard : shardStrategy) { diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java index 42fee73df..2c186534b 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/LocusWalker.java @@ -28,8 +28,4 @@ public abstract class LocusWalker extends Walker extends Walker { public void initialize() { } + /** + * Provide an initial value for reduce computations. + * @return Initial value of reduce. + */ + public abstract ReduceType reduceInit(); + + /** + * Reduces a single map with the accumulator provided as the ReduceType. + * @param value result of the map. + * @param sum accumulator for the reduce. + * @return accumulator with result of the map taken into account. + */ + public abstract ReduceType reduce(MapType value, ReduceType sum); + public void onTraversalDone(ReduceType result) { out.println("[REDUCE RESULT] Traversal result is: " + result); }