Skip to content
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

refactor: Separate ontology helpers accessing cache and triplestore #3270

Merged
merged 24 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ import org.knora.webapi.responders.IriService
import org.knora.webapi.responders.admin.*
import org.knora.webapi.responders.v2.*
import org.knora.webapi.responders.v2.ontology.CardinalityHandler
import org.knora.webapi.responders.v2.ontology.OntologyHelpers
import org.knora.webapi.responders.v2.ontology.OntologyHelpersLive
import org.knora.webapi.responders.v2.ontology.OntologyCacheHelpers
import org.knora.webapi.responders.v2.ontology.OntologyCacheHelpersLive
import org.knora.webapi.responders.v2.ontology.OntologyTriplestoreHelpers
import org.knora.webapi.responders.v2.ontology.OntologyTriplestoreHelpersLive
import org.knora.webapi.routing.*
import org.knora.webapi.slice.admin.AdminModule
import org.knora.webapi.slice.admin.api.*
Expand Down Expand Up @@ -111,10 +113,11 @@ object LayersTest {
ListsResponder &
MessageRelay &
OntologyCache &
OntologyHelpers &
OntologyCacheHelpers &
OntologyInferencer &
OntologyRepo &
OntologyService &
OntologyTriplestoreHelpers &
PermissionRestService &
PermissionUtilADM &
PermissionsResponder &
Expand Down Expand Up @@ -175,9 +178,10 @@ object LayersTest {
ManagementRoutes.layer,
MessageRelayLive.layer,
OntologyCacheLive.layer,
OntologyHelpersLive.layer,
OntologyCacheHelpersLive.layer,
OntologyRepoLive.layer,
OntologyServiceLive.layer,
OntologyTriplestoreHelpersLive.layer,
PermissionUtilADMLive.layer,
PermissionsResponder.layer,
PredicateObjectMapper.layer,
Expand Down
11 changes: 7 additions & 4 deletions webapi/src/main/scala/org/knora/webapi/core/AppRouter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import org.knora.webapi.messages.util.PermissionUtilADM
import org.knora.webapi.messages.util.standoff.StandoffTagUtilV2
import org.knora.webapi.responders.v2.ResourceUtilV2
import org.knora.webapi.responders.v2.ontology.CardinalityHandler
import org.knora.webapi.responders.v2.ontology.OntologyHelpers
import org.knora.webapi.responders.v2.ontology.OntologyCacheHelpers
import org.knora.webapi.responders.v2.ontology.OntologyTriplestoreHelpers
import org.knora.webapi.slice.ontology.domain.service.CardinalityService
import org.knora.webapi.slice.ontology.domain.service.OntologyRepo
import org.knora.webapi.slice.ontology.repo.service.OntologyCache
Expand All @@ -29,7 +30,8 @@ object AppRouter {

val layer: ZLayer[
pekko.actor.ActorSystem & CardinalityHandler & CardinalityService & ConstructResponseUtilV2 & MessageRelay &
OntologyCache & OntologyHelpers & OntologyRepo & PermissionUtilADM & ResourceUtilV2 & StandoffTagUtilV2,
OntologyCache & OntologyTriplestoreHelpers & OntologyCacheHelpers & OntologyRepo & PermissionUtilADM &
ResourceUtilV2 & StandoffTagUtilV2,
Nothing,
AppRouter,
] =
Expand All @@ -40,8 +42,9 @@ object AppRouter {
messageRelay <- ZIO.service[MessageRelay]
runtime <-
ZIO.runtime[
CardinalityHandler & CardinalityService & ConstructResponseUtilV2 & OntologyCache & OntologyHelpers &
OntologyRepo & PermissionUtilADM & ResourceUtilV2 & StandoffTagUtilV2,
CardinalityHandler & CardinalityService & ConstructResponseUtilV2 & OntologyCache &
OntologyTriplestoreHelpers & OntologyCacheHelpers & OntologyRepo & PermissionUtilADM & ResourceUtilV2 &
StandoffTagUtilV2,
]
ref = system.actorOf(
Props(core.actors.RoutingActor(messageRelay)(runtime)).withRouter(new RoundRobinPool(1_000)),
Expand Down
12 changes: 8 additions & 4 deletions webapi/src/main/scala/org/knora/webapi/core/LayersLive.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ import org.knora.webapi.responders.admin.*
import org.knora.webapi.responders.admin.ListsResponder
import org.knora.webapi.responders.v2.*
import org.knora.webapi.responders.v2.ontology.CardinalityHandler
import org.knora.webapi.responders.v2.ontology.OntologyHelpers
import org.knora.webapi.responders.v2.ontology.OntologyHelpersLive
import org.knora.webapi.responders.v2.ontology.OntologyCacheHelpers
import org.knora.webapi.responders.v2.ontology.OntologyCacheHelpersLive
import org.knora.webapi.responders.v2.ontology.OntologyTriplestoreHelpers
import org.knora.webapi.responders.v2.ontology.OntologyTriplestoreHelpersLive
import org.knora.webapi.routing.*
import org.knora.webapi.slice.admin.AdminModule
import org.knora.webapi.slice.admin.api.*
Expand Down Expand Up @@ -94,9 +96,10 @@ object LayersLive {
ListsResponderV2 &
MessageRelay &
OntologyCache &
OntologyHelpers &
OntologyCacheHelpers &
OntologyInferencer &
OntologyResponderV2 &
OntologyTriplestoreHelpers &
PermissionRestService &
PermissionUtilADM &
PermissionsResponder &
Expand Down Expand Up @@ -153,10 +156,11 @@ object LayersLive {
ManagementRoutes.layer,
MessageRelayLive.layer,
OntologyCacheLive.layer,
OntologyHelpersLive.layer,
OntologyCacheHelpersLive.layer,
OntologyRepoLive.layer,
OntologyResponderV2Live.layer,
OntologyServiceLive.layer,
OntologyTriplestoreHelpersLive.layer,
PermissionUtilADMLive.layer,
PermissionsResponder.layer,
PredicateObjectMapper.layer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ import org.knora.webapi.messages.util.PermissionUtilADM
import org.knora.webapi.messages.util.standoff.StandoffTagUtilV2
import org.knora.webapi.responders.v2.ResourceUtilV2
import org.knora.webapi.responders.v2.ontology.CardinalityHandler
import org.knora.webapi.responders.v2.ontology.OntologyHelpers
import org.knora.webapi.responders.v2.ontology.OntologyCacheHelpers
import org.knora.webapi.responders.v2.ontology.OntologyTriplestoreHelpers
import org.knora.webapi.slice.ontology.domain.service.CardinalityService
import org.knora.webapi.slice.ontology.domain.service.OntologyRepo
import org.knora.webapi.slice.ontology.repo.service.OntologyCache
import org.knora.webapi.util.ActorUtil

final case class RoutingActor(messageRelay: MessageRelay)(implicit
val runtime: Runtime[
CardinalityHandler & CardinalityService & ConstructResponseUtilV2 & OntologyCache & OntologyHelpers & OntologyRepo &
PermissionUtilADM & ResourceUtilV2 & StandoffTagUtilV2,
CardinalityHandler & CardinalityService & ConstructResponseUtilV2 & OntologyCache & OntologyTriplestoreHelpers &
OntologyCacheHelpers & OntologyRepo & PermissionUtilADM & ResourceUtilV2 & StandoffTagUtilV2,
],
) extends Actor {

Expand Down
Loading
Loading