Class BatchDateThresholdUpdater

java.lang.Object
ca.uhn.fhir.jpa.batch.reader.BatchDateThresholdUpdater

public class BatchDateThresholdUpdater extends Object
  • Constructor Details

  • Method Details

    • updateThresholdAndCache

      public Date updateThresholdAndCache(Date thePrevThreshold, Set<Long> theAlreadyProcessedPidsWithThresholdDate, List<Long> theProcessedPidsOrderedByDate)
      This method is used by batch jobs that process resource pids by date in multiple passes. It's used to ensure the same resource isn't processed twice. What it does is after a pass of processing pids, it sets the threshold date for the next pass from the last resource on the list and collects all of the resources that have that date into a temporary cache so that the caller can exclude those from the next pass.
      Parameters:
      thePrevThreshold - the date threshold from the previous pass
      theAlreadyProcessedPidsWithThresholdDate - the set to load pids into that have the new threshold
      theProcessedPidsOrderedByDate - the pids ordered by date (can be ascending or descending)
      Returns:
      the new date threshold (can be the same as the old threshold if all pids on the list share the same date)
    • setDateFromPid

      Parameters:
      theDateFromPid - this is a Function to extract a date from a resource id
      Returns: