Reduced the number of calls to count unique data sources in intercase correlation to one, this will have merge conflicts with brians branch

This commit is contained in:
U-BASIS\dsmyda 2018-09-13 14:58:06 -04:00
parent 835c1b4da8
commit a6c3607ea1

View File

@ -125,6 +125,7 @@ final public class CommonAttributeSearchResults {
EamDb eamDb = EamDb.getInstance(); EamDb eamDb = EamDb.getInstance();
Map<Integer, List<CommonAttributeValue>> itemsToRemove = new HashMap<>(); Map<Integer, List<CommonAttributeValue>> itemsToRemove = new HashMap<>();
Double uniqueCaseDataSourceTuples = eamDb.getCountUniqueDataSources().doubleValue();
for(Entry<Integer, CommonAttributeValueList> listOfValues : Collections.unmodifiableMap(this.instanceCountToAttributeValues).entrySet()){ for(Entry<Integer, CommonAttributeValueList> listOfValues : Collections.unmodifiableMap(this.instanceCountToAttributeValues).entrySet()){
@ -134,7 +135,11 @@ final public class CommonAttributeSearchResults {
for(CommonAttributeValue value : values.getDelayedMetadataList()){ // Need the real metadata for(CommonAttributeValue value : values.getDelayedMetadataList()){ // Need the real metadata
try { try {
int frequencyPercentage = eamDb.getFrequencyPercentage(new CorrelationAttributeInstance(fileAttributeType, value.getValue())); CorrelationAttributeInstance corAttr = new CorrelationAttributeInstance(fileAttributeType, value.getValue());
Double uniqueTypeValueTuples = eamDb.getCountUniqueCaseDataSourceTuplesHavingTypeValue(
corAttr.getCorrelationType(), corAttr.getCorrelationValue()).doubleValue();
Double commonalityPercentage = uniqueTypeValueTuples / uniqueCaseDataSourceTuples * 100;
int frequencyPercentage = commonalityPercentage.intValue();
if(frequencyPercentage > maximumPercentageThreshold){ if(frequencyPercentage > maximumPercentageThreshold){
if(itemsToRemove.containsKey(key)){ if(itemsToRemove.containsKey(key)){
@ -184,4 +189,4 @@ final public class CommonAttributeSearchResults {
} }
return count; return count;
} }
} }