@Test(expected = NullPointerException.class) public void matchAffiliations_sparkContext_null() { affMatchingService.matchAffiliations(null, inputAffPath, inputOrgPath, outputPath, outputReportPath); }
public void matchAffiliations(JavaSparkContext sc, String inputAffPath, String inputOrgPath, String outputPath, String outputReportPath) { checkArguments(sc, inputAffPath, inputOrgPath, outputPath); checkState(); JavaRDD<AffMatchAffiliation> affiliations = affiliationReader.readAffiliations(sc, inputAffPath); JavaRDD<AffMatchOrganization> organizations = organizationReader.readOrganizations(sc, inputOrgPath); JavaRDD<AffMatchAffiliation> normalizedAffiliations = affiliations.map(aff -> affMatchAffiliationNormalizer.normalize(aff)).filter(aff -> (StringUtils.isNotBlank(aff.getOrganizationName()))); JavaRDD<AffMatchOrganization> normalizedOrganizations = organizations.map(org -> affMatchOrganizationNormalizer.normalize(org)).filter(org -> (StringUtils.isNotBlank(org.getName()))); JavaRDD<AffMatchOrganization> enrichedOrganizations = normalizedOrganizations.map(x -> affMatchOrganizationAltNameFiller.fillAlternativeNames(x)); JavaRDD<AffMatchResult> allMatchedAffOrgs = doMatch(sc, normalizedAffiliations, enrichedOrganizations); affMatchResultWriter.write(sc, allMatchedAffOrgs, outputPath, outputReportPath, numberOfEmittedFiles); }
AffMatchingService implements Serializable { public void matchAffiliations(JavaSparkContext sc, String inputAffPath, String inputOrgPath, String outputPath, String outputReportPath) { checkArguments(sc, inputAffPath, inputOrgPath, outputPath); checkState(); JavaRDD<AffMatchAffiliation> affiliations = affiliationReader.readAffiliations(sc, inputAffPath); JavaRDD<AffMatchOrganization> organizations = organizationReader.readOrganizations(sc, inputOrgPath); JavaRDD<AffMatchAffiliation> normalizedAffiliations = affiliations.map(aff -> affMatchAffiliationNormalizer.normalize(aff)).filter(aff -> (StringUtils.isNotBlank(aff.getOrganizationName()))); JavaRDD<AffMatchOrganization> normalizedOrganizations = organizations.map(org -> affMatchOrganizationNormalizer.normalize(org)).filter(org -> (StringUtils.isNotBlank(org.getName()))); JavaRDD<AffMatchOrganization> enrichedOrganizations = normalizedOrganizations.map(x -> affMatchOrganizationAltNameFiller.fillAlternativeNames(x)); JavaRDD<AffMatchResult> allMatchedAffOrgs = doMatch(sc, normalizedAffiliations, enrichedOrganizations); affMatchResultWriter.write(sc, allMatchedAffOrgs, outputPath, outputReportPath, numberOfEmittedFiles); } }
AffMatchingService implements Serializable { public void matchAffiliations(JavaSparkContext sc, String inputAffPath, String inputOrgPath, String outputPath, String outputReportPath) { checkArguments(sc, inputAffPath, inputOrgPath, outputPath); checkState(); JavaRDD<AffMatchAffiliation> affiliations = affiliationReader.readAffiliations(sc, inputAffPath); JavaRDD<AffMatchOrganization> organizations = organizationReader.readOrganizations(sc, inputOrgPath); JavaRDD<AffMatchAffiliation> normalizedAffiliations = affiliations.map(aff -> affMatchAffiliationNormalizer.normalize(aff)).filter(aff -> (StringUtils.isNotBlank(aff.getOrganizationName()))); JavaRDD<AffMatchOrganization> normalizedOrganizations = organizations.map(org -> affMatchOrganizationNormalizer.normalize(org)).filter(org -> (StringUtils.isNotBlank(org.getName()))); JavaRDD<AffMatchOrganization> enrichedOrganizations = normalizedOrganizations.map(x -> affMatchOrganizationAltNameFiller.fillAlternativeNames(x)); JavaRDD<AffMatchResult> allMatchedAffOrgs = doMatch(sc, normalizedAffiliations, enrichedOrganizations); affMatchResultWriter.write(sc, allMatchedAffOrgs, outputPath, outputReportPath, numberOfEmittedFiles); }  }
AffMatchingService implements Serializable { public void matchAffiliations(JavaSparkContext sc, String inputAffPath, String inputOrgPath, String outputPath, String outputReportPath) { checkArguments(sc, inputAffPath, inputOrgPath, outputPath); checkState(); JavaRDD<AffMatchAffiliation> affiliations = affiliationReader.readAffiliations(sc, inputAffPath); JavaRDD<AffMatchOrganization> organizations = organizationReader.readOrganizations(sc, inputOrgPath); JavaRDD<AffMatchAffiliation> normalizedAffiliations = affiliations.map(aff -> affMatchAffiliationNormalizer.normalize(aff)).filter(aff -> (StringUtils.isNotBlank(aff.getOrganizationName()))); JavaRDD<AffMatchOrganization> normalizedOrganizations = organizations.map(org -> affMatchOrganizationNormalizer.normalize(org)).filter(org -> (StringUtils.isNotBlank(org.getName()))); JavaRDD<AffMatchOrganization> enrichedOrganizations = normalizedOrganizations.map(x -> affMatchOrganizationAltNameFiller.fillAlternativeNames(x)); JavaRDD<AffMatchResult> allMatchedAffOrgs = doMatch(sc, normalizedAffiliations, enrichedOrganizations); affMatchResultWriter.write(sc, allMatchedAffOrgs, outputPath, outputReportPath, numberOfEmittedFiles); }  void matchAffiliations(JavaSparkContext sc, String inputAffPath, String inputOrgPath, String outputPath, String outputReportPath); void setOrganizationReader(OrganizationReader organizationReader); void setAffiliationReader(AffiliationReader affiliationReader); void setAffMatchOrganizationAltNameFiller(AffMatchOrganizationAltNameFiller affMatchOrganizationAltNameFiller); void setAffOrgMatchers(List<AffOrgMatcher> affOrgMatchers); void setAffMatchResultWriter(AffMatchResultWriter affMatchResultWriter); void setNumberOfEmittedFiles(int numberOfEmittedFiles); }
AffMatchingService implements Serializable { public void matchAffiliations(JavaSparkContext sc, String inputAffPath, String inputOrgPath, String outputPath, String outputReportPath) { checkArguments(sc, inputAffPath, inputOrgPath, outputPath); checkState(); JavaRDD<AffMatchAffiliation> affiliations = affiliationReader.readAffiliations(sc, inputAffPath); JavaRDD<AffMatchOrganization> organizations = organizationReader.readOrganizations(sc, inputOrgPath); JavaRDD<AffMatchAffiliation> normalizedAffiliations = affiliations.map(aff -> affMatchAffiliationNormalizer.normalize(aff)).filter(aff -> (StringUtils.isNotBlank(aff.getOrganizationName()))); JavaRDD<AffMatchOrganization> normalizedOrganizations = organizations.map(org -> affMatchOrganizationNormalizer.normalize(org)).filter(org -> (StringUtils.isNotBlank(org.getName()))); JavaRDD<AffMatchOrganization> enrichedOrganizations = normalizedOrganizations.map(x -> affMatchOrganizationAltNameFiller.fillAlternativeNames(x)); JavaRDD<AffMatchResult> allMatchedAffOrgs = doMatch(sc, normalizedAffiliations, enrichedOrganizations); affMatchResultWriter.write(sc, allMatchedAffOrgs, outputPath, outputReportPath, numberOfEmittedFiles); }  void matchAffiliations(JavaSparkContext sc, String inputAffPath, String inputOrgPath, String outputPath, String outputReportPath); void setOrganizationReader(OrganizationReader organizationReader); void setAffiliationReader(AffiliationReader affiliationReader); void setAffMatchOrganizationAltNameFiller(AffMatchOrganizationAltNameFiller affMatchOrganizationAltNameFiller); void setAffOrgMatchers(List<AffOrgMatcher> affOrgMatchers); void setAffMatchResultWriter(AffMatchResultWriter affMatchResultWriter); void setNumberOfEmittedFiles(int numberOfEmittedFiles);  }