You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/06/13 04:28:18 UTC

[GitHub] chetanmeh commented on a change in pull request #3619: Provide an activation store SPI

chetanmeh commented on a change in pull request #3619: Provide an activation store SPI
URL: https://github.com/apache/incubator-openwhisk/pull/3619#discussion_r194952988
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/entity/ActivationStore.scala
 ##########
 @@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package whisk.core.entity
+
+import java.time.Instant
+
+import akka.actor.ActorSystem
+import akka.stream.ActorMaterializer
+import spray.json.JsObject
+import whisk.common.{Logging, TransactionId}
+import whisk.core.database.CacheChangeNotification
+import whisk.spi.Spi
+
+import scala.concurrent.Future
+
+trait ActivationStore {
+
+  /**
+   * Stores an activation.
+   *
+   * @param activation activation to store
+   * @param transid transaction ID for request
+   * @param notifier cache change notifier
+   * @return Future containing DocInfo related to stored activation
+   */
+  def store(activation: WhiskActivation)(implicit transid: TransactionId,
+                                         notifier: Option[CacheChangeNotification]): Future[DocInfo]
+
+  /**
+   * Retrieves an activation corresponding to the specified activation ID.
+   *
+   * @param activationId ID of activation to retrieve
+   * @param transid transaction ID for request
+   * @return Future containing the retrieved WhiskActivation
+   */
+  def get(activationId: ActivationId)(implicit transid: TransactionId): Future[WhiskActivation]
+
+  /**
+   * Deletes an activation corresponding to the provided activation ID.
+   *
+   * @param activationId ID of activation to delete
+   * @param transid transaction ID for the request
+   * @param notifier cache change notifier
+   * @return Future containing a Boolean value indication whether the activation was deleted
+   */
+  def delete(activationId: ActivationId)(implicit transid: TransactionId,
+                                         notifier: Option[CacheChangeNotification]): Future[Boolean]
+
+  /**
+   * Counts the number of activations in a namespace.
+   *
+   * @param namespace namespace to query
+   * @param name entity name to query
+   * @param skip number of activations to skip
+   * @param since timestamp to retrieve activations after
+   * @param upto timestamp to retrieve activations before
+   * @param transid transaction ID for request
+   * @return Future containing number of activations returned from query in JSON format
+   */
+  def countActivationsInNamespace(namespace: EntityPath,
+                                  name: Option[EntityPath] = None,
+                                  skip: Int,
+                                  since: Option[Instant] = None,
+                                  upto: Option[Instant] = None)(implicit transid: TransactionId): Future[JsObject]
+
+  /**
+   * Returns activations corresponding to provided entity name.
+   *
+   * @param namespace namespace to query
+   * @param name entity name to query
+   * @param skip number of activations to skip
+   * @param limit maximum number of activations to list
+   * @param includeDocs return document with each activation
+   * @param since timestamp to retrieve activations after
+   * @param upto timestamp to retrieve activations before
+   * @param transid transaction ID for request
+   * @return Future containing a List of activations in JSON format or List of WhiskActivation
 
 Review comment:
   @dubee In which case it would be `JsObject` and not `WhiskActivation`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services