This is an automated email from the ASF dual-hosted git repository. markusthoemmes pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git
The following commit(s) were added to refs/heads/master by this push: new cb1e88f Add explicit type-info to the ArtifactStore. (#3283) cb1e88f is described below commit cb1e88f319cfc3368e8df03995325b9f6fcfd468 Author: Chetan Mehrotra <chet...@apache.org> AuthorDate: Mon Feb 19 20:07:54 2018 +0530 Add explicit type-info to the ArtifactStore. (#3283) --- .../main/scala/whisk/core/database/ArtifactStoreProvider.scala | 8 +++++--- .../src/main/scala/whisk/core/database/CouchDbStoreProvider.scala | 6 +++++- common/scala/src/main/scala/whisk/core/entity/WhiskStore.scala | 3 +++ .../scala/whisk/core/controller/test/ActivationsApiTests.scala | 3 +++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/common/scala/src/main/scala/whisk/core/database/ArtifactStoreProvider.scala b/common/scala/src/main/scala/whisk/core/database/ArtifactStoreProvider.scala index e8cac18..d07381e 100644 --- a/common/scala/src/main/scala/whisk/core/database/ArtifactStoreProvider.scala +++ b/common/scala/src/main/scala/whisk/core/database/ArtifactStoreProvider.scala @@ -25,13 +25,15 @@ import whisk.core.WhiskConfig import whisk.spi.Spi import whisk.core.entity.DocumentReader +import scala.reflect.ClassTag + /** * An Spi for providing ArtifactStore implementations */ trait ArtifactStoreProvider extends Spi { - def makeStore[D <: DocumentSerializer](config: WhiskConfig, - name: WhiskConfig => String, - useBatching: Boolean = false)( + def makeStore[D <: DocumentSerializer: ClassTag](config: WhiskConfig, + name: WhiskConfig => String, + useBatching: Boolean = false)( implicit jsonFormat: RootJsonFormat[D], docReader: DocumentReader, actorSystem: ActorSystem, diff --git a/common/scala/src/main/scala/whisk/core/database/CouchDbStoreProvider.scala b/common/scala/src/main/scala/whisk/core/database/CouchDbStoreProvider.scala index 08b915e..0a59c39 100644 --- a/common/scala/src/main/scala/whisk/core/database/CouchDbStoreProvider.scala +++ b/common/scala/src/main/scala/whisk/core/database/CouchDbStoreProvider.scala @@ -24,9 +24,13 @@ import whisk.common.Logging import whisk.core.WhiskConfig import whisk.core.entity.DocumentReader +import scala.reflect.ClassTag + object CouchDbStoreProvider extends ArtifactStoreProvider { - def makeStore[D <: DocumentSerializer](config: WhiskConfig, name: WhiskConfig => String, useBatching: Boolean)( + def makeStore[D <: DocumentSerializer: ClassTag](config: WhiskConfig, + name: WhiskConfig => String, + useBatching: Boolean)( implicit jsonFormat: RootJsonFormat[D], docReader: DocumentReader, actorSystem: ActorSystem, diff --git a/common/scala/src/main/scala/whisk/core/entity/WhiskStore.scala b/common/scala/src/main/scala/whisk/core/entity/WhiskStore.scala index 7eaf1a1..d69f9d7 100644 --- a/common/scala/src/main/scala/whisk/core/entity/WhiskStore.scala +++ b/common/scala/src/main/scala/whisk/core/entity/WhiskStore.scala @@ -49,6 +49,8 @@ import whisk.core.database.StaleParameter import whisk.spi.SpiLoader import pureconfig._ +import scala.reflect.classTag + package object types { type AuthStore = ArtifactStore[WhiskAuth] type EntityStore = ArtifactStore[WhiskEntity] @@ -123,6 +125,7 @@ object WhiskEntityStore { SpiLoader .get[ArtifactStoreProvider] .makeStore[WhiskEntity](config, _.dbWhisk)( + classTag[WhiskEntity], WhiskEntityJsonFormat, WhiskDocumentReader, system, diff --git a/tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala b/tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala index 7d69ccf..cf9303d 100644 --- a/tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala +++ b/tests/src/test/scala/whisk/core/controller/test/ActivationsApiTests.scala @@ -35,6 +35,8 @@ import whisk.core.entity.size._ import whisk.http.{ErrorResponse, Messages} import whisk.spi.SpiLoader +import scala.reflect.classTag + /** * Tests Activations API. * @@ -525,6 +527,7 @@ class ActivationsApiTests extends ControllerTestCommon with WhiskActivationsApi val activationStore = SpiLoader .get[ArtifactStoreProvider] .makeStore[WhiskEntity](whiskConfig, _.dbActivations)( + classTag[WhiskEntity], WhiskEntityJsonFormat, WhiskDocumentReader, system, -- To stop receiving notification emails like this one, please contact markusthoem...@apache.org.