Kaynağa Gözat

first commit

placidenduwayo 2 yıl önce
ebeveyn
işleme
b2c0a45821

+ 1
- 1
src/main/scala/fr/natan/akkastreamfileprocessingapi/service/AkkaStreamFileProcessingImpl.scala Dosyayı Görüntüle

@@ -142,7 +142,7 @@ class AkkaStreamFileProcessingImpl extends AkkaStreamFileProcessingFuture {
142 142
     tvSerieIdFuture.andThen({
143 143
       case Failure(exception) => logger.error(s"${exception.printStackTrace()}")
144 144
       case Success(value: Option[String]) =>
145
-        logger.info(s"${value.get}")
145
+        logger.info(s"TvSerie ID${value.get}")
146 146
         logger.info(s"STEP 1/3 END, elapsed time:${(System.currentTimeMillis() - start1) / 1000} sec")
147 147
 
148 148
     })

+ 0
- 9
src/main/scala/fr/natan/akkastreamfileprocessingapi/service/UtilitiesClass.scala Dosyayı Görüntüle

@@ -3,15 +3,12 @@ package fr.natan.akkastreamfileprocessingapi.service
3 3
 import akka.NotUsed
4 4
 import akka.stream.scaladsl.{Flow, Sink, Source}
5 5
 import com.typesafe.scalalogging.slf4j.Logger
6
-import fr.natan.akkastreamfileprocessingapi.businessexceptions.TvSerieNotFoundException
7 6
 import fr.natan.akkastreamfileprocessingapi.models.ModelsAndJsonMap.Person
8 7
 import fr.natan.akkastreamfileprocessingapi.models.ModelsBuilder.buildPersonModel
9 8
 import fr.natan.akkastreamfileprocessingapi.service.AkkaStreamComponents.{actorSystem, buildAndValidateSource}
10 9
 
11 10
 import java.io.File
12
-import scala.concurrent.ExecutionContext.Implicits.global
13 11
 import scala.concurrent.Future
14
-import scala.util.{Failure, Success}
15 12
 
16 13
 object UtilitiesClass {
17 14
 
@@ -72,12 +69,6 @@ object UtilitiesClass {
72 69
       .map(row => row.get("tconst"))
73 70
       .runWith(Sink.head)
74 71
 
75
-    tvSerieIdFuture.onComplete({
76
-      case Failure(noSuchElementException: NoSuchElementException) => throw new TvSerieNotFoundException()
77
-      case Failure(exception: Exception) => throw new RuntimeException()
78
-      case Success(value) => logger.info(s"$value")
79
-    })
80
-
81 72
     tvSerieIdFuture
82 73
   }
83 74
 

Powered by TurnKey Linux.