Class 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 bundle
      void process​(ResourceEntry re)
      Process the resource entry (usually called from within a thread-pool
      protected 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
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 COS
        maxBundleSize - max number of resources we want in a bundle
        targetPrefix - target location (COS key prefix)
    • Method Detail

      • 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 bundle
        bundleNumber - 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 -