Skip to content

Commit

Permalink
Merge pull request #1128 from rheafernandes/release-3.1.0
Browse files Browse the repository at this point in the history
 ISSUE-19988 Added logs for checking cassandra issue
  • Loading branch information
maheshkumargangula authored Aug 3, 2020
2 parents 3e4c1f7 + c493e34 commit cd2dfdc
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion platform-jobs/samza/course-batch-updater/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<scala.version>2.11</scala.version>
<hadoop.version>2.6.2</hadoop.version>
</properties>
<version>0.0.48</version>
<version>0.0.49</version>
<dependencies>
<dependency>
<groupId>org.ekstep</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ private Map<String, Object> generateInstructionEvent(Map<String, Object> certifi
}
});
String beJobRequestEvent = LogTelemetryEventUtil.logInstructionEvent(actor, context, object, edata);
LOGGER.info("CourseBatchUpdater:generateInstructionEvent: beJobRequestEvent " + beJobRequestEvent);
return mapper.readValue(beJobRequestEvent, new TypeReference<Map<String, Object>>() {});
}

Expand Down
2 changes: 1 addition & 1 deletion platform-jobs/samza/course-certificate-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>course-certificate-generator</artifactId>
<version>0.0.51</version>
<version>0.0.52</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public void issue(Map<String, Object> edata, MessageCollector collector) {
String batchId = (String) edata.get(CourseCertificateParams.batchId.name());
String courseId = (String) edata.get(CourseCertificateParams.courseId.name());
List<String> userIds = (null != edata.get(CourseCertificateParams.userIds.name()))? (List<String>)edata.get(CourseCertificateParams.userIds.name()): new ArrayList<>();
LOGGER.info("IssueCertificate:issue: userIds : " + userIds);
LOGGER.info("IssueCertificate:issue: eData : " + mapper.writeValueAsString(edata));
Boolean reissue = (null != edata.get(CourseCertificateParams.reIssue.name()))
? (Boolean) edata.get(CourseCertificateParams.reIssue.name()) : false;

Expand Down Expand Up @@ -89,6 +91,7 @@ private Map<String, Map<String, String>> fetchTemplates(String batchId, String c

private void fetchUsersAndIssueCertificates(String batchId, String courseId, Boolean reIssue, Map<String, Map<String, String>> templates, MessageCollector collector, List<String> userIds) {
try {
LOGGER.info("IssueCertificate:fetchUsersAndIssueCertificates: userIds " + userIds);
for (String key : templates.keySet()) {
Map<String, String> template = templates.get(key);
String certName = template.getOrDefault("name", "");
Expand Down Expand Up @@ -230,6 +233,7 @@ private Map<String, Double> fetchAssessedUsersFromDB(String batchId, String cour
String query = "SELECT user_id, max(total_score) as score, total_max_score FROM " + KEYSPACE +"." + ASSESSMENT_AGGREGATOR_TABLE +
" where course_id='" +courseId + "' AND batch_id='" + batchId + "' " +
"GROUP BY course_id,batch_id,user_id,content_id ORDER BY batch_id,user_id,content_id;";
LOGGER.info("IssueCertificate : fetchAssessedUsersFromDB :: query " + query);
ResultSet resultSet = SunbirdCassandraUtil.execute(cassandraSession, query);
Iterator<Row> rows = resultSet.iterator();
Map<String, Map<String, Double>> userScore = new HashMap<>();
Expand Down Expand Up @@ -262,6 +266,7 @@ private List<String> getUserFromEnrolmentCriteria(Map<String, Object> enrollment
put(CourseCertificateParams.courseId.name(), courseId);
putAll(enrollment);
}};
LOGGER.info("IssueCertificate:getUserFromEnrolmentCriteria: userIds " + userIds);
if(CollectionUtils.isNotEmpty(userIds)) {
dataToFetch.put(CourseCertificateParams.userId.name(), userIds);
}
Expand Down
4 changes: 2 additions & 2 deletions platform-jobs/samza/distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>org.ekstep</groupId>
<artifactId>course-batch-updater</artifactId>
<version>0.0.48</version>
<version>0.0.49</version>
<type>tar.gz</type>
<classifier>distribution</classifier>
</dependency>
Expand All @@ -88,7 +88,7 @@
<dependency>
<groupId>org.ekstep</groupId>
<artifactId>course-certificate-generator</artifactId>
<version>0.0.51</version>
<version>0.0.52</version>
<type>tar.gz</type>
<classifier>distribution</classifier>
</dependency>
Expand Down

0 comments on commit cd2dfdc

Please sign in to comment.