Support cassandra connection timeout option
Creating a cassandra connection can be limited by connection_timeout option. Story: 2005450 Task: 30502 Change-Id: I8803e28fe8c2c11e819be44db4ef93cb19b47a1d
This commit is contained in:
parent
936c50861e
commit
dbe1ea8b50
|
@ -124,6 +124,7 @@ class MetricsRepository(metrics_repository.AbstractMetricsRepository):
|
||||||
self.cluster = Cluster(self.conf.cassandra.contact_points,
|
self.cluster = Cluster(self.conf.cassandra.contact_points,
|
||||||
port=self.conf.cassandra.port,
|
port=self.conf.cassandra.port,
|
||||||
auth_provider=auth_provider,
|
auth_provider=auth_provider,
|
||||||
|
connect_timeout=self.conf.cassandra.connection_timeout,
|
||||||
load_balancing_policy=TokenAwarePolicy(
|
load_balancing_policy=TokenAwarePolicy(
|
||||||
DCAwareRoundRobinPolicy(
|
DCAwareRoundRobinPolicy(
|
||||||
local_dc=self.conf.cassandra.local_data_center))
|
local_dc=self.conf.cassandra.local_data_center))
|
||||||
|
|
|
@ -40,6 +40,10 @@ Cassandra user for monasca-api service
|
||||||
cfg.StrOpt('password', default='', secret=True,
|
cfg.StrOpt('password', default='', secret=True,
|
||||||
help='''
|
help='''
|
||||||
Cassandra user password for monasca-api service
|
Cassandra user password for monasca-api service
|
||||||
|
'''),
|
||||||
|
cfg.IntOpt('connection_timeout', default=5,
|
||||||
|
help='''
|
||||||
|
Cassandra timeout in seconds when creating a new connection
|
||||||
'''),
|
'''),
|
||||||
cfg.StrOpt('local_data_center', default='',
|
cfg.StrOpt('local_data_center', default='',
|
||||||
help='''
|
help='''
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Support cassandra connection timeout option which set timeout when creating a new connection.
|
Loading…
Reference in New Issue