use of org.talend.dataquality.indicators.columnset.RecordMatchingIndicator in project tdq-studio-se by Talend.
the class GroupStatisticsSection method createSubChart.
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.record.linkage.ui.section.AbstractMatchAnaysisTableSection#createSubChart(org.eclipse.
* swt.widgets.Composite)
*/
@Override
protected void createSubChart(Composite sectionClient) {
RecordMatchingIndicator recordMatchingIndicator = MatchRuleAnlaysisUtils.getRecordMatchIndicatorFromAna(analysis);
Composite chartComposite = toolkit.createComposite(sectionClient);
GridLayout tableLayout = new GridLayout(1, Boolean.TRUE);
chartComposite.setLayout(tableLayout);
GridData gridData = new GridData(GridData.FILL_BOTH);
chartComposite.setLayoutData(gridData);
matchRuleChartComp = new MatchRuleDataChart(chartComposite, recordMatchingIndicator.getGroupSize2groupFrequency());
if (!TOPChartUtil.getInstance().isTOPChartInstalled()) {
return;
}
createHideGroupComposite(chartComposite);
}
use of org.talend.dataquality.indicators.columnset.RecordMatchingIndicator in project tdq-studio-se by Talend.
the class DuplicateRecordStatisticsSection method computeMergedRecords.
/**
* DOC zhao Comment method "computeMergedRecords".
*
* @return
*/
private Long computeMergedRecords() {
RecordMatchingIndicator recordMatchingIndicator = MatchRuleAnlaysisUtils.getRecordMatchIndicatorFromAna(analysis);
Map<Object, Long> g2f = recordMatchingIndicator.getGroupSize2groupFrequency();
Iterator<Object> groupSizeIterator = g2f.keySet().iterator();
Long mergedRecordsCount = 0l;
while (groupSizeIterator.hasNext()) {
Object groupSize = groupSizeIterator.next();
if (Long.valueOf(groupSize.toString()) > 1) {
Long groupFreq = g2f.get(groupSize);
// Merged records
mergedRecordsCount += groupFreq;
}
}
return mergedRecordsCount;
}
use of org.talend.dataquality.indicators.columnset.RecordMatchingIndicator in project tdq-studio-se by Talend.
the class MatchingKeySection method hideGroups.
public void hideGroups() {
RecordMatchingIndicator recordMatchingIndicator = (RecordMatchingIndicator) analysis.getResults().getIndicators().get(1);
matchRuleChartComp.refresh(recordMatchingIndicator.getGroupSize2groupFrequency());
}
use of org.talend.dataquality.indicators.columnset.RecordMatchingIndicator in project tdq-studio-se by Talend.
the class MatchingKeySection method refreshChart.
public void refreshChart(boolean needCompute) {
if (!hasMatchKey(true)) {
MessageDialogWithToggle.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString("BlockingKeySection.RefreshChartError"), // $NON-NLS-1$ //$NON-NLS-2$
DefaultMessagesImpl.getString("MatchMasterDetailsPage.NoMatchKey"));
return;
}
ReturnCode checkResultStatus = checkResultStatus();
if (!checkResultStatus.isOk()) {
MessageDialogWithToggle.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString("BlockingKeySection.RefreshChartError"), // $NON-NLS-1$
checkResultStatus.getMessage());
return;
}
listeners.firePropertyChange(MatchAnalysisConstant.NEED_REFRESH_DATA, true, false);
List<Object[]> results;
// MOD TDQ-9741: "chart" button will compute, "hide group" will not compute
if (needCompute) {
TypedReturnCode<RecordMatchingIndicator> computeMatchResult = computeMatchResult();
if (!computeMatchResult.isOk()) {
if (computeMatchResult.getMessage() != null && !computeMatchResult.getMessage().equals(StringUtils.EMPTY)) {
MessageDialogWithToggle.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString("RunAnalysisAction.runAnalysis"), // $NON-NLS-1$
computeMatchResult.getMessage());
}
return;
}
RecordMatchingIndicator recordMatchingIndicator = computeMatchResult.getObject();
matchRuleChartComp.refresh(recordMatchingIndicator.getGroupSize2groupFrequency());
// sort the result before refresh
results = MatchRuleAnlaysisUtils.sortResultByGID(recordMatchingIndicator.getMatchRowSchema(), this.getTableResult());
} else {
// for "hide group" , get the result from the last "chart" directly.
matchRuleChartComp.refresh(getChartResult());
results = getTableResult();
}
// refresh related table
MatchRuleAnlaysisUtils.refreshDataTable(analysis, results);
// Clear the match row data.
matchRows.clear();
}
use of org.talend.dataquality.indicators.columnset.RecordMatchingIndicator in project tdq-studio-se by Talend.
the class MatchRuleAnlaysisUtils method getNeedIndicatorFromAna.
/**
* Get recording matching indicator and Blocking Indicator from analysis
*
* @param analysis
* @return the index 0 will be RecordMatchingIndicator and index 1 will be BlockKeyIndicator
*/
public static Object[] getNeedIndicatorFromAna(Analysis analysis) {
Object[] returnList = new Object[2];
EList<Indicator> indicators = analysis.getResults().getIndicators();
for (Indicator ind : indicators) {
if (ind instanceof RecordMatchingIndicator) {
returnList[0] = ind;
} else if (ind instanceof BlockKeyIndicator) {
returnList[1] = ind;
}
}
// If match rule definition is null, create a default.
if (returnList[0] == null) {
returnList[0] = ColumnsetPackage.eINSTANCE.getColumnsetFactory().createRecordMatchingIndicator();
}
// If blocking key indicator is nul, create a default.
if (returnList[1] == null) {
returnList[1] = ColumnsetPackage.eINSTANCE.getColumnsetFactory().createBlockKeyIndicator();
}
return returnList;
}
Aggregations