Toggle navigation
Toggle navigation
This project
Loading...
Sign in
grogv3
/
grog-cubi
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jean-Francois Leveque
2017-05-04 11:17:58 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
21ed0615c521b5943d1eff6bb40efcbd50a67773
21ed0615
1 parent
334f6d3c
Élimination des multiples de l'ajout dans la liste des utilisateurs.
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/ProcessingRunner.java
grog-recommendation/grog-recommendation-process/src/main/java/org/legrog/recommendation/process/ProcessingRunner.java
View file @
21ed061
...
...
@@ -62,8 +62,12 @@ public class ProcessingRunner implements ApplicationRunner {
try
{
in
=
new
FileReader
(
dataDir
+
sampleFilename
);
Iterable
<
CSVRecord
>
records
=
CSVFormat
.
TDF
.
withFirstRecordAsHeader
().
parse
(
in
);
Long
tmpLong
;
for
(
CSVRecord
record
:
records
)
{
userIds
.
add
(
Long
.
parseLong
(
record
.
get
(
"userId"
)));
tmpLong
=
Long
.
parseLong
(
record
.
get
(
"userId"
));
if
(!
userIds
.
contains
(
tmpLong
))
{
userIds
.
add
(
tmpLong
);
}
}
}
catch
(
FileNotFoundException
e
)
{
throw
new
ProcessingException
(
"sample file not found "
+
dataDir
+
sampleFilename
,
e
);
...
...
@@ -71,6 +75,7 @@ public class ProcessingRunner implements ApplicationRunner {
throw
new
ProcessingException
(
"Can't read user ids from sample file "
+
dataDir
+
sampleFilename
,
e
);
}
logger
.
trace
(
"Nombre d'utilisateurs : {}"
,
userIds
.
size
());
return
userIds
;
}
...
...
Please
register
or
login
to post a comment