Skip to content

Commit

Permalink
Merge branch 'main' into Prefer-MARC-tag-264-over-260
Browse files Browse the repository at this point in the history
  • Loading branch information
StepanBrychta committed Jul 30, 2024
2 parents 3823850 + 33ece34 commit 90927ba
Show file tree
Hide file tree
Showing 136 changed files with 401 additions and 361 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package weco.pipeline.calm_adapter

import akka.Done
import akka.stream.Materializer
import akka.stream.scaladsl._
import org.apache.pekko.Done
import org.apache.pekko.stream.Materializer
import org.apache.pekko.stream.scaladsl._
import grizzled.slf4j.Logging
import software.amazon.awssdk.services.sqs.model.{Message => SQSMessage}
import weco.json.JsonUtil._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package weco.pipeline.calm_adapter

import akka.NotUsed
import akka.stream.scaladsl.Source
import org.apache.pekko.NotUsed
import org.apache.pekko.stream.scaladsl.Source
import grizzled.slf4j.Logging
import weco.catalogue.source_model.calm.CalmRecord
import weco.pipeline.calm_api_client.{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package weco.pipeline.calm_adapter

import scala.concurrent.ExecutionContext
import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import weco.typesafe.WellcomeTypesafeApp
import weco.typesafe.config.builders.EnrichConfig._
import weco.messaging.typesafe.{SNSBuilder, SQSBuilder}
import weco.catalogue.source_model.calm.CalmRecord
import weco.catalogue.source_model.config.SourceVHSBuilder
import weco.catalogue.source_model.Implicits._
import weco.pipeline.calm_api_client.AkkaHttpCalmApiClient
import weco.pipeline.calm_api_client.PekkoHttpCalmApiClient

object Main extends WellcomeTypesafeApp {

Expand All @@ -20,7 +20,7 @@ object Main extends WellcomeTypesafeApp {
actorSystem.dispatcher

val calmRetriever = new ApiCalmRetriever(
apiClient = new AkkaHttpCalmApiClient(
apiClient = new PekkoHttpCalmApiClient(
url = config.requireString("calm.api.url"),
username = config.requireString("calm.api.username"),
password = config.requireString("calm.api.password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<logger name="io.netty" level="OFF"/>
<logger name="com.amazonaws" level="OFF"/>
<logger name="software.amazon.awssdk" level="OFF"/>
<logger name="akka.actor" level="OFF"/>
<logger name="org.apache.pekko.actor" level="OFF"/>
<logger name="com.sksamuel.elastic4s" level="OFF"/>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package weco.pipeline.calm_adapter

import java.time.{Instant, LocalDate}
import akka.NotUsed
import akka.stream.scaladsl._
import org.apache.pekko.NotUsed
import org.apache.pekko.stream.scaladsl._
import io.circe.Encoder
import org.scalatest.EitherValues
import org.scalatest.concurrent.{Eventually, IntegrationPatience}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import weco.akka.fixtures.Akka
import weco.pekko.fixtures.Pekko
import weco.fixtures.TestWith
import weco.json.JsonUtil._
import weco.messaging.fixtures.SQS
Expand Down Expand Up @@ -37,7 +37,7 @@ class CalmAdapterWorkerServiceTest
extends AnyFunSpec
with Matchers
with EitherValues
with Akka
with Pekko
with SQS
with Eventually
with IntegrationPatience
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package weco.pipeline.calm_adapter

import java.time.LocalDate
import akka.http.scaladsl.model.headers._
import akka.stream.scaladsl._
import org.apache.pekko.http.scaladsl.model.headers._
import org.apache.pekko.stream.scaladsl._
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package weco.pipeline.calm_api_client

import akka.Done
import akka.actor.ActorSystem
import akka.http.scaladsl.model._
import akka.http.scaladsl.model.headers.{
import org.apache.pekko.Done
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.http.scaladsl.model._
import org.apache.pekko.http.scaladsl.model.headers.{
BasicHttpCredentials,
Cookie,
RawHeader
}
import akka.stream.{Materializer, RestartSettings}
import org.apache.pekko.stream.{Materializer, RestartSettings}
import weco.catalogue.source_model.calm.CalmRecord
import weco.http.client.{AkkaHttpClient, HttpClient}
import weco.http.client.{HttpClient, PekkoHttpClient}

import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
Expand Down Expand Up @@ -102,7 +102,7 @@ class HttpCalmApiClient(
}
}

class AkkaHttpCalmApiClient(
class PekkoHttpCalmApiClient(
url: String,
username: String,
password: String,
Expand All @@ -112,7 +112,7 @@ class AkkaHttpCalmApiClient(
maxRestarts: Int = 10
)(implicit actorSystem: ActorSystem)
extends HttpCalmApiClient(
client = new AkkaHttpClient(),
client = new PekkoHttpClient(),
url,
username,
password,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package weco.pipeline.calm_api_client

import java.time.Instant

import akka.http.scaladsl.model.{HttpResponse, ResponseEntity}
import akka.http.scaladsl.model.headers.{`Set-Cookie`, Cookie, Date}
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.stream.Materializer
import akka.util.ByteString
import org.apache.pekko.http.scaladsl.model.{HttpResponse, ResponseEntity}
import org.apache.pekko.http.scaladsl.model.headers.{`Set-Cookie`, Cookie, Date}
import org.apache.pekko.http.scaladsl.unmarshalling.Unmarshal
import org.apache.pekko.stream.Materializer
import org.apache.pekko.util.ByteString
import grizzled.slf4j.Logging

import scala.concurrent.{ExecutionContext, Future}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package weco.pipeline.calm_api_client

import akka.http.scaladsl.model.headers.Cookie
import org.apache.pekko.http.scaladsl.model.headers.Cookie

case class CalmSession(numHits: Int, cookie: Cookie)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package weco.pipeline.calm_api_client

import akka.Done
import org.apache.pekko.Done
import weco.catalogue.source_model.calm.CalmRecord

import scala.xml.Elem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import scala.util.Try
import scala.xml.{Elem, Node, NodeSeq, XML}
import java.time.Instant

import akka.Done
import akka.http.scaladsl.model.headers.Cookie
import org.apache.pekko.Done
import org.apache.pekko.http.scaladsl.model.headers.Cookie
import weco.catalogue.source_model.calm.CalmRecord

trait CalmXmlResponse[T] {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package weco.pipeline.calm_api_client

import akka.stream.{Materializer, RestartSettings}
import akka.stream.scaladsl.{RestartSource, Sink, Source}
import org.apache.pekko.stream.{Materializer, RestartSettings}
import org.apache.pekko.stream.scaladsl.{RestartSource, Sink, Source}

import scala.concurrent.Future
import scala.concurrent.duration._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package weco.pipeline.calm_api_client

import java.time.LocalDate
import akka.Done
import akka.http.scaladsl.model.HttpResponse
import akka.http.scaladsl.model.headers.{
import org.apache.pekko.Done
import org.apache.pekko.http.scaladsl.model.HttpResponse
import org.apache.pekko.http.scaladsl.model.headers.{
Authorization,
BasicHttpCredentials,
Cookie,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import java.time.Instant

import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import akka.http.scaladsl.model.headers.{Cookie, HttpCookiePair}
import org.apache.pekko.http.scaladsl.model.headers.{Cookie, HttpCookiePair}
import weco.catalogue.source_model.calm.CalmRecord

class CalmXmlResponseTest extends AnyFunSpec with Matchers {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package weco.pipeline.calm_api_client

import akka.stream.RestartSettings
import org.apache.pekko.stream.RestartSettings
import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures}
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
import weco.akka.fixtures.Akka
import weco.pekko.fixtures.Pekko

import scala.concurrent.duration._
import scala.concurrent.Future
Expand All @@ -13,7 +13,7 @@ class RetryFutureTest
extends AnyFunSpec
with Matchers
with ScalaFutures
with Akka
with Pekko
with IntegrationPatience {

val maxRetries = 5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package weco.pipeline.calm_api_client.fixtures

import akka.Done
import akka.http.scaladsl.model.headers.Cookie
import akka.http.scaladsl.model.{HttpRequest, HttpResponse}
import akka.stream.Materializer
import weco.akka.fixtures.Akka
import org.apache.pekko.Done
import org.apache.pekko.http.scaladsl.model.headers.Cookie
import org.apache.pekko.http.scaladsl.model.{HttpRequest, HttpResponse}
import org.apache.pekko.stream.Materializer
import weco.pekko.fixtures.Pekko
import weco.fixtures.TestWith
import weco.pipeline.calm_api_client._
import weco.catalogue.source_model.calm.CalmRecord
Expand All @@ -25,7 +25,7 @@ import scala.concurrent.{ExecutionContext, Future}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._

trait CalmApiClientFixtures extends Akka {
trait CalmApiClientFixtures extends Pekko {
val url = "calm.api"
val username = "calm-user"
val password = "calm-password"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package weco.pipeline.calm_api_client.fixtures

import java.time.Instant

import akka.http.scaladsl.model.{DateTime, HttpProtocols, HttpResponse}
import akka.http.scaladsl.model.headers.{`Set-Cookie`, Date, HttpCookie}
import org.apache.pekko.http.scaladsl.model.{DateTime, HttpProtocols, HttpResponse}
import org.apache.pekko.http.scaladsl.model.headers.{`Set-Cookie`, Date, HttpCookie}

import scala.xml.XML

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package weco.pipeline.calm_deletion_checker

import akka.Done
import akka.stream.scaladsl.{Flow, Keep}
import org.apache.pekko.Done
import org.apache.pekko.stream.scaladsl.{Flow, Keep}
import software.amazon.awssdk.services.sqs.model.Message
import weco.messaging.MessageSender
import weco.messaging.sns.NotificationMessage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package weco.pipeline.calm_deletion_checker

import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import software.amazon.awssdk.services.dynamodb.DynamoDbClient
import weco.messaging.typesafe.{SNSBuilder, SQSBuilder}
import weco.storage.typesafe.DynamoBuilder
import weco.typesafe.WellcomeTypesafeApp
import weco.typesafe.config.builders.EnrichConfig._
import weco.pipeline.calm_api_client.AkkaHttpCalmApiClient
import weco.pipeline.calm_api_client.PekkoHttpCalmApiClient

import scala.concurrent.ExecutionContext

Expand All @@ -28,7 +28,7 @@ object Main extends WellcomeTypesafeApp {
messageSender = SNSBuilder
.buildSNSMessageSender(config, subject = "CALM deletion checker"),
markDeleted = new DeletionMarker(dynamoConfig.tableName),
calmApiClient = new AkkaHttpCalmApiClient(
calmApiClient = new PekkoHttpCalmApiClient(
url = config.requireString("calm.api.url"),
username = config.requireString("calm.api.username"),
password = config.requireString("calm.api.password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<logger name="io.netty" level="OFF"/>
<logger name="com.amazonaws" level="OFF"/>
<logger name="software.amazon.awssdk" level="OFF"/>
<logger name="akka.actor" level="OFF"/>
<logger name="org.apache.pekko.actor" level="OFF"/>
<logger name="com.sksamuel.elastic4s" level="OFF"/>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package weco.pipeline.calm_deletion_checker

import java.util.concurrent.ConcurrentHashMap
import akka.Done
import akka.http.scaladsl.model.headers.Cookie
import org.apache.pekko.Done
import org.apache.pekko.http.scaladsl.model.headers.Cookie
import org.scalacheck.{Gen, Shrink}
import org.scalatest.concurrent.{PatienceConfiguration, ScalaFutures}
import org.scalatest.funspec.AnyFunSpec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package weco.pipeline.calm_deletion_checker

import akka.Done
import akka.http.scaladsl.model.headers.Cookie
import org.apache.pekko.Done
import org.apache.pekko.http.scaladsl.model.headers.Cookie
import org.scalatest.EitherValues
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package weco.pipeline.calm_indexer

import akka.actor.ActorSystem
import org.apache.pekko.actor.ActorSystem
import com.sksamuel.elastic4s.{ElasticClient, Index}
import software.amazon.awssdk.services.s3.S3Client
import weco.catalogue.source_model.calm.CalmRecord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<logger name="io.netty" level="OFF"/>
<logger name="com.amazonaws" level="OFF"/>
<logger name="software.amazon.awssdk" level="OFF"/>
<logger name="akka.actor" level="OFF"/>
<logger name="org.apache.pekko.actor" level="OFF"/>
<logger name="com.sksamuel.elastic4s" level="OFF"/>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.sksamuel.elastic4s.requests.get.GetResponse
import com.sksamuel.elastic4s.{Index, Response}
import org.scalatest.concurrent.{Eventually, IntegrationPatience}
import org.scalatest.{Assertion, Suite}
import weco.akka.fixtures.Akka
import weco.pekko.fixtures.Pekko
import weco.catalogue.source_model.calm.CalmRecord
import weco.elasticsearch.test.fixtures.ElasticsearchFixtures
import weco.fixtures.TestWith
Expand All @@ -22,7 +22,7 @@ trait IndexerFixtures
extends ElasticsearchFixtures
with Eventually
with IntegrationPatience
with Akka
with Pekko
with SQS { this: Suite =>
def withWorker[R](
queue: Queue,
Expand Down
6 changes: 3 additions & 3 deletions common/flows/src/main/scala/weco/flows/FlowOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package weco.flows
import grizzled.slf4j.Logging

import scala.concurrent.{ExecutionContext, Future}
import akka.NotUsed
import akka.stream.FlowShape
import akka.stream.scaladsl.{Broadcast, Flow, GraphDSL, Merge}
import org.apache.pekko.NotUsed
import org.apache.pekko.stream.FlowShape
import org.apache.pekko.stream.scaladsl.{Broadcast, Flow, GraphDSL, Merge}

trait FlowOps extends Logging {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package weco.pipeline_storage

import akka.stream.scaladsl.Flow
import akka.{Done, NotUsed}
import org.apache.pekko.stream.scaladsl.Flow
import org.apache.pekko.{Done, NotUsed}
import grizzled.slf4j.Logging
import io.circe.Decoder
import software.amazon.awssdk.services.sqs.model.Message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<logger name="io.netty" level="OFF"/>
<logger name="com.amazonaws" level="OFF"/>
<logger name="software.amazon.awssdk" level="OFF"/>
<logger name="akka.actor" level="OFF"/>
<logger name="org.apache.pekko.actor" level="OFF"/>
<logger name="com.sksamuel.elastic4s" level="OFF"/>
</configuration>
Loading

0 comments on commit 90927ba

Please sign in to comment.