Add database params for collector

Related-Bug: PROD-29404

I case that sandesh messages should'n be stored in analytics database.

Change-Id: I168f4e60c18fa5a345719e41e2ed0acb429fbd72
diff --git a/README.rst b/README.rst
index 829e827..44c9e7c 100644
--- a/README.rst
+++ b/README.rst
@@ -1533,6 +1533,26 @@
         nodemgr: 10
       ....
 
+Disable database writes of collector
+------------------------------------
+
+Sandesh messages aren't written to analytics database by changing following parameters to `true`.
+Default value all of these parametes is `false`. Is possible to change one or more parametes.
+
+.. code-block:: yaml
+
+    opencontrail:
+      ....
+      collector
+        ....
+        database:
+          ....
+          disable_all_writes: false
+          disable_statistics_writes: true
+          disable_message_writes: false
+          ....
+
+
 Define aging time for flow-records in seconds
 ---------------------------------------------
 
diff --git a/opencontrail/files/4.0/contrail-collector.conf b/opencontrail/files/4.0/contrail-collector.conf
index 505ad1d..b2ade38 100644
--- a/opencontrail/files/4.0/contrail-collector.conf
+++ b/opencontrail/files/4.0/contrail-collector.conf
@@ -133,6 +133,12 @@
 #high_watermark2.message_severity_level=SYS_DEBUG
 #low_watermark2.message_severity_level=INVALID
 
+{%- if collector.database is defined %}
+disable_all_writes={{ collector.database.get('disable_all_writes','false')|lower }}
+disable_statistics_writes={{ collector.database.get('disable_statistics_writes','false')|lower }}
+disable_message_writes={{ collector.database.get('disable_message_writes','false')|lower }}
+{%- endif %}
+
 [REDIS]
 port=6379
 server=127.0.0.1