Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates index as per data model #2205

Merged
merged 4 commits into from
Dec 13, 2022
Merged

Conversation

kajal583
Copy link
Contributor

This pull request fixes issue #2204

@fgalan
Copy link
Member

fgalan commented Nov 29, 2022

The usual DM used with STHSink and MongoSink is dm-by-service-path

Comment on lines 111 to 112
.append("_id.origin", 1)
.append("_id.resolution", 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change in the order of keys instead of keeping the original one? I mean:

Suggested change
.append("_id.origin", 1)
.append("_id.resolution", 1);
.append("_id.resolution", 1);
.append("_id.origin", 1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in f7e74e4

break;
case DMBYATTRIBUTE:
keys.append("_id.origin", 1)
.append("_id.resolution", 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.append("_id.resolution", 1);
.append("_id.resolution", 1);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in f7e74e4

@@ -102,12 +102,26 @@ public void createCollection(String dbName, String collectionName, long dataExpi
BasicDBObject keys;
IndexOptions options;
try {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From which sink is this createCollection() is being called? MongoSink or STHSink?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createCollection(String dbName, String collectionName, long dataExpiration) is being called from STHSink

@@ -162,14 +176,33 @@ public void createCollection(String dbName, String collectionName, long collecti
} // try catch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From which sink is this createCollection() is being called? MongoSink or STHSink?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createCollection(String dbName, String collectionName, long collectionsSize, long maxDocuments, long dataExpiration) is being called from MongoSink

Updated for issue#2204
@kajal583
Copy link
Contributor Author

Hi @fgalan ,
I have resolved both the suggestions. Please merge the PR If it seems ok.

Copy link
Member

@AlvaroVega AlvaroVega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -102,12 +102,26 @@ public void createCollection(String dbName, String collectionName, long dataExpi
BasicDBObject keys;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An entry in CHANGES_NEXT_RELEASE file should be included, describing the changes in this PR. Something like this:

[cygnus-common] MongoDB indexes are created depending on DM (#2204)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 4ff6d9b

@kajal583
Copy link
Contributor Author

kajal583 commented Dec 5, 2022

Hi @fgalan,
I have added entry in CNR.
Thanks.

Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the contribution!

@AlvaroVega
Copy link
Member

Documentation about sth indexes: https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/db_indexes.md should be updated after this PR changes then depending on the datamodel used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants