Skip to content

Commit

Permalink
Merge pull request #2318 from telefonicaid/task/add_doc_section_mongo…
Browse files Browse the repository at this point in the history
…db_indexes

update doc about mongo and sth indexes by DM
  • Loading branch information
fgalan authored Oct 23, 2023
2 parents 0b16bab + e2f8151 commit 031d7b0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 22 deletions.
12 changes: 12 additions & 0 deletions doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_mongo_sink.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Content:
* [Database and table names](#section1.3.2)
* [Row-like storing](#section1.3.3)
* [Column-like storing](#section1.3.4)
* [MongoDB Indexes](#section1.4)
* [Administration guide](#section2)
* [Configuration](#section2.1)
* [Use cases](#section2.2)
Expand Down Expand Up @@ -286,6 +287,17 @@ If `data_model=dm-by-entity` and `attr_persistence=column` then `NGSIMongoSink`

[Top](#top)

### <a name="section1.4"></a>MongoDB Indexes
Since version 3.0.0 of cygnus an index named `cyg_raw_opt` is created in this way but depending on datamodel:

| datamodel | keys |
| :---------------- | :--------------------------------------------------------------- |
| dm-by-servicepath | recvTime, entityId, entityType, attrName, attrType, attrValue |
| dm-by-entity | recvTime, attrName, attrType, attrValue |
| dm-by-attribute | recvTime, attrType, attrValue |

Note that attempting to use any other datamodel different from these ones will cause a "Unknown data model" ERROR in log traces. In addition, note that default datamodel for NGSIMongoSink is dm-by-entity as all others sinks which uses datamodel.

## <a name="section2"></a>Administration guide
### <a name="section2.1"></a>Configuration
`NGSIMongoSink` is configured through the following parameters:
Expand Down
58 changes: 36 additions & 22 deletions doc/cygnus-ngsi/flume_extensions_catalogue/ngsi_sth_sink.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Content:
* [`NGSIEvent`](#section1.3.1)
* [Database and table names](#section1.3.2)
* [Storing](#section1.3.3)
* [MongoDB Indexes](#section1.4)
* [Administration guide](#section2)
* [Configuration](#section2.1)
* [Use cases](#section2.2)
Expand Down Expand Up @@ -120,30 +121,30 @@ Assuming the following `NGSIEvent` is created from a notified NGSI context data

ngsi-event={
headers={
content-type=application/json,
timestamp=1429535775,
transactionId=1429535775-308-0000000000,
correlationId=1429535775-308-0000000000,
fiware-service=vehicles,
fiware-servicepath=/4wheels,
<name_mappings_interceptor_headers>
content-type=application/json,
timestamp=1429535775,
transactionId=1429535775-308-0000000000,
correlationId=1429535775-308-0000000000,
fiware-service=vehicles,
fiware-servicepath=/4wheels,
<name_mappings_interceptor_headers>
},
body={
entityId=car1,
entityType=car,
attributes=[
{
attrName=speed,
attrType=float,
attrValue=112.9
},
{
attrName=oil_level,
attrType=float,
attrValue=74.6
}
]
}
entityId=car1,
entityType=car,
attributes=[
{
attrName=speed,
attrType=float,
attrValue=112.9
},
{
attrName=oil_level,
attrType=float,
attrValue=74.6
}
]
}
}


Expand Down Expand Up @@ -288,6 +289,19 @@ Assuming `data_model=dm-by-entity` and all the possible resolutions as configura

[Top](#top)

### <a name="section1.4"></a>MongoDB Indexes

Since version 3.0.0 of cygnus index named `cyg_agg_opt` is created in this way but depending on datamodel:

| datamodel | keys |
| :----------------- | :------------------------------------------------- |
| dm-by-service-path | entityId, entityType, attrName, resolution, origin |
| dm-by-entity | attrName, resolution, origin |
| dm-by-attribute | resolution, origin |


Note that attempting to use any other datamodel different from these ones will cause a "Unknown data model" ERROR in log traces. In addition, note that default datamodel for NGSISTHSink is dm-by-entity as all others sinks which uses datamodel.

## <a name="section2"></a>Administration guide
### <a name="section2.1"></a>Configuration
`NGSISTHSink` is configured through the following parameters:
Expand Down

0 comments on commit 031d7b0

Please sign in to comment.