-
Notifications
You must be signed in to change notification settings - Fork 73
Fix for MongoDBHandling on ObjectToEvent map handling #472
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
Fix for MongoDBHandling on ObjectToEvent map handling #472
Conversation
e-pettersson-ericsson
left a comment
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.
Mostly comments on javadoc. Are there no updates needed in the tests for these changes?
src/main/java/com/ericsson/ei/handlers/EventToObjectMapHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/com/ericsson/ei/handlers/EventToObjectMapHandler.java
Outdated
Show resolved
Hide resolved
|
Fixed comments from Emelie in 74d6c4b |
src/main/java/com/ericsson/ei/handlers/EventToObjectMapHandler.java
Outdated
Show resolved
Hide resolved
e-pettersson-ericsson
left a comment
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.
It looks like the tests still needs to be updated, but otherwise I commented mostly on logging and general naming.
|
|
||
| public boolean isEventInEventObjectMap(String eventId) { | ||
| String condition = "{\"_id\" : \"" + eventId + "\"}"; | ||
| String condition = "{\"objects\": { \"$in\" : [\"" + eventId + "\"]} }"; |
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.
At the top of this class a variable is defined for this key called 'listPropertyName' - use it here also. However, given that you've changed the structure of this document to look like:
```
"_id": "aggregated-object-id",
"objects": ["event-id", "event-id"]
```
the key of the list should perhaps be called "events" instead of "objects"? It would look somehting like this instead:
```
"_id": "aggregated-object-id",
"events": ["event-id", "event-id"]
```
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.
At the top of this class a variable is defined for this key called 'listPropertyName' - use it here also. However, given that you've changed the structure of this document to look like:
"_id": "aggregated-object-id",
"objects": ["event-id", "event-id"]the key of the list should perhaps be called "events" instead of "objects"? It would look somehting like this instead:
"_id": "aggregated-object-id",
"events": ["event-id", "event-id"]
changed "events" instead of "objects"
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.
"events" instead of "objects" changes will come in future, this changes will be release ASAP, could you please review the current changes
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.
I see another PR open, which duplicates this one. Please update the changes in this PR and close the other one (then we keep the review history also) It's possible for @SantoshNC68 to allow @durga-vasaadi as collaborator on your fork, and this way you can both push to this one PR.
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.
Yes I have done that and we have worked together, but because of the issues on the travis we have another PR. We will close that.
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.
Also we will not make changes for events in this PR but will do it another PR as we need to see the impact of that.
| try { | ||
| // lock and get the AggregatedObject | ||
| String aggregatedObject = getAggregatedObject(id, true); | ||
| LOGGER.debug("AGGREGATED OBJECT : " + aggregatedObject); |
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.
Do you really want to log the entire aggregation twice? They can be very big, so it might clutter the log.
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.
removed logger
|
What is the plan of these latest changes. Are the plan to merge this to Master ? Or just have it in this 2.0 maintenance branch and never have it on Master. As it is now, it can't be merge directly to master. You need to implement same thing one more time, but for Master branch on PR based on Master branch code base. |
ea444f2 to
2b47e2c
Compare
Yes they will need to be updated in the master branch also and we will make it as a separate PR for master branch. |
src/functionaltests/java/com/ericsson/ei/utils/DataBaseManager.java
Outdated
Show resolved
Hide resolved
src/functionaltests/java/com/ericsson/ei/utils/DataBaseManager.java
Outdated
Show resolved
Hide resolved
| for (String expectedID : new ArrayList<>(checklist)) { | ||
| if (expectedID.equals(document.get("_id").toString())) { | ||
| checklist.remove(expectedID); | ||
| Document objects = (Document) document.get("objects")) |
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.
Shouldn't this be "events"?
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.
Travis complains a lot about compilation errors, which can be discovered earlier if you run the maven commands in your local environment.
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.
It should be events. Just wanted to check why the travis has been failing.
src/main/java/com/ericsson/ei/waitlist/WaitListStorageHandler.java
Outdated
Show resolved
Hide resolved
e-pettersson-ericsson
left a comment
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.
I haven't been able to test this locally due to my Java environment, but since I know it's been tested in a real environment and I realize time is of the essence for this fix, I'll approve it. But I hope the remaining comments will be fixed in an upcoming PR as soon as possible. And that these changes are also made on master if the same issue occurs there.
Applicable Issues
NA
Description of the Change
Made code changes to handle the updation of events in Object to Event mapper.
Also updated the logic to not store duplicate eventIds.
Alternate Designs
Benefits
Performance improvements in storing the ObjectToEvent mapping relation without having to query multiple times.
Possible Drawbacks
Sign-off
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
Signed-off-by: @SantoshNC68 , @raja-maragani