mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-15 14:56:41 +00:00
Fixed the starting issues of the data mining component
This commit is contained in:
1 parent
5601a00b4e
commit
cbb8c322f8
9 files changed
+26
-22
No files matched your search
+1
-2
@@ -4,13 +4,12 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gwt.i18n.client.LocaleInfo;
|
||||
import com.sap.sse.datamining.components.AggregatorType;
|
||||
import com.sap.sse.datamining.components.GrouperType;
|
||||
|
||||
public interface QueryDefinition extends Serializable {
|
||||
|
||||
public LocaleInfo getLocaleInfo();
|
||||
public String getLocaleInfoName();
|
||||
|
||||
public GrouperType getGrouperType();
|
||||
|
||||
|
||||
+6
-7
@@ -6,7 +6,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gwt.i18n.client.LocaleInfo;
|
||||
import com.sap.sailing.datamining.shared.DataTypes;
|
||||
import com.sap.sailing.datamining.shared.DimensionIdentifier;
|
||||
import com.sap.sailing.datamining.shared.QueryDefinition;
|
||||
@@ -15,9 +14,9 @@ import com.sap.sse.datamining.components.AggregatorType;
|
||||
import com.sap.sse.datamining.components.GrouperType;
|
||||
|
||||
public class SimpleQueryDefinition implements QueryDefinition {
|
||||
private static final long serialVersionUID = 3476324726640558091L;
|
||||
private static final long serialVersionUID = 8408302866342877839L;
|
||||
|
||||
private LocaleInfo localeInfo;
|
||||
private String localeInfoName;
|
||||
|
||||
private GrouperType grouperType;
|
||||
private StatisticType statisticType;
|
||||
@@ -33,8 +32,8 @@ public class SimpleQueryDefinition implements QueryDefinition {
|
||||
@Deprecated
|
||||
SimpleQueryDefinition() { }
|
||||
|
||||
public SimpleQueryDefinition(LocaleInfo localeInfo, GrouperType grouperType, StatisticType statisticType, AggregatorType aggregatorType, DataTypes dataType) {
|
||||
this.localeInfo = localeInfo;
|
||||
public SimpleQueryDefinition(String localeInfoName, GrouperType grouperType, StatisticType statisticType, AggregatorType aggregatorType, DataTypes dataType) {
|
||||
this.localeInfoName = localeInfoName;
|
||||
this.grouperType = grouperType;
|
||||
this.statisticType = statisticType;
|
||||
this.aggregatorType = aggregatorType;
|
||||
@@ -45,8 +44,8 @@ public class SimpleQueryDefinition implements QueryDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public LocaleInfo getLocaleInfo() {
|
||||
return localeInfo;
|
||||
public String getLocaleInfoName() {
|
||||
return localeInfoName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-4
@@ -4,7 +4,6 @@ import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gwt.i18n.client.LocaleInfo;
|
||||
import com.sap.sailing.datamining.shared.QueryDefinition;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.datamining.Query;
|
||||
@@ -34,7 +33,7 @@ public final class DataMiningFactory {
|
||||
|
||||
public static <DataType, AggregatedType extends Number> Query<AggregatedType> createQuery(
|
||||
QueryDefinition queryDefinition, RacingEventService racingService) {
|
||||
Locale locale = getLocaleFrom(queryDefinition.getLocaleInfo());
|
||||
Locale locale = getLocaleFrom(queryDefinition.getLocaleInfoName());
|
||||
|
||||
ParallelDataRetriever<DataType> retriever = DataRetrieverFactory.createDataRetriever(
|
||||
queryDefinition.getDataType(), racingService, DataMiningActivator.getExecutor());
|
||||
@@ -54,8 +53,8 @@ public final class DataMiningFactory {
|
||||
retriever, filter, grouper, extractor, aggregator);
|
||||
}
|
||||
|
||||
private static Locale getLocaleFrom(LocaleInfo localeInfo) {
|
||||
Locale locale = supportedLocalesMappedByLocaleInfo.get(localeInfo.getLocaleName());
|
||||
private static Locale getLocaleFrom(String localeInfoName) {
|
||||
Locale locale = supportedLocalesMappedByLocaleInfo.get(localeInfoName);
|
||||
return locale != null ? locale : supportedLocalesMappedByLocaleInfo.get(DEFAULT_LOCALE_NAME);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public class DataMiningEntryPoint extends AbstractEntryPoint {
|
||||
queryDefinitionProviderWithControls.addControl(queryRunner.getEntryWidget());
|
||||
queryDefinitionProviderWithControls.addControl(createSettingsControlWidget(queryRunner, queryDefinitionProvider));
|
||||
|
||||
SimpleQueryDefinition queryDefinition = new SimpleQueryDefinition(LocaleInfo.getCurrentLocale(), GrouperType.Dimensions, StatisticType.Speed, AggregatorType.Average, DataTypes.GPSFix);
|
||||
SimpleQueryDefinition queryDefinition = new SimpleQueryDefinition(LocaleInfo.getCurrentLocale().getLocaleName(), GrouperType.Dimensions, StatisticType.Speed, AggregatorType.Average, DataTypes.GPSFix);
|
||||
queryDefinition.appendDimensionToGroupBy(DimensionIdentifier.RegattaName);
|
||||
queryDefinitionProvider.applyQueryDefinition(queryDefinition);
|
||||
queryRunner.run(queryDefinitionProvider.getQueryDefinition());
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public class QueryDefinitionProviderWithControls extends AbstractQueryDefinition
|
||||
|
||||
@Override
|
||||
public QueryDefinition getQueryDefinition() {
|
||||
SimpleQueryDefinition queryDTO = new SimpleQueryDefinition(LocaleInfo.getCurrentLocale(), groupBySelectionPanel.getGrouperType(),
|
||||
SimpleQueryDefinition queryDTO = new SimpleQueryDefinition(LocaleInfo.getCurrentLocale().getLocaleName(), groupBySelectionPanel.getGrouperType(),
|
||||
statisticProvider.getStatisticType(), statisticProvider.getAggregatorType(),
|
||||
statisticProvider.getDataType());
|
||||
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
package com.sap.sse.datamining.shared;
|
||||
|
||||
public interface AdditionalResultData {
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface AdditionalResultData extends Serializable {
|
||||
|
||||
public int getRetrievedDataAmount();
|
||||
|
||||
|
||||
+9
-2
@@ -4,14 +4,21 @@ import com.sap.sse.datamining.shared.AdditionalResultData;
|
||||
import com.sap.sse.datamining.shared.Unit;
|
||||
|
||||
public class AdditionalResultDataImpl implements AdditionalResultData {
|
||||
|
||||
private final int retrievedDataAmount;
|
||||
private static final long serialVersionUID = -9054872418326676943L;
|
||||
|
||||
private int retrievedDataAmount;
|
||||
private int filteredDataAmount;
|
||||
private String resultSignifier;
|
||||
private Unit unit;
|
||||
private int valueDecimals;
|
||||
private long calculationTimeInNanos;
|
||||
|
||||
/**
|
||||
* Constructor for the GWT-Serialization. Don't use this!
|
||||
*/
|
||||
@Deprecated
|
||||
AdditionalResultDataImpl() { }
|
||||
|
||||
public AdditionalResultDataImpl(int retrievedDataAmount, int filteredDataAmount, String resultSignifier, Unit unit, int valueDecimals,
|
||||
long calculationTimeInNanos) {
|
||||
this.retrievedDataAmount = retrievedDataAmount;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.sap.sse.datamining.shared.QueryResult;
|
||||
import com.sap.sse.datamining.shared.Unit;
|
||||
|
||||
public class QueryResultImpl<AggregatedType> implements QueryResult<AggregatedType> {
|
||||
private static final long serialVersionUID = -8347731622150585715L;
|
||||
private static final long serialVersionUID = 5173796619174827696L;
|
||||
|
||||
private Map<GroupKey, AggregatedType> results;
|
||||
private AdditionalResultData additionalData;
|
||||
|
||||
+1
-3
@@ -1,11 +1,9 @@
|
||||
package com.sap.sse.datamining.impl.components.deprecated;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import com.sap.sse.datamining.components.ParallelAggregator;
|
||||
@@ -52,7 +50,7 @@ public class GroupDividingParallelAggregator<ExtractedType, AggregatedType> exte
|
||||
for (Map<GroupKey, AggregatedType> result : getResults()) {
|
||||
data.putAll(result);
|
||||
}
|
||||
return Collections.unmodifiableMap(new ConcurrentHashMap<GroupKey, AggregatedType>(data));
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user