-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/performant old filmlist reader #150
base: develop
Are you sure you want to change the base?
Conversation
SonarCloud Quality Gate failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't had the time to have a look at the unit tests. I will do it later.
@@ -352,7 +337,7 @@ | |||
<plugin> | |||
<groupId>org.sonatype.plugins</groupId> | |||
<artifactId>nexus-staging-maven-plugin</artifactId> | |||
<version>${nexus-staging-maven-plugin.version}</version> | |||
<version>1.6.8</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't do it for the plugins inside the profile. When I do it the version is missing.
@@ -363,7 +348,7 @@ | |||
<plugin> | |||
<groupId>org.apache.maven.plugins</groupId> | |||
<artifactId>maven-gpg-plugin</artifactId> | |||
<version>${maven-gpg-plugin.version}</version> | |||
<version>3.0.1</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the one before, its inside the profile so I can't do
} catch (final Exception exception) { | ||
LOG.debug( | ||
String.format("Error on converting the following text to a film:%n %s ", splittedEntry)); | ||
return Optional.of(RawFilmToFilmMapper.INSTANCE.rawFilmToFilm(rawFilm, rawFilm)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use DI from Spring instead of using the INSTANCE variable here. Please inject the mapper and just use it. It is possible that you have to define the generating component model within your mapper (https://mapstruct.org/documentation/stable/reference/html/#using-dependency-injection)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its the MLib which isn't a spring application. I just use the spring boot parent for the dependency versions.
|
||
private UUID toListId(String entryPart) { | ||
try { | ||
String rawUUID = entryPart.replaceFirst("\"].*", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant with the regex. If you want let's talk about that method.
LocalTime.parse(dateTimeSplitted[1], TIME_FORMATTER)); | ||
} | ||
|
||
private String clearField(String rawField) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A whole method that could be a regex
import static java.time.format.FormatStyle.MEDIUM; | ||
|
||
@Mapper | ||
public interface RawFilmToFilmMapper { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, lets talk about the mapper :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :)
@@ -1,6 +1,13 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.springframework.boot</groupId> | |||
<artifactId>spring-boot-starter-parent</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wieso Spring Boot? wird doch in MLib gar nicht verwendet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im spring Boot parent sind für viele Abhängigkeiten die Versionen aufeinander abgestimmt und getestet. Wenn wir den, wie hier von mir getan, nutzen müssen wir uns nicht um Kompatibilität einzelner Versionen zueinander kümmern. Zum updaten von dependencies können wir so auch "einfach" die Spring version erhöhen und müssen uns dann nur noch um die zusätzlichen Deps kümmern.
LocalTime.parse(dateTimeSplitted[1], TIME_FORMATTER)); | ||
} | ||
|
||
private String clearField(String rawField) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming: was bereinigt die Methode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guter Hinweis
@@ -9,7 +9,7 @@ | |||
|
|||
import java.io.IOException; | |||
|
|||
import static jakarta.ws.rs.core.HttpHeaders.CONTENT_LENGTH; | |||
import static javax.ws.rs.core.HttpHeaders.CONTENT_LENGTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MServer verwendet die jakarta-Variante, keine Ahnung ob das im Zusammenspiel mit MLib problematisch werden könnte. Warum wieder zurück zur "alten" Variante?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependency Version hat sich geändert und da sind die Pfade noch so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also wrote some findings to Discord.
|
||
@Mapper | ||
public interface RawFilmToFilmMapper { | ||
Logger LOG = LogManager.getLogger(RawFilmToFilmMapper.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use @slf4j when you already use Lombok instead of self definiton
Film rawFilmToFilm(RawFilm rawFilm); | ||
|
||
default List<GeoLocations> mapGeolocation(RawFilm rawFilm) { | ||
return GeoLocations.find(rawFilm.getGeo()).map(List::of).orElse(new ArrayList<>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return GeoLocations.find(rawFilm.getGeo()).stream().collect(Collectors.toList());
|
||
@AfterMapping | ||
default void complexMappings(RawFilm rawFilm, @MappingTarget Film film) { | ||
long groesse = mapSize(rawFilm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be final
SonarCloud Quality Gate failed. |
Please retry analysis of this Pull-Request directly on SonarCloud. |
In context of the Filmlistmerger I created a new, more performant, reader for the old Filmlist .