Skip to content

Commit fd18347

Browse files
Addressing reviewer's comments
1 parent aafa1f2 commit fd18347

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/main/java/edu/ie3/datamodel/io/source/influxdb/InfluxDbWeatherSource.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ public class InfluxDbWeatherSource implements WeatherSource {
3232
private static final String COORDINATE_ID_COLUMN_NAME = "coordinate_id";
3333
private static final int MILLI_TO_NANO_FACTOR = 1000000;
3434

35-
/* Final name of the coordinate id field for use in factories */
36-
private final String coordinateIdFieldName;
37-
/* Final name of the column within the database */
3835
private final InfluxDbConnector connector;
3936
private final IdCoordinateSource coordinateSource;
4037
private final TimeBasedWeatherValueFactory weatherValueFactory;
@@ -54,7 +51,6 @@ public InfluxDbWeatherSource(
5451
this.connector = connector;
5552
this.coordinateSource = coordinateSource;
5653
this.weatherValueFactory = weatherValueFactory;
57-
this.coordinateIdFieldName = weatherValueFactory.getCoordinateIdFieldString();
5854
}
5955

6056
@Override
@@ -145,14 +141,15 @@ public Optional<TimeBasedValue<WeatherValue>> getWeather(ZonedDateTime date, Poi
145141
}
146142

147143
/**
148-
* Parses an influxQL QueryResult and then transforms them into a Stream of optional
149-
* TimeBasedValue&lt;WeatherValue&gt;, with a present Optional value, if the transformation was
150-
* successful and an empty optional otherwise.
144+
* Parses an influxQL QueryResult and then transforms it into a Stream of optional
145+
* TimeBasedValue&lt;WeatherValue&gt;, with a present Optional value if the transformation was
146+
* successful and an empty Optional otherwise.
151147
*/
152148
private Stream<Optional<TimeBasedValue<WeatherValue>>> optTimeBasedValueStream(
153149
QueryResult queryResult) {
154150
Map<String, Set<Map<String, String>>> measurementsMap =
155151
InfluxDbConnector.parseQueryResult(queryResult, MEASUREMENT_NAME_WEATHER);
152+
final String coordinateIdFieldName = weatherValueFactory.getCoordinateIdFieldString();
156153
return measurementsMap.get(MEASUREMENT_NAME_WEATHER).stream()
157154
.map(
158155
fieldToValue -> {

0 commit comments

Comments
 (0)