#
# Copyright 2016 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of fiware-cygnus (FI-WARE project).
#
# fiware-cygnus is free software: you can redistribute it and/or modify it under the terms of the GNU Affero
# General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
# fiware-cygnus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
# for more details.
#
# You should have received a copy of the GNU Affero General Public License along with fiware-cygnus. If not, see
# http://www.gnu.org/licenses/.
#
# For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es
#

cygnus-ngsi.sources = http-source

cygnus-ngsi.sinks = ckan-sink postgresql-sink
cygnus-ngsi.channels =ckan-channel postgresql-channel

cygnus-ngsi.sources.http-source.type = org.apache.flume.source.http.HTTPSource
cygnus-ngsi.sources.http-source.channels = mysql-channel mongo-channel sth-channel ckan-channel hdfs-channel cartodb-channel postgresql-channel
cygnus-ngsi.sources.http-source.port = 5050
cygnus-ngsi.sources.http-source.handler = com.telefonica.iot.cygnus.handlers.NGSIRestHandler
cygnus-ngsi.sources.http-source.handler.notification_target = /notify
cygnus-ngsi.sources.http-source.handler.default_service = default
cygnus-ngsi.sources.http-source.handler.default_service_path = /
cygnus-ngsi.sources.http-source.interceptors = ts gi
cygnus-ngsi.sources.http-source.interceptors.ts.type = timestamp
cygnus-ngsi.sources.http-source.interceptors.gi.type = com.telefonica.iot.cygnus.interceptors.NGSIGroupingInterceptor$Builder
cygnus-ngsi.sources.http-source.interceptors.gi.grouping_rules_conf_file = /opt/apache-flume/conf/grouping_rules.conf

cygnus-ngsi.sinks.mysql-sink.type = com.telefonica.iot.cygnus.sinks.NGSIMySQLSink
cygnus-ngsi.sinks.mysql-sink.channel = mysql-channel
#cygnus-ngsi.sinks.mysql-sink.enable_encoding = false
#cygnus-ngsi.sinks.mysql-sink.enable_grouping = false
#cygnus-ngsi.sinks.mysql-sink.enable_name_mappings = false
#cygnus-ngsi.sinks.mysql-sink.enable_lowercase = false
#cygnus-ngsi.sinks.mysql-sink.data_model = dm-by-entity
cygnus-ngsi.sinks.mysql-sink.mysql_host = iot-mysql
cygnus-ngsi.sinks.mysql-sink.mysql_port = 3306
cygnus-ngsi.sinks.mysql-sink.mysql_username = 
cygnus-ngsi.sinks.mysql-sink.mysql_password =
#cygnus-ngsi.sinks.mysql-sink.attr_persistence = row
#cygnus-ngsi.sinks.mysql-sink.batch_size = 1
#cygnus-ngsi.sinks.mysql-sink.batch_timeout = 30
#cygnus-ngsi.sinks.mysql-sink.batch_ttl = 10

cygnus-ngsi.sinks.mongo-sink.type = com.telefonica.iot.cygnus.sinks.NGSIMongoSink
cygnus-ngsi.sinks.mongo-sink.channel = mongo-channel
#cygnus-ngsi.sinks.mongo-sink.enable_encoding = false
#cygnus-ngsi.sinks.mongo-sink.enable_grouping = false
#cygnus-ngsi.sinks.mongo-sink.enable_name_mappings = false
#cygnus-ngsi.sinks.mongo-sink.enable_lowercase = false
#cygnus-ngsi.sinks.mongo-sink.data_model = dm-by-entity
#cygnus-ngsi.sinks.mongo-sink.attr_persistence = row
cygnus-ngsi.sinks.mongo-sink.mongo_hosts = iot-mongo:27017
cygnus-ngsi.sinks.mongo-sink.mongo_username =
cygnus-ngsi.sinks.mongo-sink.mongo_password =
#cygnus-ngsi.sinks.mongo-sink.db_prefix = sth_
#cygnus-ngsi.sinks.mongo-sink.collection_prefix = sth_
#cygnus-ngsi.sinks.mongo-sink.batch_size = 1
#cygnus-ngsi.sinks.mongo-sink.batch_timeout = 30
#cygnus-ngsi.sinks.mongo-sink.batch_ttl = 10
#cygnus-ngsi.sinks.mongo-sink.data_expiration = 0
#cygnus-ngsi.sinks.mongo-sink.collections_size = 0
#cygnus-ngsi.sinks.mongo-sink.max_documents = 0
#cygnus-ngsi.sinks.mongo-sink.ignore_white_spaces = true

cygnus-ngsi.sinks.sth-sink.type = com.telefonica.iot.cygnus.sinks.NGSISTHSink
cygnus-ngsi.sinks.sth-sink.channel = sth-channel
#cygnus-ngsi.sinks.sth-sink.enable_encoding = false
#cygnus-ngsi.sinks.sth-sink.enable_grouping = false
#cygnus-ngsi.sinks.sth-sink.enable_name_mappings = false
#cygnus-ngsi.sinks.sth-sink.enable_lowercase = false
#cygnus-ngsi.sinks.sth-sink.data_model = dm-by-entity
cygnus-ngsi.sinks.sth-sink.mongo_hosts = iot-mongo:27017
cygnus-ngsi.sinks.sth-sink.mongo_username =
cygnus-ngsi.sinks.sth-sink.mongo_password =
#cygnus-ngsi.sinks.sth-sink.db_prefix = sth_
#cygnus-ngsi.sinks.sth-sink.collection_prefix = sth_
#cygnus-ngsi.sinks.sth-sink.resolutions = month,day,hour,minute,second
#cygnus-ngsi.sinks.sth-sink.batch_size = 1
#cygnus-ngsi.sinks.sth-sink.batch_timeout = 30
#cygnus-ngsi.sinks.sth-sink.batch_ttl = 10
#cygnus-ngsi.sinks.sth-sink.data_expiration = 0
#cygnus-ngsi.sinks.sth-sink.ignore_white_spaces = true

cygnus-ngsi.sinks.ckan-sink.type = com.telefonica.iot.cygnus.sinks.NGSICKANSink
cygnus-ngsi.sinks.ckan-sink.channel = ckan-channel
#cygnus-ngsi.sinks.ckan-sink.enable_encoding = false
#cygnus-ngsi.sinks.ckan-sink.enable_grouping = false
#cygnus-ngis.sinks.ckan-sink.enable_name_mappings = false
#cygnus-ngsi.sinks.ckan-sink.data_model = dm-by-entity
#cygnus-ngsi.sinks.ckan-sink.attr_persistence = row
cygnus-ngsi.sinks.ckan-sink.ckan_host = iot-ckan
cygnus-ngsi.sinks.ckan-sink.ckan_port = 80
cygnus-ngsi.sinks.ckan-sink.ssl = false
cygnus-ngsi.sinks.ckan-sink.api_key = 
#cygnus-ngsi.sinks.ckan-sink.orion_url = http://localhost:1026
#cygnus-ngsi.sinks.ckan-sink.batch_size = 1
#cygnus-ngsi.sinks.ckan-sink.batch_timeout = 30
#cygnus-ngsi.sinks.ckan-sink.batch_ttl = 10
#cygnus-ngsi.sinks.ckan-sink.backend.max_conns = 500
#cygnus-ngsi.sinks.ckan-sink.backend.max_conns_per_route = 100

cygnus-ngsi.sinks.hdfs-sink.type = com.telefonica.iot.cygnus.sinks.NGSIHDFSSink
cygnus-ngsi.sinks.hdfs-sink.channel = hdfs-channel
#cygnus-ngsi.sinks.hdfs-sink.enable_encoding = false
#cygnus-ngsi.sinks.hdfs-sink.enable_grouping = false
#cygnus-ngsi.sinks.hdfs-sink.enable_lowercase = false
#cygnus-ngsi.sinks.hdfs-sink.enable_name_mappings = false
#cygnus-ngsi.sinks.hdfs-sink.data_model = dm-by-entity
#cygnus-ngsi.sinks.hdfs-sink.file_format = json-column
#cygnus-ngsi.sinks.hdfs-sink.backend.impl = rest
#cygnus-ngsi.sinks.hdfs-sink.backend.max_conns = 500
#cygnus-ngsi.sinks.hdfs-sink.backend.max_conns_per_route = 100
cygnus-ngsi.sinks.hdfs-sink.hdfs_host = iot-hdfs
cygnus-ngsi.sinks.hdfs-sink.hdfs_port = 14000
cygnus-ngsi.sinks.hdfs-sink.hdfs_username = 
#cygnus-ngsi.sinks.hdfs-sink.hdfs_password = 
cygnus-ngsi.sinks.hdfs-sink.oauth2_token = 
#cygnus-ngsi.sinks.hdfs-sink.service_as_namespace = false
#cygnus-ngsi.sinks.hdfs-sink.batch_size = 100
#cygnus-ngsi.sinks.hdfs-sink.batch_timeout = 30
#cygnus-ngsi.sinks.hdfs-sink.batch_ttl = 10
#cygnus-ngsi.sinks.hdfs-sink.batch_retry_intervals = 5000
#cygnus-ngsi.sinks.hdfs-sink.hive = false
#cygnus-ngsi.sinks.hdfs-sink.krb5_auth = false

cygnus-ngsi.sinks.cartodb-sink.type = com.telefonica.iot.cygnus.sinks.NGSICartoDBSink
cygnus-ngsi.sinks.cartodb-sink.channel = cartodb-channel
#cygnus-ngsi.sinks.cartodb-sink.enable_grouping = false
#cygnus-ngsi.sinks.cartodb-sink.enable_name_mappings = false
#cygnus-ngsi.sinks.cartodb-sink.enable_lowercase = false
#cygnus-ngsi.sinks.cartodb-sink.data_model = dm-by-entity
cygnus-ngsi.sinks.cartodb-sink.keys_conf_file = /opt/apache-flume/conf/cartodb_keys.conf
#cygnus-ngsi.sinks.cartodb-sink.flip_coordinates = false
#cygnus-ngsi.sinks.cartodb-sink.enable_raw = false
#cygnus-ngsi.sinks.cartodb-sink.enable_distance = false
#cygnus-ngsi.sinks.cartodb-sink.batch_size = 1
#cygnus-ngsi.sinks.cartodb-sink.batch_timeout = 30
#cygnus-ngsi.sinks.cartodb-sink.batch_ttl = 10
#cygnus-ngsi.sinks.cartodb-sink.batch_retry_intervals = 5000
#cygnus-ngsi.sinks.cartodb-sink.backend.max_conns = 500
#cygnus-ngsi.sinks.cartodb-sink.backend.max_conns_per_route = 100


# NGSIPostgreSQLSink configuration
cygnus-ngsi.sinks.postgresql-sink.type = com.telefonica.iot.cygnus.sinks.NGSIPostgreSQLSink
cygnus-ngsi.sinks.postgresql-sink.channel = postgresql-channel
#cygnus-ngsi.sinks.postgresql-sink.enable_encoding = false
#cygnus-ngsi.sinks.postgresql-sink.enable_name_mappings = false
#cygnus-ngsi.sinks.postgresql-sink.enable_grouping = false
#cygnus-ngsi.sinks.postgresql-sink.enable_lowercase = false
cygnus-ngsi.sinks.postgresql-sink.postgresql_host = iot-postgresql
cygnus-ngsi.sinks.postgresql-sink.postgresql_port = 5432
cygnus-ngsi.sinks.postgresql-sink.postgresql_username =
cygnus-ngsi.sinks.postgresql-sink.postgresql_password =
#cygnus-ngsi.sinks.postgresql-sink.attr_persistence = row
#cygnus-ngsi.sinks.postgresql-sink.batch_size = 1
#cygnus-ngsi.sinks.postgresql-sink.batch_timeout = 30
#cygnus-ngsi.sinks.postgresql-sink.batch_ttl = 10
#cygnus-ngsi.sinks.postgresql-sink.backend.enable_cache = false


cygnus-ngsi.channels.mysql-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.mysql-channel.capacity = 1000
cygnus-ngsi.channels.mysql-channel.transactionCapacity = 100

cygnus-ngsi.channels.postgresql-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.postgresql-channel.capacity = 1000
cygnus-ngsi.channels.postgresql-channel.transactionCapacity = 100


cygnus-ngsi.channels.mongo-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.mongo-channel.capacity = 1000
cygnus-ngsi.channels.mongo-channel.transactionCapacity = 100

cygnus-ngsi.channels.sth-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.sth-channel.capacity = 1000
cygnus-ngsi.channels.sth-channel.transactionCapacity = 100

cygnus-ngsi.channels.ckan-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.ckan-channel.capacity = 1000
cygnus-ngsi.channels.ckan-channel.transactionCapacity = 100

cygnus-ngsi.channels.hdfs-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.hdfs-channel.capacity = 1000
cygnus-ngsi.channels.hdfs-channel.transactionCapacity = 100

cygnus-ngsi.channels.cartodb-channel.type = com.telefonica.iot.cygnus.channels.CygnusMemoryChannel
cygnus-ngsi.channels.cartodb-channel.capacity = 1000
cygnus-ngsi.channels.cartodb-channel.transactionCapacity = 100
