Skip navigation links
com.toolsverse.etl.core.engine

Interface CodeGen

    • Method Detail

      • assembleCode

        void assembleCode(EtlConfig config,
                          Scenario scenario,
                          Driver driver,
                          int loadIndex,
                          boolean silent)
                   throws Exception
        Assembles prepared code. The idea is the following: prepare(...) is called for each destination. The resulting code saved internally. assembleCode(...) assembles final code by concatenating code for all destinations with added declarations, etc so it can be be executed in the designated database. Also it splits code on chunks if necessary. For example Oracle limits size of the PL\SQL block to approximately 3000 lines.
        Parameters:
        config - The config
        scenario - The scenario
        driver - The driver
        loadIndex - If equals to 0 this chunk will be executed first.
        silent - If true logging is disabled for everything but exceptions
        Throws:
        Exception - in case of any error
      • cleanUp

        void cleanUp(EtlConfig config,
                     Scenario scenario,
                     Driver driver,
                     Connection conn)
              throws Exception
        Clean up after last block of code is executed.
        Parameters:
        config - the config
        scenario - the scenario
        driver - the driver
        conn - the connection
        Throws:
        Exception - the exception in case of any error
      • cleanUpOnException

        void cleanUpOnException(EtlConfig config,
                                Scenario scenario,
                                Driver driver,
                                Connection cleanUpConn)
                         throws Exception
        Clean up database objects on exception.
        Parameters:
        config - the config
        scenario - the scenario
        driver - the driver
        cleanUpConn - the clean up connection
        Throws:
        Exception - the exception
      • copy

        void copy(CodeGen codeGen)
        Copy parameters from other code generator.
        Parameters:
        codeGen - the code generator
      • execute

        void execute(EtlConfig config,
                     Scenario scenario,
                     Driver driver,
                     boolean silent,
                     Connection conn,
                     Connection cleanUpConn,
                     Destination destination)
              throws Exception
        Executes code. Code for each destination should be already prepared and stored internally.
        Parameters:
        config - The etl config
        scenario - The scenario
        driver - The driver
        silent - If true logging is disabled for everything but exceptions
        conn - The JDBC connection
        cleanUpConn - the clean up connection
        destination - the destination
        Throws:
        Exception - in case of any error
      • getScriptsToCleanOnException

        List<String> getScriptsToCleanOnException()
        Gets the list of scripts which should be executed to clean up database object on exception.
        Returns:
        the list of scripts to clean up on exception
      • getStatus

        int getStatus()
        Gets the status of the code generator.
        Returns:
        the status
      • getUnit

        EtlUnit getUnit()
        Gets the current unit.
        Returns:
        the unit
        See Also:
        EtlUnit
      • prepare

        void prepare(EtlConfig config,
                     Scenario scenario,
                     Destination destination,
                     boolean silent,
                     boolean onlyInit)
              throws Exception
        Prepares code for the destination using given config and scenario.
        Parameters:
        config - The etl config
        scenario - The scenario
        destination - The destination
        silent - If true logging is disabled for everything but exceptions
        onlyInit - the only init
        Throws:
        Exception - in case of any error
      • reset

        void reset()
        Resets the status.
      • runRemainingBatch

        void runRemainingBatch(EtlConfig config,
                               Scenario scenario,
                               Connection conn,
                               Destination destination)
                        throws Exception
        Run remaining batch statements.
        Parameters:
        config - the ETL config
        scenario - the scenario
        conn - the connection
        destination - the destination
        Throws:
        Exception - in case of any error
      • setUnit

        void setUnit(EtlUnit unit)
        Sets the current unit.
        Parameters:
        unit - the new unit
        See Also:
        EtlUnit

Copyright © 2010-2017 Toolsverse. All Rights Reserved.