-
Notifications
You must be signed in to change notification settings - Fork 104
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
Conversation
The usual DM used with STHSink and MongoSink is |
.append("_id.origin", 1) | ||
.append("_id.resolution", 1); |
There was a problem hiding this comment.
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:
.append("_id.origin", 1) | |
.append("_id.resolution", 1); | |
.append("_id.resolution", 1); | |
.append("_id.origin", 1) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.append("_id.resolution", 1); | |
.append("_id.resolution", 1); |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Hi @fgalan , |
There was a problem hiding this 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; |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 4ff6d9b
Hi @fgalan, |
There was a problem hiding this 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!
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. |
This pull request fixes issue #2204