Skip to content

Commit

Permalink
Suggested changes to print stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhan499 authored Oct 13, 2019
1 parent 3612230 commit 5faf691
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/main/java/com/merck/rdf2x/jobs/stats/StatsJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ public class StatsJob implements Runnable {
/**
* Subject URI count
*/
private long subjectURICount;
private Long subjectURICount;

/**
* Predicate URI count
*/
private long predicateURICount;
private Long predicateURICount;

/**
* Object URI count
*/
private long objectURICount;
private Long objectURICount;

public StatsJob(StatsConfig config, JavaSparkContext sc) throws ConfigurationException {
this.config = config;
Expand Down Expand Up @@ -130,9 +130,15 @@ public void run() {
*/
private void printStats() {
log.info("---------------------------------");
log.info("Total Distinct Subject URIs: {}", subjectURICount);
log.info("Total Distinct Predicate URIs: {}", predicateURICount);
log.info("Total Distinct Object URIs: {}", objectURICount);
if(subjectURICount != null) {
log.info("Total Distinct Subject URIs: {}", subjectURICount);
}
if(predicateURICount != null) {
log.info("Total Distinct Predicate URIs: {}", predicateURICount);
}
if(objectURICount != null) {
log.info("Total Distinct Object URIs: {}", objectURICount);
}
log.info("---------------------------------");
}

Expand Down

0 comments on commit 5faf691

Please sign in to comment.