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

Rebased code changes in EI-2.X to EI-3.X and added TTL indexes automatic updation. #507

Merged
merged 46 commits into from
Oct 21, 2021

Conversation

Gangisetty-Alekhya
Copy link
Contributor

@Gangisetty-Alekhya Gangisetty-Alekhya commented Sep 9, 2021

Description of the Change

Rebased the changes that were done on EI2.X to EI3.X. Modified code to handle the missed subscriptions and EI performance improvements and also handled the TTL values and updation of indexes for the collections is done automatically.

Alternate Designs

NA

Benefits

No events are dropped, and the event processing rate is improved which inturn increases the EI performance.
The indexes are updated automatically w.r.t TTL values provided.

Possible Drawbacks

NA

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: Raju Beemreddy raju.beemreddy@tcs.com, Gangisetty Alekhya gangisetty.alekhya@tcs.com, Kolli Suryakumari sk.surya@tcs.com

@Gangisetty-Alekhya Gangisetty-Alekhya marked this pull request as ready for review September 15, 2021 05:12
@@ -88,10 +88,12 @@
private JenkinsXmlData jenkinsXmlData;
private SubscriptionObject subscriptionObject;
private JSONObject jobStatusData;
public String AggEvent;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please give a better name instead of AggEvent

Copy link
Member

Choose a reason for hiding this comment

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

follow java naming standards for variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, changed AggEvent to aggregatedEvent

LOGGER.debug(
"Sent back the event to queue with un-acknowledgement: " + message.getBody());
LOGGER.info(
"Sent back the event {} to queue with un-acknowledgement due to {}", id, mdce);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain what is this mdce?

@Surya-Kolli Surya-Kolli self-assigned this Sep 30, 2021
EIFFEL_EVENTS_JSON_PATH, eventNamesToSend),
0);
JsonNode parsedJSON = IntegrationTestBase.getJSONFromFile(EIFFEL_EVENTS_JSON_PATH);
for(String eventName : eventNamesToSend) {
Copy link
Member

Choose a reason for hiding this comment

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

use forEach

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -177,6 +183,8 @@ public void aggregated_object_is_created() throws Throwable {
// verify that aggregated object is created and present in db
LOGGER.debug("Checking presence of aggregated Object");
List<String> allObjects = mongoDBHandler.getAllDocuments(database, collection);
String id = eventManager.getEventsIdList(EIFFEL_EVENTS_JSON_PATH, getEventNamesToSend()).get(0);
Copy link
Member

Choose a reason for hiding this comment

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

rename the method to getEventIdsList

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -107,6 +107,10 @@ public void get_content(String contentFileName) throws Throwable {
if (expectedResponse instanceof JSONArray) {
JSONArray expectedArray = new JSONArray(responseBody);
JSONArray responseArray = new JSONArray(response.getBody().toString());
for(int i=0;i<responseArray.length();i++) {
Copy link
Member

Choose a reason for hiding this comment

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

format the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -88,10 +88,12 @@
private JenkinsXmlData jenkinsXmlData;
private SubscriptionObject subscriptionObject;
private JSONObject jobStatusData;
public String AggEvent;
Copy link
Member

Choose a reason for hiding this comment

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

follow java naming standards for variables

String queryString = "{\"_id\": " + aggId + "}";
MongoStringQuery query = new MongoStringQuery(queryString);
documents = mongoDBHandler.find(database, collectionName, query);
JSONObject json = new JSONObject(documents.get(0));
Copy link
Member

Choose a reason for hiding this comment

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

should this only be performed for the single event?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

JSONObject json = new JSONObject(documents.get(0));
JSONArray jsonArray = new JSONArray();
jsonArray.put(json.get("objects"));
String s = json.get("objects").toString();
Copy link
Member

Choose a reason for hiding this comment

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

proper name instead of s

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

break;
}
}
if (content.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

move this check next to "content = read...."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -95,7 +101,9 @@
private String failedNotificationCollectionName;
@Value("${sessions.collection.name}")
private String sessionsCollectionName;


List<String> expectedAggId = Stream.of("sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47","aacc3c87-75e0-4b6d-88f5-b1a5d4e62b43","e46ef12d-25gb-4d7y-b9fd-8763re66de47").collect(Collectors.toList());
Copy link
Member

Choose a reason for hiding this comment

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

use ArrayLIst instead of Stream.of and collect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This ArrayList is not required, I have removed this line.

@Surya-Kolli Surya-Kolli changed the title EI should handle the TTL indexes updating automatically Rebased code changes in EI-2.X to EI-3.X and added TTL indexes automatic updation. Oct 20, 2021
@Surya-Kolli Surya-Kolli merged commit a1bd6ad into eiffel-community:master Oct 21, 2021
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.

6 participants