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

Issue #LR-766 chore: upgraded the elasticsearch from 6.8.22 to 7.17.13 #617

Merged
merged 38 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b331a51
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 22, 2024
2a7830c
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 22, 2024
72411d1
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 22, 2024
36c34bd
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 22, 2024
6110854
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 22, 2024
adfadbd
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 22, 2024
63c6482
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 23, 2024
31ab025
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 23, 2024
bab1259
Issue #LR-676 chore: Updated the learning-service to content service
AmiableAnil Feb 23, 2024
c6877bb
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.12
AmiableAnil Feb 27, 2024
df5d72e
Issue #LR-740 chore: Removed unused dependency
AmiableAnil Feb 27, 2024
cabadc6
Issue #LR-740 chore: Optimized the import
AmiableAnil Feb 27, 2024
38a44a5
Issue #LR-740 chore: Updated the circleci image
AmiableAnil Feb 27, 2024
769ea84
Issue #LR-740 chore: Updated the circleci image
AmiableAnil Feb 27, 2024
8c03f6c
Issue #LR-740 chore: Updated the circleci image
AmiableAnil Feb 27, 2024
741dc7e
Issue #LR-740 chore: Updated the circleci image
AmiableAnil Feb 27, 2024
6e70363
Issue #LR-740 chore: Updated the logback-core
AmiableAnil Feb 29, 2024
7c54dcc
Issue #LR-740 chore: Updated the logback-core
AmiableAnil Feb 29, 2024
9df5af2
Issue #LR-740 chore: Updated the logback-core
AmiableAnil Feb 29, 2024
2308201
Issue #LR-740 chore: Updated the logback-core
AmiableAnil Feb 29, 2024
b331c53
Issue #LR-740 chore: Updated the logback-core
AmiableAnil Feb 29, 2024
a931d87
Issue #LR-740 chore: Added netty-common
AmiableAnil Feb 29, 2024
12d5aca
Issue #LR-740 chore: updated the redisson version
AmiableAnil Feb 29, 2024
8f2c974
Issue #LR-740 chore: updated the redisson version
AmiableAnil Feb 29, 2024
17f5062
Merge branch 'release-8.0.0' of https://github.com/Sunbird-Lern/sunbi…
AmiableAnil Mar 20, 2024
6e61866
Issue #LR-740 chore: Excluded the net buddy.
AmiableAnil Mar 20, 2024
2d337df
Issue #LR-740 chore: Reverted the netty-common changes
AmiableAnil Mar 20, 2024
79ec955
Issue #LR-740 chore: Downgraded the snakeyaml from 2.0 to 1.33
AmiableAnil Mar 20, 2024
4274a91
Issue #LR-740 chore: Fixed the netty issue
AmiableAnil Mar 20, 2024
16dd417
Issue #LR-740 chore: Fixed the netty issue
AmiableAnil Mar 20, 2024
2b6bbb6
Issue #LR-740 chore: Fixed the netty issue
AmiableAnil Mar 20, 2024
b596cd1
Merge branch 'release-8.0.0' of https://github.com/Sunbird-Lern/sunbi…
AmiableAnil Mar 20, 2024
b9e0934
Issue #LR-710 chore: update logstash-logback-encoder version from 6.6…
AmiableAnil Apr 2, 2024
ff095ea
Merge branch 'release-8.0.0' of https://github.com/Sunbird-Lern/sunbi…
AmiableAnil Apr 3, 2024
c3c1133
Issue #LR-766 chore: upgraded the elasticsearch from 6.8.22 to 7.17.13
AmiableAnil Apr 3, 2024
a29df9a
Issue #LR-766 chore: upgraded the elasticsearch from 6.8.22 to 7.17.13
AmiableAnil Apr 3, 2024
8206203
Issue #LR-766 chore: Optimize imports
AmiableAnil Apr 4, 2024
d214415
Issue #LR-766 test: Ignored test cases
AmiableAnil Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ jobs:
build:
machine:
image: ubuntu-2004:202201-02
# https://circleci.com/docs/parallelism-faster-jobs/
# parallelism: 4
# The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/2.0/configuration-reference/#resourceclass
resource_class: large
steps:
- checkout
- restore_cache:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class BackgroundJobManager extends BaseActor {
headerMap.put("accept", "application/json");
}

private ElasticSearchService esService = EsClientFactory.getInstance(JsonKey.REST);
private ElasticSearchService esService = EsClientFactory.getInstance();

@Override
public void onReceive(Request request) throws Throwable {
Expand All @@ -56,8 +56,7 @@ public void onReceive(Request request) throws Throwable {
insertCourseBatchInfoToEs(request);
} else if (operation.equalsIgnoreCase(ActorOperations.UPDATE_COURSE_BATCH_ES.getValue())) {
updateCourseBatchInfoToEs(request);
} else if (operation.equalsIgnoreCase(
ActorOperations.UPDATE_USR_COURSES_INFO_ELASTIC.getValue())) {
} else if (operation.equalsIgnoreCase(ActorOperations.UPDATE_USR_COURSES_INFO_ELASTIC.getValue())) {
updateUserCourseInfoToEs(request);
} else {
ProjectCommonException exception =
Expand All @@ -84,9 +83,7 @@ public static List<Map<String, Object>> removeDataFromMap(List<Map<String, Objec

@SuppressWarnings("unchecked")
private void updateUserCourseInfoToEs(Request actorMessage) {

Map<String, Object> batch =
(Map<String, Object>) actorMessage.getRequest().get(JsonKey.USER_COURSES);
Map<String, Object> batch = (Map<String, Object>) actorMessage.getRequest().get(JsonKey.USER_COURSES);
updateDataToElastic(actorMessage.getRequestContext(),
ProjectUtil.EsIndex.sunbird.getIndexName(),
ProjectUtil.EsType.usercourses.getTypeName(),
Expand All @@ -96,9 +93,7 @@ private void updateUserCourseInfoToEs(Request actorMessage) {

@SuppressWarnings("unchecked")
private void insertUserCourseInfoToEs(Request actorMessage) {

Map<String, Object> batch =
(Map<String, Object>) actorMessage.getRequest().get(JsonKey.USER_COURSES);
Map<String, Object> batch = (Map<String, Object>) actorMessage.getRequest().get(JsonKey.USER_COURSES);
String userId = (String) batch.get(JsonKey.USER_ID);
String batchId = (String) batch.get(JsonKey.BATCH_ID);
String identifier = UserCoursesService.generateUserCourseESId(batchId, userId);
Expand All @@ -112,8 +107,7 @@ private void insertUserCourseInfoToEs(Request actorMessage) {
@SuppressWarnings("unchecked")
private void updateCourseBatchInfoToEs(Request actorMessage) {
Map<String, Object> batch = (Map<String, Object>) actorMessage.getRequest().get(JsonKey.BATCH);
updateDataToElastic(
actorMessage.getRequestContext(), ProjectUtil.EsIndex.sunbird.getIndexName(),
updateDataToElastic(actorMessage.getRequestContext(), ProjectUtil.EsIndex.sunbird.getIndexName(),
ProjectUtil.EsType.courseBatch.getTypeName(),
(String) batch.get(JsonKey.ID),
batch);
Expand All @@ -125,17 +119,14 @@ private void insertCourseBatchInfoToEs(Request actorMessage) {
// making call to register tag
registertag(actorMessage.getRequestContext(),
(String) batch.getOrDefault(JsonKey.HASH_TAG_ID, batch.get(JsonKey.ID)),
"{}",
CourseBatchSchedulerUtil.headerMap);
"{}", CourseBatchSchedulerUtil.headerMap);
// register tag for course
registertag(
actorMessage.getRequestContext(), (String) batch.getOrDefault(JsonKey.COURSE_ID, batch.get(JsonKey.COURSE_ID)),
"{}",
CourseBatchSchedulerUtil.headerMap);
registertag(actorMessage.getRequestContext(),
(String) batch.getOrDefault(JsonKey.COURSE_ID, batch.get(JsonKey.COURSE_ID)),
"{}", CourseBatchSchedulerUtil.headerMap);
}

private boolean updateDataToElastic(
RequestContext requestContext, String indexName, String typeName, String identifier, Map<String, Object> data) {
private boolean updateDataToElastic(RequestContext requestContext, String indexName, String typeName, String identifier, Map<String, Object> data) {
Future<Boolean> responseF = esService.update(requestContext, typeName, identifier, data);
boolean response = (boolean) ElasticSearchHelper.getResponseFromFuture(responseF);
if (response) {
Expand All @@ -156,8 +147,7 @@ private boolean updateDataToElastic(
* @param data Map<String,Object>
* @return boolean
*/
private boolean insertDataToElastic(
RequestContext requestContext, String index, String type, String identifier, Map<String, Object> data) {
private boolean insertDataToElastic(RequestContext requestContext, String index, String type, String identifier, Map<String, Object> data) {
logger.info(requestContext, "BackgroundJobManager:insertDataToElastic: type = " + type + " identifier = " + identifier);
Future<String> responseF = esService.save(requestContext, type, identifier, data);
String response = (String) ElasticSearchHelper.getResponseFromFuture(responseF);
Expand Down
Loading