@Test(expected = NullPointerException.class) public void report_NULL_REPORT_PATH() { counterReporter.report(sparkContext, uniqueEntities, uniqueRelations, null); }
public void report(JavaSparkContext sparkContext, JavaRDD<?> uniqueEntities, JavaRDD<Tuple3<String, String, Float>> uniqueRelations, String outputReportPath) { Preconditions.checkNotNull(outputReportPath, "reportPath has not been set"); Preconditions.checkNotNull(sparkContext, "sparkContext has not been set"); ReportEntry totalEntitiesCounter = ReportEntryFactory.createCounterReportEntry(EXPORTED_SOFTWARE_ENTITIES_COUNTER, uniqueEntities.count()); ReportEntry totalRelationsCounter = ReportEntryFactory.createCounterReportEntry(SOFTWARE_REFERENCES_COUNTER, uniqueRelations.count()); ReportEntry distinctPubsCounter = generateDistinctPublicationsCounter(uniqueRelations); JavaRDD<ReportEntry> report = sparkContext.parallelize(Lists.newArrayList( totalEntitiesCounter, totalRelationsCounter, distinctPubsCounter), 1); avroSaver.saveJavaRDD(report, ReportEntry.SCHEMA$, outputReportPath); }
SoftwareExportCounterReporter { public void report(JavaSparkContext sparkContext, JavaRDD<?> uniqueEntities, JavaRDD<Tuple3<String, String, Float>> uniqueRelations, String outputReportPath) { Preconditions.checkNotNull(outputReportPath, "reportPath has not been set"); Preconditions.checkNotNull(sparkContext, "sparkContext has not been set"); ReportEntry totalEntitiesCounter = ReportEntryFactory.createCounterReportEntry(EXPORTED_SOFTWARE_ENTITIES_COUNTER, uniqueEntities.count()); ReportEntry totalRelationsCounter = ReportEntryFactory.createCounterReportEntry(SOFTWARE_REFERENCES_COUNTER, uniqueRelations.count()); ReportEntry distinctPubsCounter = generateDistinctPublicationsCounter(uniqueRelations); JavaRDD<ReportEntry> report = sparkContext.parallelize(Lists.newArrayList( totalEntitiesCounter, totalRelationsCounter, distinctPubsCounter), 1); avroSaver.saveJavaRDD(report, ReportEntry.SCHEMA$, outputReportPath); } }
SoftwareExportCounterReporter { public void report(JavaSparkContext sparkContext, JavaRDD<?> uniqueEntities, JavaRDD<Tuple3<String, String, Float>> uniqueRelations, String outputReportPath) { Preconditions.checkNotNull(outputReportPath, "reportPath has not been set"); Preconditions.checkNotNull(sparkContext, "sparkContext has not been set"); ReportEntry totalEntitiesCounter = ReportEntryFactory.createCounterReportEntry(EXPORTED_SOFTWARE_ENTITIES_COUNTER, uniqueEntities.count()); ReportEntry totalRelationsCounter = ReportEntryFactory.createCounterReportEntry(SOFTWARE_REFERENCES_COUNTER, uniqueRelations.count()); ReportEntry distinctPubsCounter = generateDistinctPublicationsCounter(uniqueRelations); JavaRDD<ReportEntry> report = sparkContext.parallelize(Lists.newArrayList( totalEntitiesCounter, totalRelationsCounter, distinctPubsCounter), 1); avroSaver.saveJavaRDD(report, ReportEntry.SCHEMA$, outputReportPath); }  }
SoftwareExportCounterReporter { public void report(JavaSparkContext sparkContext, JavaRDD<?> uniqueEntities, JavaRDD<Tuple3<String, String, Float>> uniqueRelations, String outputReportPath) { Preconditions.checkNotNull(outputReportPath, "reportPath has not been set"); Preconditions.checkNotNull(sparkContext, "sparkContext has not been set"); ReportEntry totalEntitiesCounter = ReportEntryFactory.createCounterReportEntry(EXPORTED_SOFTWARE_ENTITIES_COUNTER, uniqueEntities.count()); ReportEntry totalRelationsCounter = ReportEntryFactory.createCounterReportEntry(SOFTWARE_REFERENCES_COUNTER, uniqueRelations.count()); ReportEntry distinctPubsCounter = generateDistinctPublicationsCounter(uniqueRelations); JavaRDD<ReportEntry> report = sparkContext.parallelize(Lists.newArrayList( totalEntitiesCounter, totalRelationsCounter, distinctPubsCounter), 1); avroSaver.saveJavaRDD(report, ReportEntry.SCHEMA$, outputReportPath); }  void report(JavaSparkContext sparkContext, 
            JavaRDD<?> uniqueEntities, JavaRDD<Tuple3<String, String, Float>> uniqueRelations, String outputReportPath); }
SoftwareExportCounterReporter { public void report(JavaSparkContext sparkContext, JavaRDD<?> uniqueEntities, JavaRDD<Tuple3<String, String, Float>> uniqueRelations, String outputReportPath) { Preconditions.checkNotNull(outputReportPath, "reportPath has not been set"); Preconditions.checkNotNull(sparkContext, "sparkContext has not been set"); ReportEntry totalEntitiesCounter = ReportEntryFactory.createCounterReportEntry(EXPORTED_SOFTWARE_ENTITIES_COUNTER, uniqueEntities.count()); ReportEntry totalRelationsCounter = ReportEntryFactory.createCounterReportEntry(SOFTWARE_REFERENCES_COUNTER, uniqueRelations.count()); ReportEntry distinctPubsCounter = generateDistinctPublicationsCounter(uniqueRelations); JavaRDD<ReportEntry> report = sparkContext.parallelize(Lists.newArrayList( totalEntitiesCounter, totalRelationsCounter, distinctPubsCounter), 1); avroSaver.saveJavaRDD(report, ReportEntry.SCHEMA$, outputReportPath); }  void report(JavaSparkContext sparkContext, 
            JavaRDD<?> uniqueEntities, JavaRDD<Tuple3<String, String, Float>> uniqueRelations, String outputReportPath); static final String EXPORTED_SOFTWARE_ENTITIES_COUNTER; static final String SOFTWARE_REFERENCES_COUNTER; static final String DISTINCT_PUBLICATIONS_WITH_SOFTWARE_REFERENCES_COUNTER; }