Class BundleBreakerResourceProcessor
- java.lang.Object
-
- org.linuxforhealth.fhir.bucket.scanner.BundleBreakerResourceProcessor
-
- All Implemented Interfaces:
IResourceEntryProcessor
public class BundleBreakerResourceProcessor extends java.lang.Object implements IResourceEntryProcessor
Breaks a large Bundle into smaller Bundles, translating local references to external references to maintain the relationships between the resources when they are loaded into the FHIR server. This is experimental, and primarily used for analyzing the performance of different bundle sizes.
-
-
Constructor Summary
Constructors Constructor Description BundleBreakerResourceProcessor(COSClient cosClient, int maxBundleSize, java.lang.String targetBucket, java.lang.String targetPrefix)
Public constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
process(java.lang.String originalName, Bundle bundle)
Process the bundlevoid
process(ResourceEntry re)
Process the resource entry (usually called from within a thread-poolprotected void
saveBundle(java.lang.String originalName, Bundle newBundle, int bundleNumber)
Save the newly created bundle to COS.protected void
writeBundle(Bundle bundle, java.lang.String bundleName)
Write the given bundle to COS
-
-
-
Constructor Detail
-
BundleBreakerResourceProcessor
public BundleBreakerResourceProcessor(COSClient cosClient, int maxBundleSize, java.lang.String targetBucket, java.lang.String targetPrefix)
Public constructor- Parameters:
cosClient
- the client for writing new bundles to COSmaxBundleSize
- max number of resources we want in a bundletargetPrefix
- target location (COS key prefix)
-
-
Method Detail
-
process
public void process(ResourceEntry re)
Description copied from interface:IResourceEntryProcessor
Process the resource entry (usually called from within a thread-pool- Specified by:
process
in interfaceIResourceEntryProcessor
-
process
protected void process(java.lang.String originalName, Bundle bundle)
Process the bundle- Parameters:
bundle
-
-
saveBundle
protected void saveBundle(java.lang.String originalName, Bundle newBundle, int bundleNumber)
Save the newly created bundle to COS. If bundleNumber is negative, this means that the bundle is the entire bundle and so does not need to be saved with a postfixed name- Parameters:
newBundle
- the sub-Bundle generated from the larger bundlebundleNumber
- incrementing number for each sub-Bundle we generate
-
writeBundle
protected void writeBundle(Bundle bundle, java.lang.String bundleName)
Write the given bundle to COS- Parameters:
bundle
-bundleName
-
-
-