From 88dff2e77959b3e28e27523e46b9fea82cf29e7f Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Fri, 28 Apr 2023 15:55:05 -0400 Subject: [PATCH] Delete dead code now that Hapi has merged. --- .../uhn/fhir/batch2/api/IJobPersistence.java | 69 +------------------ 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java index 88dfce405a3a..fc621b4d8831 100644 --- a/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java +++ b/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/api/IJobPersistence.java @@ -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; @@ -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; /** * @@ -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. * @@ -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 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 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 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 @@ -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 thePriorStates); @@ -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. *