Class LogicalIdRecorder
- java.lang.Object
-
- org.linuxforhealth.fhir.bucket.persistence.LogicalIdRecorder
-
public class LogicalIdRecorder extends java.lang.Object
Handles the recording of logical ids which can arrive from many threads. To avoid unnecessary synchronization, each thread gets its own batch which will be submitted to the database when it reaches a threshold or a timeout expires (so we don't have ids sitting around in memory for too long before that are persisted. For the purposes of this application, it isn't critical if we lose one or two ids now and then (program crash/forceful termination). TODO. A future option to avoid data loss but maintain performance would be to push the ids to Redis in a pub/sub model.
-
-
Constructor Summary
Constructors Constructor Description LogicalIdRecorder(DataAccess dataAccess)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
recordLogicalId(ResourceEntry entry, java.lang.String logicalId, int responseTimeMs)
Save the new logical id and map it to the bundle it came from
-
-
-
Constructor Detail
-
LogicalIdRecorder
public LogicalIdRecorder(DataAccess dataAccess)
Public constructor- Parameters:
dataAccess
-
-
-
Method Detail
-
recordLogicalId
public void recordLogicalId(ResourceEntry entry, java.lang.String logicalId, int responseTimeMs)
Save the new logical id and map it to the bundle it came from- Parameters:
job
-logicalId
-
-
-