openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbic...@apache.org
Subject [incubator-openwhisk] branch master updated: Remove old views. (#2763)
Date Wed, 22 Nov 2017 10:40:17 GMT
This is an automated email from the ASF dual-hosted git repository.

cbickel 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 e404577  Remove old views. (#2763)
e404577 is described below

commit e404577667c695a96e51d6a1dfd9e9a6aec98844
Author: rodric rabbah <rodric@gmail.com>
AuthorDate: Wed Nov 22 05:40:14 2017 -0500

    Remove old views. (#2763)
---
 .../whisks_design_document_for_actions_db.json     | 28 ----------------------
 .../whisks_design_document_for_activations_db.json | 12 ----------
 ansible/tasks/recreateViews.yml                    |  2 --
 .../scala/whisk/core/entity/WhiskActivation.scala  | 14 +++++------
 4 files changed, 6 insertions(+), 50 deletions(-)

diff --git a/ansible/files/whisks_design_document_for_actions_db.json b/ansible/files/whisks_design_document_for_actions_db.json
deleted file mode 100644
index 2949be5..0000000
--- a/ansible/files/whisks_design_document_for_actions_db.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "_id": "_design/whisks",
-  "views": {
-    "all": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n\n  var isPackage = function (doc)
{  return (doc.binding !== undefined) };\n  var isAction = function (doc) { return (doc.exec
!== undefined) };\n  var isTrigger = function (doc) { return (doc.exec === undefined &&
doc.binding === undefined && doc.parameters !== undefined) };\n  var isRule = function
(doc) {  return (doc.trigger !== undefined) };\n  \n  var collection = function (doc) {\n
   if (isPackage(doc)) return \"packages\"; [...]
-    },
-    "entities": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n\n  var isPackage = function (doc)
{  return (doc.binding !== undefined) };\n  var isAction = function (doc) { return (doc.exec
!== undefined) };\n  var isTrigger = function (doc) { return (doc.exec === undefined &&
doc.binding === undefined && doc.parameters !== undefined) };\n  var isRule = function
(doc) {  return (doc.trigger !== undefined) };\n  \n  var collection = function (doc) {\n
   if (isPackage(doc)) return \"packages\"; [...]
-    },
-    "packages": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n\n  var isPackage = function (doc)
{  return (doc.binding !== undefined) };\n  var isAction = function (doc) { return (doc.exec
!== undefined) };\n  var isTrigger = function (doc) { return (doc.exec === undefined &&
doc.binding === undefined && doc.parameters !== undefined) };\n  var isRule = function
(doc) {  return (doc.trigger !== undefined) };\n\n  if (isPackage(doc)) try {\n    var date
= new Date(doc.start || doc.updated);\n   [...]
-    },
-    "packages-all": {
-      "reduce": "function (keys, values, rereduce) {\n  var isPublicPackage = function(p)
{ return p.publish && !p.binding; };\n\n  if (rereduce) {\n    return [].concat.apply([],
values);\n  } else {\n    return values.filter(isPublicPackage);\n  }\n}",
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n\n  var isPackage = function (doc)
{  return (doc.binding !== undefined) };\n  var isAction = function (doc) { return (doc.exec
!== undefined) };\n  var isTrigger = function (doc) { return (doc.exec === undefined &&
doc.binding === undefined && doc.parameters !== undefined) };\n  var isRule = function
(doc) {  return (doc.trigger !== undefined) };\n\n  if (isPackage(doc)) try {\n    var date
= new Date(doc.start || doc.updated);\n   [...]
-    },
-    "actions": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n\n  var isPackage = function (doc)
{  return (doc.binding !== undefined) };\n  var isAction = function (doc) { return (doc.exec
!== undefined) };\n  var isTrigger = function (doc) { return (doc.exec === undefined &&
doc.binding === undefined && doc.parameters !== undefined) };\n  var isRule = function
(doc) {  return (doc.trigger !== undefined) };\n\n  if (isAction(doc)) try {\n    var ns =
doc.namespace.split(PATHSEP);\n    var roo [...]
-    },
-    "triggers": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n\n  var isPackage = function (doc)
{  return (doc.binding !== undefined) };\n  var isAction = function (doc) { return (doc.exec
!== undefined) };\n  var isTrigger = function (doc) { return (doc.exec === undefined &&
doc.binding === undefined && doc.parameters !== undefined) };\n  var isRule = function
(doc) {  return (doc.trigger !== undefined) };\n\n  if (isTrigger(doc)) try {\n    var ns
= doc.namespace.split(PATHSEP);\n    var ro [...]
-    },
-    "rules": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n\n  var isPackage = function (doc)
{  return (doc.binding !== undefined) };\n  var isAction = function (doc) { return (doc.exec
!== undefined) };\n  var isTrigger = function (doc) { return (doc.exec === undefined &&
doc.binding === undefined && doc.parameters !== undefined) };\n  var isRule = function
(doc) {  return (doc.trigger !== undefined) };\n\n  if (isRule(doc)) try {\n    var ns = doc.namespace.split(PATHSEP);\n
   var root  [...]
-    }
-  },
-  "language": "javascript"
-}
diff --git a/ansible/files/whisks_design_document_for_activations_db.json b/ansible/files/whisks_design_document_for_activations_db.json
deleted file mode 100644
index 5bd0c60..0000000
--- a/ansible/files/whisks_design_document_for_activations_db.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "_id": "_design/whisks",
-  "views": {
-    "all": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n  var isActivation = function (doc)
{ return (doc.activationId !== undefined) };\n  var collection = function (doc) {\n    if
(isActivation(doc)) return \"activations\";\n    return \"??\";\n  };\n\n  if (isActivation(doc))
try {\n    var ns = doc.namespace.split(PATHSEP);\n    var root = ns[0]; ns.shift();\n   
var type = collection(doc);\n    var date = new Date(doc.start || doc.updated);\n    var value
= {collection: type, namesp [...]
-    },
-    "activations": {
-      "map": "function (doc) {\n  var PATHSEP = \"/\";\n  var isActivation = function (doc)
{ return (doc.activationId !== undefined) };\n\n  if (isActivation(doc)) try {\n    var date
= new Date(doc.start || doc.updated);\n    emit([doc.namespace, date.getTime(), doc.name],
{namespace: doc.namespace, name: doc.name, version: doc.version, publish: doc.publish, annotations:
doc.annotations, activationId: doc.activationId});\n    emit([doc.namespace+PATHSEP+doc.name,
date.getTime()], {name [...]
-    }
-  },
-  "language": "javascript"
-}
diff --git a/ansible/tasks/recreateViews.yml b/ansible/tasks/recreateViews.yml
index 682ca94..a5b6048 100644
--- a/ansible/tasks/recreateViews.yml
+++ b/ansible/tasks/recreateViews.yml
@@ -6,7 +6,6 @@
     dbName: "{{ db.whisk.actions }}"
     doc: "{{ lookup('file', '{{ item }}') }}"
   with_items:
-    - "{{ openwhisk_home }}/ansible/files/whisks_design_document_for_actions_db.json"
     - "{{ openwhisk_home }}/ansible/files/whisks_design_document_for_entities_db_v2.json"
     - "{{ openwhisk_home }}/ansible/files/filter_design_document.json"
 
@@ -15,7 +14,6 @@
     dbName: "{{ db.whisk.activations }}"
     doc: "{{ lookup('file', '{{ item }}') }}"
   with_items:
-    - "{{ openwhisk_home }}/ansible/files/whisks_design_document_for_activations_db.json"
     - "{{ openwhisk_home }}/ansible/files/whisks_design_document_for_activations_db_v2.json"
     - "{{ openwhisk_home }}/ansible/files/whisks_design_document_for_activations_db_filters_v2.json"
     - "{{ openwhisk_home }}/ansible/files/filter_design_document.json"
diff --git a/common/scala/src/main/scala/whisk/core/entity/WhiskActivation.scala b/common/scala/src/main/scala/whisk/core/entity/WhiskActivation.scala
index 596a5ec..1e04b11 100644
--- a/common/scala/src/main/scala/whisk/core/entity/WhiskActivation.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/WhiskActivation.scala
@@ -79,7 +79,6 @@ case class WhiskActivation(namespace: EntityPath,
   /** This the activation summary as computed by the database view. Strictly used for testing.
*/
   override def summaryAsJson = {
     import WhiskActivation.instantSerdes
-    val summary = JsObject(super.summaryAsJson.fields + ("activationId" -> activationId.toJson))
 
     def actionOrNot() = {
       if (end != Instant.EPOCH) {
@@ -90,13 +89,12 @@ case class WhiskActivation(namespace: EntityPath,
       } else Map.empty
     }
 
-    if (WhiskActivation.mainDdoc.endsWith(".v2")) {
-      JsObject(
-        summary.fields +
-          ("start" -> start.toJson) ++
-          cause.map(("cause" -> _.toJson)) ++
-          actionOrNot())
-    } else summary
+    JsObject(
+      super.summaryAsJson.fields +
+        ("activationId" -> activationId.toJson) +
+        ("start" -> start.toJson) ++
+        cause.map(("cause" -> _.toJson)) ++
+        actionOrNot())
   }
 
   def resultAsJson = response.result.toJson.asJsObject

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message