-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate ElasticSearch routes and state machine to Cats Effect (#4449)
* Migrate ElasticSearch routes/state machine to Cats Effect * Compile tests * Migrate ES search routes and queries
- Loading branch information
Showing
37 changed files
with
431 additions
and
416 deletions.
There are no files selected for viewing
9 changes: 5 additions & 4 deletions
9
.../epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchDecoderConfiguration.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
package ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch | ||
|
||
import cats.effect.IO | ||
import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration.toCatsIOOps | ||
import ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch.model.contexts | ||
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.JsonLdApi | ||
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.{ContextValue, JsonLdContext, RemoteContextResolution} | ||
import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.Configuration | ||
import monix.bio.Task | ||
|
||
private[elasticsearch] object ElasticSearchDecoderConfiguration { | ||
|
||
/** | ||
* @return | ||
* a decoder configuration that uses the elasticsearch context | ||
*/ | ||
def apply(implicit jsonLdApi: JsonLdApi, rcr: RemoteContextResolution): Task[Configuration] = | ||
def apply(implicit jsonLdApi: JsonLdApi, rcr: RemoteContextResolution): IO[Configuration] = | ||
for { | ||
contextValue <- Task.delay { ContextValue(contexts.elasticsearch) } | ||
jsonLdContext <- JsonLdContext(contextValue) | ||
contextValue <- IO { ContextValue(contexts.elasticsearch) } | ||
jsonLdContext <- JsonLdContext(contextValue).toCatsIO | ||
} yield Configuration(jsonLdContext, "id") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.