Class

com.ebiznext.comet.extractor

ScriptGen

Related Doc: package extractor

Permalink

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)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val engine: TemplateEngine

    Permalink
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.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]

    Permalink

    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

    Permalink

    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[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def run(config: ExtractScriptGenConfig)(implicit settings: Settings): Boolean

    Permalink
  20. def run(args: Array[String]): Boolean

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  22. def templatize(template: File, templateParams: TemplateParams): String

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StrictLogging

Inherited from AnyRef

Inherited from Any

Ungrouped