Add rabbitmq and cassandra config in contrail-collector
At present, contrail-collector service reads the configuration from the
contrail-api periodically.We are changing the scheme to get the config
notification from rabbitmq and read the configurationfrom config
db (cassandra)
This is the first commit to decouple config client management from
ifmap. The implement move common code of config client management to
src/config/, and at same time move json parser related code to json
parser base class. Class json parser base involve json parse's common
input and output. User need implement derived class and rewrite
virtual function receive to deal with json document output, and
wite virtual fuction:
setup_schema_graph_filter
setup_schema_wrapper_property_info
setup_objector_filter
to filter object/class needed by user.
Change detail:
1. Except config_json_parser*, move other files of ifmap/client to
config/config-client, involve sandesh file.
2. decouple some attribute of ifmap .sandesh to config-client-mgr/
.sandes
3. generate config_json_parse_base*, move class ConfigClientManager's
link_name_map_
parent_name_map_
wrapper_field_map_
obj_type_to_read_
and data-related function
to class config_json_parse_base since they are the input data of json
decode and encode, lib user can implement derived class and rewrite
to setup minimal input data for json decode and encode.
4. rewrite delete colume code but keep cache.
Old code according to cache to generate ifmap DB request list
directly, which couple common fucntion to ifmap. This implement
to define output of delete as ConfigCass2JsonAdapter, which is
same to add/update. To implement this, we change FieldDetailMap
key from string to JsonAdapterDataType, this can keep all json
generate infos with minor change. And when need delete one colomn,
we generate ConfigCass2JsonAdapter but add_update is set to false.
Here, we have a special senario: propertymap/property list. If
list/map is not empty, ifmap DB can delete old priorities and
add/update new priorities internal, only with one update message,
only when list/map is empty, a deleted message is needed.
For example, to one property map with property 1,2,3, and after
that, update with property 4,5, only one message with update 4,5
is enough to ifmap DB. Ifmap DB will delete 1,2,3 and create 4,5.
But from lib common view, since cache has been implemented
internal in cassadra DB client, we should notify update and delete
by property. To this case, we need notify update 4,5, and notify
1,2,3 delete at same time for other lib user. To ifmap DB, we give
a new API: IsListOrMapPropertyEmpty with parameter uuid and
metaname to check if property map/list is empty.
Reviewed: https:/ /review. opencontrail. org/34033 github. com/Juniper/ contrail- controller/ commit/ 77b4298630b5563 45b1940cbdbf6f1 a641e623af
Committed: http://
Submitter: Zuul (<email address hidden>)
Branch: master
commit 77b4298630b5563 45b1940cbdbf6f1 a641e623af
Author: zcui <email address hidden>
Date: Wed Jul 26 10:28:45 2017 -0700
Add rabbitmq and cassandra config in contrail-collector
At present, contrail-collector service reads the configuration from the
contrail-api periodically.We are changing the scheme to get the config
notification from rabbitmq and read the configurationfrom config
db (cassandra)
This is the first commit to decouple config client management from graph_filter wrapper_ property_ info filter
ifmap. The implement move common code of config client management to
src/config/, and at same time move json parser related code to json
parser base class. Class json parser base involve json parse's common
input and output. User need implement derived class and rewrite
virtual function receive to deal with json document output, and
wite virtual fuction:
setup_schema_
setup_schema_
setup_objector_
to filter object/class needed by user.
Change detail: json_parser* , move other files of ifmap/client to config- client, involve sandesh file. json_parse_ base*, move class ConfigClientMan ager's
1. Except config_
config/
2. decouple some attribute of ifmap .sandesh to config-client-mgr/
.sandes
3. generate config_
link_name_map_
parent_name_map_
wrapper_field_map_
obj_type_to_read_
and data-related function
to class config_ json_parse_ base since they are the input data of json
decode and encode, lib user can implement derived class and rewrite
setup_schema_ graph_filter wrapper_ property_ info filter
setup_schema_
setup_objector_
to setup minimal input data for json decode and encode. Adapter, which is Type, this can keep all json Adapter but add_update is set to false. property list. If ertyEmpty with parameter uuid and
4. rewrite delete colume code but keep cache.
Old code according to cache to generate ifmap DB request list
directly, which couple common fucntion to ifmap. This implement
to define output of delete as ConfigCass2Json
same to add/update. To implement this, we change FieldDetailMap
key from string to JsonAdapterData
generate infos with minor change. And when need delete one colomn,
we generate ConfigCass2Json
Here, we have a special senario: propertymap/
list/map is not empty, ifmap DB can delete old priorities and
add/update new priorities internal, only with one update message,
only when list/map is empty, a deleted message is needed.
For example, to one property map with property 1,2,3, and after
that, update with property 4,5, only one message with update 4,5
is enough to ifmap DB. Ifmap DB will delete 1,2,3 and create 4,5.
But from lib common view, since cache has been implemented
internal in cassadra DB client, we should notify update and delete
by property. To this case, we need notify update 4,5, and notify
1,2,3 delete at same time for other lib user. To ifmap DB, we give
a new API: IsListOrMapProp
metaname to check if property map/list is empty.
Change-Id: Ib07801587a8dcb 6d0121d8608a283 e03841ce8d8
Partial-Bug: 1703709