Class AbstractLoader

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractLoader()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void appendAtlanTags​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> assetMap, java.lang.String typeName)
      Retrieve a mapping of the assets that need to be retagged.
      protected java.lang.Object deserializeAssetRefFromCSV​(java.lang.String assetRef)
      Deserializes an asset reference (typeName@qualifiedName) from a CSV cell value.
      protected java.lang.Object deserializeCMValueFromCSV​(java.lang.String value)
      Deserialize a value intended for a custom metadata attribute.
      protected java.lang.Object deserializeEnumFromCSV​(java.lang.String enumValue, java.lang.Class<?> enumClass)
      Deserializes an enumerated value from a CSV cell value.
      protected java.lang.Object deserializeStructToCSV​(java.lang.String struct, java.lang.Class<?> structClass)
      Deserializes a struct value from a CSV cell value.
      protected java.lang.Object deserializeValueFromCSV​(java.lang.String value, java.lang.reflect.Method setter)
      Deserialize a value intended for a normal (non-custom metadata) attribute.
      int getBatchSize()  
      java.lang.String getBucket()  
      java.lang.String getDelimiter()  
      protected static java.util.List<java.lang.String> getEmbeddedList​(java.lang.String value, java.lang.String delimiter)
      Retrieve a list of embedded values from a single string, itself separated by the provided delimiter.
      java.lang.String getFilename()  
      software.amazon.awssdk.regions.Region getRegion()  
      boolean isUpdateOnly()  
      protected void parseParametersFromEvent​(java.util.Map<java.lang.String,​java.lang.String> event)
      Extract the configuration parameters to use from the lambda payload (or equivalent).
      void setFilename​(java.lang.String _filename)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractLoader

        public AbstractLoader()
    • Method Detail

      • parseParametersFromEvent

        protected void parseParametersFromEvent​(java.util.Map<java.lang.String,​java.lang.String> event)
        Extract the configuration parameters to use from the lambda payload (or equivalent).
        Parameters:
        event - configuration payload from the lambda function (or equivalent)
      • appendAtlanTags

        protected void appendAtlanTags​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> assetMap,
                                       java.lang.String typeName)
        Retrieve a mapping of the assets that need to be retagged. The method will first look up the provided assets to determine only the missing Atlan tags that need to be appended (rather than attempting to blindly append all Atlan tags).
        Parameters:
        assetMap - mapping of assets to consider, keyed by qualifiedName with the value a list of Atlan tag names to add the asset to
        typeName - of all the assets
      • getEmbeddedList

        protected static java.util.List<java.lang.String> getEmbeddedList​(java.lang.String value,
                                                                          java.lang.String delimiter)
        Retrieve a list of embedded values from a single string, itself separated by the provided delimiter.
        Parameters:
        value - to decompose into a collection of values
        delimiter - used to separate each item in the value
        Returns:
        a list of all values embedded in the provided value
      • deserializeCMValueFromCSV

        protected java.lang.Object deserializeCMValueFromCSV​(java.lang.String value)
        Deserialize a value intended for a custom metadata attribute. This should be as simple as determining whether the value is multi-valued or single-valued, and splitting it into multiple values if it is multi-valued.
        Parameters:
        value - from the CSV cell
        Returns:
        the deserialized value
      • deserializeValueFromCSV

        protected java.lang.Object deserializeValueFromCSV​(java.lang.String value,
                                                           java.lang.reflect.Method setter)
                                                    throws java.io.IOException
        Deserialize a value intended for a normal (non-custom metadata) attribute. This requires figuring out what kind of value we should expect for that given attribute, so uses reflection to reverse-engineer this.
        Parameters:
        value - from the CSV cell
        setter - method used to set the value for that attribute on an asset (from reflection)
        Returns:
        the deserialized value
        Throws:
        java.io.IOException - on any issues deserializing the value
      • deserializeAssetRefFromCSV

        protected java.lang.Object deserializeAssetRefFromCSV​(java.lang.String assetRef)
                                                       throws java.io.IOException
        Deserializes an asset reference (typeName@qualifiedName) from a CSV cell value.
        Parameters:
        assetRef - value of the CSV cell
        Returns:
        an asset reference by qualifiedName to that particular asset
        Throws:
        java.io.IOException - on any issues deserializing the value
      • deserializeStructToCSV

        protected java.lang.Object deserializeStructToCSV​(java.lang.String struct,
                                                          java.lang.Class<?> structClass)
                                                   throws java.io.IOException
        Deserializes a struct value from a CSV cell value. Note: not yet implemented!
        Parameters:
        struct - value of the CSV cell
        structClass - expected kind of struct
        Returns:
        a struct instance
        Throws:
        java.io.IOException - on any issues deserializing the value
      • deserializeEnumFromCSV

        protected java.lang.Object deserializeEnumFromCSV​(java.lang.String enumValue,
                                                          java.lang.Class<?> enumClass)
                                                   throws java.io.IOException
        Deserializes an enumerated value from a CSV cell value.
        Parameters:
        enumValue - value of the CSV cell
        enumClass - expected kind of enum
        Returns:
        an enum value instance
        Throws:
        java.io.IOException - on any issues deserializing the value
      • setFilename

        public void setFilename​(java.lang.String _filename)
      • getFilename

        public java.lang.String getFilename()
      • getBucket

        public java.lang.String getBucket()
      • getRegion

        public software.amazon.awssdk.regions.Region getRegion()
      • getBatchSize

        public int getBatchSize()
      • getDelimiter

        public java.lang.String getDelimiter()
      • isUpdateOnly

        public boolean isUpdateOnly()