Packages

class ScriptGen extends StrictLogging

Linear Supertypes
StrictLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ScriptGen
  2. StrictLogging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScriptGen(storageHandler: StorageHandler, schemaHandler: SchemaHandler, launchHandler: LaunchHandler)(implicit settings: Settings)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. val engine: TemplateEngine
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def generateDomain(domain: Domain, scriptTemplateFile: File, scriptsOutputPath: File, scriptOutputPattern: Option[String], defaultDeltaColumn: Option[String], deltaColumns: Map[String, String]): List[File]

    Generate all extraction scripts based on the given domain

    Generate all extraction scripts based on the given domain

    domain

    The domain extracted from the Excel referential file

    scriptTemplateFile

    The script template

    scriptsOutputPath

    Where the scripts are produced

    defaultDeltaColumn

    Defaut delta column

    deltaColumns

    Mapping table name -> delta column, has precedence over defaultDeltaColumn

    returns

    The list of produced files

  11. def generateJob(job: AutoJobDesc, scriptTemplateFile: File, scriptsOutputFolder: File, scriptOutputPattern: Option[String]): File

    Generate all extraction scripts based on the given domain

    Generate all extraction scripts based on the given domain

    job

    The job extracted from the yml file

    scriptTemplateFile

    The script template

    returns

    The list of produced files

  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. val logger: Logger
    Attributes
    protected
    Definition Classes
    StrictLogging
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. def run(config: ExtractScriptGenConfig)(implicit settings: Settings): Boolean
  20. def run(args: Array[String]): Boolean

    Fills a Mustache templated file based on a given domain.

    Fills a Mustache templated file based on a given domain. The following documentation considers that we use the script to generate SQL export files.

    The schemas should at least, specify :

    • a table name (schemas.name)
    • a file pattern (schemas.pattern) which is used as the export file base name
    • a write mode (schemas.metadata.write): APPEND or OVERWRITE
    • the columns to extract (schemas.attributes.name*)

    You also have to provide a Mustache (http://mustache.github.io/mustache.5.html) template file.

    Here you'll write your extraction export process (sqlplus for Oracle, pgsql for PostgreSQL as an example). In that template you can use the following parameters:

    table_name -> the table to export delimiter -> the resulting dsv file delimiter columns -> the columns to export columns is a Mustache map, it gives you access, for each column, to:

    • name -> the column name
    • trailing_col_char -> the separator to append to the column (, if there are more columns to come, "" otherwise) Here is an example how to use it in a template: SELECT {{#columns}} TO_CHAR({{name}}){{trailing_col_char}} {{/columns}} FROM {{table_name}}; export_file -> the export file name delta_column -> a delta date column (passed as a Main arg or as a config element), the column which is used to determine new rows for each exports in APPEND mode full_export -> if the export is a full or delta export (the logic is to be implemented in your script)

    Usage: comet [script-gen] [options]

    Command: script-gen --domain <value> The domain for which to generate extract scripts --templateFile <value> Script template file --scriptsOutputDir <value> Scripts output folder --deltaColumn <value> The date column which is used to determine new rows for each exports (can be passed table by table as config element)

  21. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  22. def templatize(template: File, templateParams: TemplateParams): String

    Generate an extraction script payload based on a template and its params

    Generate an extraction script payload based on a template and its params

    template

    The extraction script template

    templateParams

    Its params

    returns

    The produced script payload

  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from StrictLogging

Inherited from AnyRef

Inherited from Any

Ungrouped