Skip to content

Commit

Permalink
Make LocatableCache and strategy classes serializable.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnbroad committed Feb 9, 2022
1 parent bcd93af commit 7bbb5d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.broadinstitute.hellbender.exceptions.GATKException;
import org.broadinstitute.hellbender.utils.SimpleInterval;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Deque;
import java.util.Iterator;
Expand All @@ -22,7 +23,9 @@
*
* @param <CACHED_FEATURE> type Feature being cached
*/
public class DrivingFeatureInputCacheStrategy<CACHED_FEATURE extends Feature> implements LocatableCacheStrategy<CACHED_FEATURE> {
public class DrivingFeatureInputCacheStrategy<CACHED_FEATURE extends Feature>
implements LocatableCacheStrategy<CACHED_FEATURE>, Serializable {
private static final long serialVersionUID = 1L;

/**
* When we trimCache our cache to a new start position, this is the maximum number of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.apache.logging.log4j.Logger;
import org.broadinstitute.hellbender.utils.Utils;

import java.io.Serializable;
import java.util.*;

/**
Expand All @@ -23,7 +24,8 @@
*
* @param <T> Type of Locatable record we are caching
*/
public class LocatableCache<T extends Locatable> {
public class LocatableCache<T extends Locatable> implements Serializable {
private static final long serialVersionUID = 1L;
private static final Logger logger = LogManager.getLogger(LocatableCache.class);

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package org.broadinstitute.hellbender.engine.cache;

import htsjdk.samtools.util.Locatable;
import org.broadinstitute.hellbender.utils.SimpleInterval;

import java.util.Deque;
import java.util.Iterator;
import java.util.List;

/**
* Interface for implemented by cache strategy objects for {@code LocatableCache}.
* Interface implemented by cache strategy objects for {@code LocatableCache}.
*
* {@code LocatableCacheStrategy} implementations determine the following policies for the cache:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.broadinstitute.hellbender.utils.SimpleInterval;
import org.broadinstitute.hellbender.utils.read.GATKRead;

import java.io.Serializable;
import java.util.*;
import java.util.function.Function;

Expand All @@ -23,7 +24,9 @@
*
* @param <CACHED_READ> Type of Locatable being cached.
*/
public class SideReadInputCacheStrategy<CACHED_READ extends GATKRead> implements LocatableCacheStrategy<CACHED_READ> {
public class SideReadInputCacheStrategy<CACHED_READ extends GATKRead>
implements LocatableCacheStrategy<CACHED_READ>, Serializable {
private static final long serialVersionUID = 1L;
private static final Logger logger = LogManager.getLogger(LocatableCache.class);
private static final int EXPECTED_MAX_OVERLAPPING_READS_DURING_CACHE_TRIM = 128;

Expand Down

0 comments on commit 7bbb5d4

Please sign in to comment.