---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: gora
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: gora
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: gora
        spec:
          containers:
          - image: funktion/connector-gora:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: gora
      syntax: gora:name
      title: Gora
      description: The gora component allows you to work with NoSQL databases using the Apache Gora framework.
      label: database,hadoop,nosql
      deprecated: false
      async: false
      javaType: org.apache.camel.component.gora.GoraComponent
      groupId: org.apache.camel
      artifactId: camel-gora
      version: 2.18.3
    componentProperties: {}
    properties:
      name:
        kind: path
        group: common
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Instance name
        order: 0
      dataStoreClass:
        kind: parameter
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The type of the dataStore
        order: 1
      keyClass:
        kind: parameter
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The type class of the key
        order: 2
      valueClass:
        kind: parameter
        group: common
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The type of the value
        order: 3
      bridgeErrorHandler:
        kind: parameter
        group: consumer
        label: consumer
        type: boolean
        javaType: boolean
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        defaultValue: false
        description: Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 4
      concurrentConsumers:
        kind: parameter
        group: consumer
        label: consumer
        type: integer
        javaType: int
        deprecated: false
        secret: false
        defaultValue: "1"
        description: Number of concurrent consumers
        order: 5
      endKey:
        kind: parameter
        group: consumer
        label: consumer
        type: object
        javaType: java.lang.Object
        deprecated: false
        secret: false
        description: The End Key
        order: 6
      endTime:
        kind: parameter
        group: consumer
        label: consumer
        type: integer
        javaType: long
        deprecated: false
        secret: false
        description: The End Time
        order: 7
      fields:
        kind: parameter
        group: consumer
        label: consumer
        type: object
        javaType: com.google.common.base.Strings
        deprecated: false
        secret: false
        description: The Fields
        order: 8
      keyRangeFrom:
        kind: parameter
        group: consumer
        label: consumer
        type: object
        javaType: java.lang.Object
        deprecated: false
        secret: false
        description: The Key Range From
        order: 9
      keyRangeTo:
        kind: parameter
        group: consumer
        label: consumer
        type: object
        javaType: java.lang.Object
        deprecated: false
        secret: false
        description: The Key Range To
        order: 10
      limit:
        kind: parameter
        group: consumer
        label: consumer
        type: integer
        javaType: long
        deprecated: false
        secret: false
        description: The Limit
        order: 11
      startKey:
        kind: parameter
        group: consumer
        label: consumer
        type: object
        javaType: java.lang.Object
        deprecated: false
        secret: false
        description: The Start Key
        order: 12
      startTime:
        kind: parameter
        group: consumer
        label: consumer
        type: integer
        javaType: long
        deprecated: false
        secret: false
        description: The Start Time
        order: 13
      timeRangeFrom:
        kind: parameter
        group: consumer
        label: consumer
        type: integer
        javaType: long
        deprecated: false
        secret: false
        description: The Time Range From
        order: 14
      timeRangeTo:
        kind: parameter
        group: consumer
        label: consumer
        type: integer
        javaType: long
        deprecated: false
        secret: false
        description: The Time Range To
        order: 15
      timestamp:
        kind: parameter
        group: consumer
        label: consumer
        type: integer
        javaType: long
        deprecated: false
        secret: false
        description: The Timestamp
        order: 16
      exceptionHandler:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: object
        javaType: org.apache.camel.spi.ExceptionHandler
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        description: To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 17
      exchangePattern:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: string
        javaType: org.apache.camel.ExchangePattern
        enum:
        - InOnly
        - RobustInOnly
        - InOut
        - InOptionalOut
        - OutOnly
        - RobustOutOnly
        - OutIn
        - OutOptionalIn
        deprecated: false
        secret: false
        description: Sets the exchange pattern when the consumer creates an exchange.
        order: 18
      flushOnEveryOperation:
        kind: parameter
        group: producer
        label: producer
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: true
        description: Flush on every operation
        order: 19
      hadoopConfiguration:
        kind: parameter
        group: advanced
        label: advanced
        type: object
        javaType: org.apache.hadoop.conf.Configuration
        deprecated: false
        secret: false
        description: Hadoop Configuration
        order: 20
      synchronous:
        kind: parameter
        group: advanced
        label: advanced
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
        order: 21
  documentation.adoc: |
    [[Gora-GoraComponent]]
    Gora Component
    ~~~~~~~~~~~~~~

    *Camel-Gora* is an http://camel.apache.org/[Apache Camel] component that
    allows you to work with NoSQL databases using the
    http://gora.apache.org/[Apache Gora] framework.

    *Available as of Camel 2.14*

    Maven users will need to add the following dependency to their pom.xml
    for this component:

    [source,xml]
    ---------------------------------------------------------
    <dependency>
     <groupId>org.apache.camel</groupId>
     <artifactId>camel-gora</artifactId>
     <version>x.x.x</version>
     <!-- use the same version as your Camel core version -->
    </dependency>
    ---------------------------------------------------------

    [[Gora-ApacheGoraOverview]]
    Apache Gora Overview
    ~~~~~~~~~~~~~~~~~~~~

    The http://gora.apache.org/[Apache Gora] open source framework provides
    an in-memory data model and persistence for big data. Gora supports
    persisting to column stores, key value stores, document stores and
    RDBMSs, and analyzing the data with extensive
    http://hadoop.apache.org/[Apache Hadoop™ MapReduce] support. Gora uses
    the http://www.apache.org/licenses/LICENSE-2.0.html[Apache Software
    License v2.0] and graduated from the Apache Incubator in Janauary 2012
    to become a top-level Apache project.

    Apache Gora currently supports the following datastores:
    http://hbase.apache.org/[Apache HBase],
    http://cassandra.apache.org/[Apache Cassandra],
    http://accumulo.apache.org/[Apache Accumulo],
    http://aws.amazon.com/dynamodb/[Amazon DynamoDB] and SQL databases such
    as http://hsqldb.org/[hsqldb], http://www.mysql.com/[MySQL] and more.

    [[Gora-URIformat]]
    URI format
    ~~~~~~~~~~

    [source,text]
    ---------------------------
    gora:instanceName[?options]
    ---------------------------

    Hbase examples with mandatory options :

    _XML_

    [source,xml]
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <to uri="gora:foobar?keyClass=java.lang.Long&amp;valueClass=org.apache.camel.component.gora.generated.Pageview&amp;dataStoreClass=org.apache.gora.hbase.store.HBaseStore"/>
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    _Java DSL_

    [source,java]
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    to("gora:foobar?keyClass=java.lang.Long&valueClass=org.apache.camel.component.gora.generated.Pageview&dataStoreClass=org.apache.gora.hbase.store.HBaseStore")
    -------------------------------------------------------------------------------------------------------------------------------------------------------------

    [[Gora-Configuratiion]]
    Configuratiion
    ~~~~~~~~~~~~~~

    Using camel-gora needs some configuration. This mainly involve to
    configure the _AvroStore_ through the _gora.properties_ file and to
    define the relevant mappings as part of the
    _http://gora.apache.org/current/gora-core.html[gora-core]_ module.

    Extensive information for this configuration can be found in the apache
    http://gora.apache.org/current/index.html[gora documentation] and the
    http://gora.apache.org/current/gora-conf.html[gora-conf] page.

    [[Gora-Options]]
    Options
    ~~~~~~~


    // component options: START
    The Gora component has no options.
    // component options: END





    // endpoint options: START
    The Gora component supports 22 endpoint options which are listed below:

    {% raw %}
    [width="100%",cols="2,1,1m,1m,5",options="header"]
    |=======================================================================
    | Name | Group | Default | Java Type | Description
    | name | common |  | String | *Required* Instance name
    | dataStoreClass | common |  | String | The type of the dataStore
    | keyClass | common |  | String | The type class of the key
    | valueClass | common |  | String | The type of the value
    | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | concurrentConsumers | consumer | 1 | int | Number of concurrent consumers
    | endKey | consumer |  | Object | The End Key
    | endTime | consumer |  | long | The End Time
    | fields | consumer |  | Strings | The Fields
    | keyRangeFrom | consumer |  | Object | The Key Range From
    | keyRangeTo | consumer |  | Object | The Key Range To
    | limit | consumer |  | long | The Limit
    | startKey | consumer |  | Object | The Start Key
    | startTime | consumer |  | long | The Start Time
    | timeRangeFrom | consumer |  | long | The Time Range From
    | timeRangeTo | consumer |  | long | The Time Range To
    | timestamp | consumer |  | long | The Timestamp
    | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
    | flushOnEveryOperation | producer | true | boolean | Flush on every operation
    | hadoopConfiguration | advanced |  | Configuration | Hadoop Configuration
    | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
    |=======================================================================
    {% endraw %}
    // endpoint options: END




    [[Gora-SupportedGoraOperations]]
    Supported Gora Operations
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    Supported operations include : *put*, *get*, *delete*, *getSchemaName*,
    *deleteSchema*, *createSchema*, *query*, *deleteByQuery*,
    *schemaExists*.

    Some of the operations require arguments while some others no. The
    arguments to operations could be either the _body_ of the _in_ message
    or defined in a header property. Below there is a list with some
    additional info for each operation.

    [width="100%",cols="10%,90%",options="header",]
    |=======================================================================
    |Property |Description

    |put |_Inserts the persistent object with the given key._

    |get |_Returns the object corresponding to the given key fetching all the
    fields._

    |delete |_Deletes the object with the given key._

    |getSchemaName |_Returns the schema name given to this DataStore._

    |deleteSchema |_Deletes the underlying schema or table (or similar) in the datastore
    that holds the objects._

    |createSchema |_Creates the optional schema or table (or similar) in the datastore to
    hold the objects._

    |query |_Executes the given query and returns the results._

    |deleteByQuery |_Deletes all the objects matching the query._

    |schemaExists |_Returns whether the schema that holds the data exists in the
    datastore._
    |=======================================================================

    [[Gora-GoraHeaders]]
    Gora Headers
    ^^^^^^^^^^^^

    [width="100%",cols="20%,80%",options="header",]
    |=======================================================================
    |Property |Description

    |GoraOperation |_Used in order to define the operation to execute._

    |GoraKey | _Used in order to define the datum key for the operations need it._
    |=======================================================================

    [[Gora-Usageexamples]]
    Usage examples
    ^^^^^^^^^^^^^^

    *Create Schema* _(XML DSL)_:

    [source,xml]
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <setHeader headerName="GoraOperation">
     <constant>CreateSchema</constant>
    </setHeader>
    <to uri="gora:foobar?keyClass=java.lang.Long&amp;valueClass=org.apache.camel.component.gora.generated.Pageview&amp;dataStoreClass=org.apache.gora.hbase.store.HBaseStore"/>
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    *SchemaExists* _(XML DSL)_:

    [source,xml]
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <setHeader headerName="GoraOperation">
     <constant>SchemaExists</constant>
    </setHeader>
     <to uri="gora:foobar?keyClass=java.lang.Long&amp;valueClass=org.apache.camel.component.gora.generated.Pageview&amp;dataStoreClass=org.apache.gora.hbase.store.HBaseStore"/>
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    *Put* _(XML DSL)_:

    [source,xml]
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <setHeader headerName="GoraOperation">
     <constant>put</constant>
    </setHeader>
    <setHeader headerName="GoraKey">
     <constant>22222</constant>
    </setHeader>
    <to uri="gora:foo?keyClass=java.lang.Long&amp;valueClass=org.apache.camel.component.gora.generated.Pageview&amp;dataStoreClass=org.apache.gora.hbase.store.HBaseStore"/>
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    *Get* _(XML DSL)_:

    [source,xml]
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <setHeader headerName="GoraOperation">
     <constant>GET</constant>
    </setHeader>
    <setHeader headerName="GoraKey">
     <constant>10101</constant>
    </setHeader>
    <to uri="gora:bar?keyClass=java.lang.Long&amp;valueClass=org.apache.camel.component.gora.generated.Pageview&amp;dataStoreClass=org.apache.gora.hbase.store.HBaseStore"/>
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    *Delete* _(XML DSL)_:

    [source,xml]
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <setHeader headerName="GoraOperation">
     <constant>DELETE</constant>
    </setHeader>
    <setHeader headerName="GoraKey">
     <constant>22222</constant>
    </setHeader>
    <to uri="gora:bar?keyClass=java.lang.Long&amp;valueClass=org.apache.camel.component.gora.generated.Pageview&amp;dataStoreClass=org.apache.gora.hbase.store.HBaseStore"/>
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    *Query* _(XML DSL)_:

    [source,xml]
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <to uri="gora:foobar?keyClass=java.lang.Long&amp;valueClass=org.apache.camel.component.gora.generated.Pageview&amp;dataStoreClass=org.apache.gora.hbase.store.HBaseStore"/>
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    The full usage examples in the form of integration tests can be found at
    https://github.com/ipolyzos/camel-gora-examples/[camel-gora-examples]
    repository.

    [[Gora-Moreresources]]
    More resources
    ^^^^^^^^^^^^^^

    For more please information and in depth configuration refer to the
    http://gora.apache.org/current/overview.html[Apache Gora Documentation]
    and the http://gora.apache.org/current/tutorial.html[Apache Gora
    Tutorial].
