Class AlterEnvironmentRequest

  • All Implemented Interfaces:
    org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

    public class AlterEnvironmentRequest
    extends Object
    implements org.apache.avro.generic.IndexedRecord
    A set of parameters for GPUdb.alterEnvironment.

    Alters an existing environment which can be referenced by a user-defined function (UDF).

    • Constructor Detail

      • AlterEnvironmentRequest

        public AlterEnvironmentRequest()
        Constructs an AlterEnvironmentRequest object with default parameters.
      • AlterEnvironmentRequest

        public AlterEnvironmentRequest​(String environmentName,
                                       String action,
                                       String value,
                                       Map<String,​String> options)
        Constructs an AlterEnvironmentRequest object with the specified parameters.
        Parameters:
        environmentName - Name of the environment to be altered.
        action - Modification operation to be applied. Supported values:
        • INSTALL_PACKAGE: Install a python package from PyPI, an external data source or KiFS
        • INSTALL_REQUIREMENTS: Install packages from a requirements file
        • UNINSTALL_PACKAGE: Uninstall a python package.
        • UNINSTALL_REQUIREMENTS: Uninstall packages from a requirements file
        • RESET: Uninstalls all packages in the environment and resets it to the original state at time of creation
        • REBUILD: Recreates the environment and re-installs all packages, upgrades the packages if necessary based on dependencies
        value - The value of the modification, depending on action. For example, if action is INSTALL_PACKAGE, this would be the python package name. If action is INSTALL_REQUIREMENTS, this would be the path of a requirements file from which to install packages. If an external data source is specified in DATASOURCE_NAME, this can be the path to a wheel file or source archive. Alternatively, if installing from a file (wheel or source archive), the value may be a reference to a file in KiFS.
        options - Optional parameters.
        • DATASOURCE_NAME: Name of an existing external data source from which packages specified in value can be loaded
        The default value is an empty Map.
    • Method Detail

      • getClassSchema

        public static org.apache.avro.Schema getClassSchema()
        This method supports the Avro framework and is not intended to be called directly by the user.
        Returns:
        The schema for the class.
      • getEnvironmentName

        public String getEnvironmentName()
        Name of the environment to be altered.
        Returns:
        The current value of environmentName.
      • setEnvironmentName

        public AlterEnvironmentRequest setEnvironmentName​(String environmentName)
        Name of the environment to be altered.
        Parameters:
        environmentName - The new value for environmentName.
        Returns:
        this to mimic the builder pattern.
      • getAction

        public String getAction()
        Modification operation to be applied. Supported values:
        • INSTALL_PACKAGE: Install a python package from PyPI, an external data source or KiFS
        • INSTALL_REQUIREMENTS: Install packages from a requirements file
        • UNINSTALL_PACKAGE: Uninstall a python package.
        • UNINSTALL_REQUIREMENTS: Uninstall packages from a requirements file
        • RESET: Uninstalls all packages in the environment and resets it to the original state at time of creation
        • REBUILD: Recreates the environment and re-installs all packages, upgrades the packages if necessary based on dependencies
        Returns:
        The current value of action.
      • setAction

        public AlterEnvironmentRequest setAction​(String action)
        Modification operation to be applied. Supported values:
        • INSTALL_PACKAGE: Install a python package from PyPI, an external data source or KiFS
        • INSTALL_REQUIREMENTS: Install packages from a requirements file
        • UNINSTALL_PACKAGE: Uninstall a python package.
        • UNINSTALL_REQUIREMENTS: Uninstall packages from a requirements file
        • RESET: Uninstalls all packages in the environment and resets it to the original state at time of creation
        • REBUILD: Recreates the environment and re-installs all packages, upgrades the packages if necessary based on dependencies
        Parameters:
        action - The new value for action.
        Returns:
        this to mimic the builder pattern.
      • getValue

        public String getValue()
        The value of the modification, depending on action. For example, if action is INSTALL_PACKAGE, this would be the python package name.

        If action is INSTALL_REQUIREMENTS, this would be the path of a requirements file from which to install packages.

        If an external data source is specified in DATASOURCE_NAME, this can be the path to a wheel file or source archive. Alternatively, if installing from a file (wheel or source archive), the value may be a reference to a file in KiFS.

        Returns:
        The current value of value.
      • setValue

        public AlterEnvironmentRequest setValue​(String value)
        The value of the modification, depending on action. For example, if action is INSTALL_PACKAGE, this would be the python package name.

        If action is INSTALL_REQUIREMENTS, this would be the path of a requirements file from which to install packages.

        If an external data source is specified in DATASOURCE_NAME, this can be the path to a wheel file or source archive. Alternatively, if installing from a file (wheel or source archive), the value may be a reference to a file in KiFS.

        Parameters:
        value - The new value for value.
        Returns:
        this to mimic the builder pattern.
      • getOptions

        public Map<String,​String> getOptions()
        Optional parameters.
        • DATASOURCE_NAME: Name of an existing external data source from which packages specified in value can be loaded
        The default value is an empty Map.
        Returns:
        The current value of options.
      • setOptions

        public AlterEnvironmentRequest setOptions​(Map<String,​String> options)
        Optional parameters.
        • DATASOURCE_NAME: Name of an existing external data source from which packages specified in value can be loaded
        The default value is an empty Map.
        Parameters:
        options - The new value for options.
        Returns:
        this to mimic the builder pattern.
      • getSchema

        public org.apache.avro.Schema getSchema()
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        getSchema in interface org.apache.avro.generic.GenericContainer
        Returns:
        The schema object describing this class.
      • get

        public Object get​(int index)
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        get in interface org.apache.avro.generic.IndexedRecord
        Parameters:
        index - the position of the field to get
        Returns:
        value of the field with the given index.
        Throws:
        IndexOutOfBoundsException
      • put

        public void put​(int index,
                        Object value)
        This method supports the Avro framework and is not intended to be called directly by the user.
        Specified by:
        put in interface org.apache.avro.generic.IndexedRecord
        Parameters:
        index - the position of the field to set
        value - the value to set
        Throws:
        IndexOutOfBoundsException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object