Skip to content

Commit

Permalink
Delete dead code now that Hapi has merged.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelabuckley committed Apr 28, 2023
1 parent 81854ba commit 88dff2e
Showing 1 changed file with 1 addition and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
import ca.uhn.fhir.batch2.model.JobDefinition;
import ca.uhn.fhir.batch2.model.JobInstance;
import ca.uhn.fhir.batch2.model.StatusEnum;
import ca.uhn.fhir.batch2.model.WorkChunk;
import ca.uhn.fhir.batch2.model.WorkChunkCreateEvent;
import ca.uhn.fhir.batch2.models.JobInstanceFetchRequest;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -38,11 +36,9 @@
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;

/**
*
Expand All @@ -55,7 +51,6 @@
public interface IJobPersistence extends IWorkChunkPersistence {
Logger ourLog = LoggerFactory.getLogger(IJobPersistence.class);


/**
* Store a new job instance. This will be called when a new job instance is being kicked off.
*
Expand Down Expand Up @@ -113,46 +108,6 @@ public interface IJobPersistence extends IWorkChunkPersistence {
// on implementations @Transactional(propagation = Propagation.REQUIRES_NEW)
boolean canAdvanceInstanceToNextStep(String theInstanceId, String theCurrentStepId);

/**
* Fetches all chunks for a given instance, without loading the data
*
* TODO MB this seems to only be used by tests. Can we use the iterator instead?
* @param theInstanceId The instance ID
* @param thePageSize The page size
* @param thePageIndex The page index
*/
default List<WorkChunk> fetchWorkChunksWithoutData(String theInstanceId, int thePageSize, int thePageIndex) {
// for back-compat
// wipmb delete after merge.
Validate.isTrue(false, "Dead path");
return null;
}

/**
* Fetch all chunks for a given instance.
* @param theInstanceId - instance id
* @param theWithData - whether or not to include the data
* @return - an iterator for fetching work chunks
*/
default Iterator<WorkChunk> fetchAllWorkChunksIterator(String theInstanceId, boolean theWithData) {
// for back-compat
// wipmb delete after merge.
Validate.isTrue(false, "Dead path");
return null;
}

/**
* Fetch all chunks with data for a given instance for a given step id - read-only.
*
* @return - a stream for fetching work chunks
*/
default Stream<WorkChunk> fetchAllWorkChunksForStepStream(String theInstanceId, String theStepId) {
// for back-compat
// wipmb delete after merge.
Validate.isTrue(false, "Dead path");
return null;
}

/**
* Callback to update a JobInstance within a locked transaction.
* Return true from the callback if the record write should continue, or false if
Expand Down Expand Up @@ -198,27 +153,6 @@ interface JobInstanceUpdateCallback {
// on implementations @Transactional(propagation = Propagation.REQUIRES_NEW)
void deleteChunksAndMarkInstanceAsChunksPurged(String theInstanceId);

/**
* Marks an instance as being complete
*
* @param theInstanceId The instance ID
* @return true if the instance status changed
*/
default boolean markInstanceAsCompleted(String theInstanceId) {
// for back-compat
// wipmb delete after merge.
Validate.isTrue(false, "Dead path");
return false;
}

default boolean markInstanceAsStatus(String theInstance, StatusEnum theStatusEnum) {
// wipmb delete after merge.
// for back-compat
Validate.isTrue(false, "Dead path");
return false;
}


@Transactional(propagation = Propagation.MANDATORY)
boolean markInstanceAsStatusWhenStatusIn(String theInstance, StatusEnum theStatusEnum, Set<StatusEnum> thePriorStates);

Expand Down Expand Up @@ -261,8 +195,7 @@ public String toString() {
}

/**
* Create the job, and it's first chunk.
*
* Create the job, and its first chunk.
* We create the chunk atomically with the job so that we never have a state with
* zero unfinished chunks left until the job is complete. Makes the maintenance run simpler.
*
Expand Down

0 comments on commit 88dff2e

Please sign in to comment.