mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 20:13:52 +00:00
Removed unneeded GPSFixStore usage
This commit is contained in:
1 parent
affa598f1a
commit
9416f5deed
42 files changed
+130
-186
No files matched your search
@@ -61,7 +61,6 @@ import com.sap.sailing.domain.leaderboard.ScoringScheme;
|
||||
import com.sap.sailing.domain.persistence.DomainObjectFactory;
|
||||
import com.sap.sailing.domain.persistence.MongoObjectFactory;
|
||||
import com.sap.sailing.domain.polars.PolarDataService;
|
||||
import com.sap.sailing.domain.racelog.tracking.GPSFixStore;
|
||||
import com.sap.sailing.domain.racelog.tracking.SensorFixStore;
|
||||
import com.sap.sailing.domain.ranking.RankingMetricConstructor;
|
||||
import com.sap.sailing.domain.regattalike.LeaderboardThatHasRegattaLike;
|
||||
@@ -304,7 +303,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
|
||||
*/
|
||||
void updateStoredLeaderboardGroup(LeaderboardGroup leaderboardGroup);
|
||||
|
||||
DynamicTrackedRace createTrackedRace(RegattaAndRaceIdentifier raceIdentifier, WindStore windStore, GPSFixStore gpsFixStore,
|
||||
DynamicTrackedRace createTrackedRace(RegattaAndRaceIdentifier raceIdentifier, WindStore windStore,
|
||||
long delayToLiveInMillis, long millisecondsOverWhichToAverageWind, long millisecondsOverWhichToAverageSpeed, boolean useMarkPassingCalculator);
|
||||
|
||||
Regatta getOrCreateDefaultRegatta(String name, String boatClassName, Serializable id);
|
||||
@@ -532,8 +531,6 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
|
||||
PolarDataService getPolarDataService();
|
||||
|
||||
SimulationService getSimulationService();
|
||||
|
||||
GPSFixStore getGPSFixStore();
|
||||
|
||||
SensorFixStore getSensorFixStore();
|
||||
|
||||
|
||||
+5
-23
@@ -136,8 +136,6 @@ import com.sap.sailing.domain.persistence.racelog.tracking.MongoSensorFixStoreFa
|
||||
import com.sap.sailing.domain.polars.PolarDataService;
|
||||
import com.sap.sailing.domain.racelog.RaceLogIdentifier;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStore;
|
||||
import com.sap.sailing.domain.racelog.impl.GPSFixStoreImpl;
|
||||
import com.sap.sailing.domain.racelog.tracking.GPSFixStore;
|
||||
import com.sap.sailing.domain.racelog.tracking.SensorFixStore;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sailing.domain.ranking.RankingMetric.CompetitorRankingInfo;
|
||||
@@ -369,7 +367,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
protected final DeviceConfigurationMapImpl configurationMap;
|
||||
|
||||
private final WindStore windStore;
|
||||
private final GPSFixStore gpsFixStore;
|
||||
private final SensorFixStore sensorFixStore;
|
||||
|
||||
/**
|
||||
@@ -608,12 +605,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
try {
|
||||
this.gpsFixStore = new GPSFixStoreImpl(this.sensorFixStore);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
this.configurationMap = new DeviceConfigurationMapImpl();
|
||||
this.serviceFinderFactory = serviceFinderFactory;
|
||||
|
||||
@@ -1371,10 +1363,10 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
Regatta regatta = regattaToAddTo == null ? null : getRegatta(regattaToAddTo);
|
||||
if (regatta == null) {
|
||||
// create tracker and use an existing or create a default regatta
|
||||
tracker = params.createRaceTracker(this, windStore, gpsFixStore, /* raceLogResolver */ this);
|
||||
tracker = params.createRaceTracker(this, windStore, /* raceLogResolver */ this);
|
||||
} else {
|
||||
// use the regatta selected by the RaceIdentifier regattaToAddTo
|
||||
tracker = params.createRaceTracker(regatta, this, windStore, gpsFixStore, /* raceLogResolver */ this);
|
||||
tracker = params.createRaceTracker(regatta, this, windStore, /* raceLogResolver */ this);
|
||||
assert tracker.getRegatta() == regatta;
|
||||
}
|
||||
LockUtil.lockForWrite(raceTrackersByRegattaLock);
|
||||
@@ -1421,11 +1413,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
logger.warning("Wind store mismatch. Requested wind store: " + windStore
|
||||
+ ". Wind store in use by existing tracker: " + existingTrackersWindStore);
|
||||
}
|
||||
GPSFixStore existingTrackersGPSFixStore = tracker.getGPSFixStore();
|
||||
if (!existingTrackersGPSFixStore.equals(gpsFixStore)) {
|
||||
logger.warning("GPSFix store mismatch. Requested GPSFix store: " + gpsFixStore
|
||||
+ ". GPSFix store in use by existing tracker: " + existingTrackersGPSFixStore);
|
||||
}
|
||||
}
|
||||
if (timeoutInMilliseconds != -1) {
|
||||
scheduleAbortTrackerAfterInitialTimeout(tracker, timeoutInMilliseconds);
|
||||
@@ -1512,11 +1499,11 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
|
||||
@Override
|
||||
public DynamicTrackedRace createTrackedRace(RegattaAndRaceIdentifier raceIdentifier, WindStore windStore,
|
||||
GPSFixStore gpsFixStore, long delayToLiveInMillis, long millisecondsOverWhichToAverageWind,
|
||||
long delayToLiveInMillis, long millisecondsOverWhichToAverageWind,
|
||||
long millisecondsOverWhichToAverageSpeed, boolean useMarkPassingCalculator) {
|
||||
DynamicTrackedRegatta trackedRegatta = getOrCreateTrackedRegatta(getRegatta(raceIdentifier));
|
||||
RaceDefinition race = getRace(raceIdentifier);
|
||||
return trackedRegatta.createTrackedRace(race, Collections.<Sideline> emptyList(), windStore, gpsFixStore,
|
||||
return trackedRegatta.createTrackedRace(race, Collections.<Sideline> emptyList(), windStore,
|
||||
delayToLiveInMillis, millisecondsOverWhichToAverageWind, millisecondsOverWhichToAverageSpeed,
|
||||
/* raceDefinitionSetToUpdate */null, useMarkPassingCalculator, /* raceLogResolver */ this);
|
||||
}
|
||||
@@ -3054,11 +3041,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GPSFixStore getGPSFixStore() {
|
||||
return gpsFixStore;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SensorFixStore getSensorFixStore() {
|
||||
return sensorFixStore;
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.base.Regatta;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
import com.sap.sailing.domain.tracking.TrackedRegatta;
|
||||
@@ -64,7 +63,7 @@ public class CreateTrackedRace extends AbstractRaceOperation<DynamicTrackedRace>
|
||||
@Override
|
||||
public DynamicTrackedRace internalApplyTo(RacingEventService toState) {
|
||||
return toState.createTrackedRace(getRaceIdentifier(), windStore == null ? EmptyWindStore.INSTANCE : windStore,
|
||||
EmptyGPSFixStore.INSTANCE, delayToLiveInMillis, millisecondsOverWhichToAverageWind,
|
||||
delayToLiveInMillis, millisecondsOverWhichToAverageWind,
|
||||
millisecondsOverWhichToAverageSpeed, /* useMarkPassingCalculator */ false);
|
||||
// no separate mark passing calculations in replica;
|
||||
// Mark passings are computed on master and are replicated separately.
|
||||
|
||||
+3
-4
@@ -31,7 +31,6 @@ import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.Wind;
|
||||
import com.sap.sailing.domain.common.impl.MasterDataImportObjectCreationCountImpl;
|
||||
import com.sap.sailing.domain.common.racelog.tracking.TransformationException;
|
||||
import com.sap.sailing.domain.common.tracking.GPSFix;
|
||||
import com.sap.sailing.domain.common.tracking.impl.CompactGPSFixImpl;
|
||||
import com.sap.sailing.domain.common.tracking.impl.CompactGPSFixMovingImpl;
|
||||
@@ -49,7 +48,7 @@ import com.sap.sailing.domain.persistence.MongoRaceLogStoreFactory;
|
||||
import com.sap.sailing.domain.persistence.MongoRegattaLogStoreFactory;
|
||||
import com.sap.sailing.domain.racelog.RaceLogIdentifier;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStore;
|
||||
import com.sap.sailing.domain.racelog.tracking.GPSFixStore;
|
||||
import com.sap.sailing.domain.racelog.tracking.SensorFixStore;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sailing.domain.regattalike.HasRegattaLike;
|
||||
import com.sap.sailing.domain.regattalike.IsRegattaLike;
|
||||
@@ -403,7 +402,7 @@ public class ImportMasterDataOperation extends
|
||||
private void importRaceLogTrackingGPSFixes(RacingEventService toState) {
|
||||
Map<DeviceIdentifier, Set<GPSFix>> raceLogTrackingFixes = masterData.getRaceLogTrackingFixes();
|
||||
if (raceLogTrackingFixes != null) {
|
||||
GPSFixStore store = toState.getGPSFixStore();
|
||||
SensorFixStore store = toState.getSensorFixStore();
|
||||
for (Entry<DeviceIdentifier, Set<GPSFix>> entry : raceLogTrackingFixes.entrySet()) {
|
||||
DeviceIdentifier device = entry.getKey();
|
||||
for (GPSFix fixToAdd : entry.getValue()) {
|
||||
@@ -415,7 +414,7 @@ public class ImportMasterDataOperation extends
|
||||
fixToAdd = new GPSFixImpl(fixToAdd.getPosition(), fixToAdd.getTimePoint());
|
||||
}
|
||||
store.storeFix(device, fixToAdd);
|
||||
} catch (TransformationException | NoCorrespondingServiceRegisteredException e) {
|
||||
} catch (NoCorrespondingServiceRegisteredException e) {
|
||||
logger.severe("Failed to store race log tracking fix while importing.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user