[ARVADOS] created: 609646134bcd8fc3a7fd500848220741ecc4a9d2

Git user git at public.curoverse.com
Mon Jan 16 13:58:27 EST 2017


        at  609646134bcd8fc3a7fd500848220741ecc4a9d2 (commit)


commit 609646134bcd8fc3a7fd500848220741ecc4a9d2
Merge: 4032e4d 565e1cc
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jan 16 11:13:32 2017 -0500

    Merge branch 'master' into 9998-no-count-items-available
    
    Conflicts:
    	sdk/go/arvados/resource_list.go
    	services/keep-balance/collection.go

diff --cc sdk/go/arvados/resource_list.go
index 2864307,242fb7e..0cc6658
--- a/sdk/go/arvados/resource_list.go
+++ b/sdk/go/arvados/resource_list.go
@@@ -5,13 -5,12 +5,14 @@@ import "encoding/json
  // ResourceListParams expresses which results are requested in a
  // list/index API.
  type ResourceListParams struct {
- 	Select   []string `json:"select,omitempty"`
- 	Filters  []Filter `json:"filters,omitempty"`
- 	Limit    *int     `json:"limit,omitempty"`
- 	Offset   int      `json:"offset,omitempty"`
- 	Order    string   `json:"order,omitempty"`
- 	Distinct bool     `json:"distinct,omitempty"`
- 	Count    bool     `json:"count,omitempty"`
+ 	Select       []string `json:"select,omitempty"`
+ 	Filters      []Filter `json:"filters,omitempty"`
+ 	IncludeTrash bool     `json:"include_trash,omitempty"`
+ 	Limit        *int     `json:"limit,omitempty"`
+ 	Offset       int      `json:"offset,omitempty"`
+ 	Order        string   `json:"order,omitempty"`
++	Distinct     bool     `json:"distinct,omitempty"`
++	Count        bool     `json:"count,omitempty"`
  }
  
  // A Filter restricts the set of records returned by a list/index API.
diff --cc services/keep-balance/collection.go
index 060621b,b3a631e..15556ed
--- a/services/keep-balance/collection.go
+++ b/services/keep-balance/collection.go
@@@ -42,10 -43,10 +44,11 @@@ func EachCollection(c *arvados.Client, 
  		limit = 1<<31 - 1
  	}
  	params := arvados.ResourceListParams{
- 		Limit:  &limit,
- 		Order:  "modified_at, uuid",
- 		Count:  false,
- 		Select: []string{"uuid", "manifest_text", "modified_at", "portable_data_hash", "replication_desired"},
+ 		Limit:        &limit,
+ 		Order:        "modified_at, uuid",
++		Count:        false,
+ 		Select:       []string{"uuid", "unsigned_manifest_text", "modified_at", "portable_data_hash", "replication_desired"},
+ 		IncludeTrash: true,
  	}
  	var last arvados.Collection
  	var filterTime time.Time

commit 4032e4dc4284391f21f21630bdb7ca88f8329d8e
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Thu Nov 17 14:34:25 2016 +0000

    fixes formatting on collection.go

diff --git a/services/keep-balance/collection.go b/services/keep-balance/collection.go
index d67f2f0..060621b 100644
--- a/services/keep-balance/collection.go
+++ b/services/keep-balance/collection.go
@@ -44,7 +44,7 @@ func EachCollection(c *arvados.Client, pageSize int, f func(arvados.Collection)
 	params := arvados.ResourceListParams{
 		Limit:  &limit,
 		Order:  "modified_at, uuid",
-		Count: false,
+		Count:  false,
 		Select: []string{"uuid", "manifest_text", "modified_at", "portable_data_hash", "replication_desired"},
 	}
 	var last arvados.Collection

commit 0d0092442c009b8b3e387da18f828f3f0518b709
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Sat Nov 12 16:02:24 2016 +0000

    Change keep-balance to only request Count at beginning and end of collection retrieval

diff --git a/services/keep-balance/collection.go b/services/keep-balance/collection.go
index f4fc721..d67f2f0 100644
--- a/services/keep-balance/collection.go
+++ b/services/keep-balance/collection.go
@@ -11,6 +11,7 @@ func countCollections(c *arvados.Client, params arvados.ResourceListParams) (int
 	var page arvados.CollectionList
 	var zero int
 	params.Limit = &zero
+	params.Count = true
 	err := c.RequestAndDecode(&page, "GET", "arvados/v1/collections", nil, params)
 	return page.ItemsAvailable, err
 }
@@ -43,6 +44,7 @@ func EachCollection(c *arvados.Client, pageSize int, f func(arvados.Collection)
 	params := arvados.ResourceListParams{
 		Limit:  &limit,
 		Order:  "modified_at, uuid",
+		Count: false,
 		Select: []string{"uuid", "manifest_text", "modified_at", "portable_data_hash", "replication_desired"},
 	}
 	var last arvados.Collection

commit a4edc2a4a740d3908b907682a85e227eee80683b
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Sat Nov 12 15:57:18 2016 +0000

    Add Count to Go SDK ResourceListParams

diff --git a/sdk/go/arvados/resource_list.go b/sdk/go/arvados/resource_list.go
index e9ea268..2864307 100644
--- a/sdk/go/arvados/resource_list.go
+++ b/sdk/go/arvados/resource_list.go
@@ -5,11 +5,13 @@ import "encoding/json"
 // ResourceListParams expresses which results are requested in a
 // list/index API.
 type ResourceListParams struct {
-	Select  []string `json:"select,omitempty"`
-	Filters []Filter `json:"filters,omitempty"`
-	Limit   *int     `json:"limit,omitempty"`
-	Offset  int      `json:"offset,omitempty"`
-	Order   string   `json:"order,omitempty"`
+	Select   []string `json:"select,omitempty"`
+	Filters  []Filter `json:"filters,omitempty"`
+	Limit    *int     `json:"limit,omitempty"`
+	Offset   int      `json:"offset,omitempty"`
+	Order    string   `json:"order,omitempty"`
+	Distinct bool     `json:"distinct,omitempty"`
+	Count    bool     `json:"count,omitempty"`
 }
 
 // A Filter restricts the set of records returned by a list/index API.

commit f65530a60d7b74da723d16eccd84576c53575401
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Sat Nov 12 15:17:18 2016 +0000

    Update CLI docs for --no-count

diff --git a/doc/sdk/cli/reference.html.textile.liquid b/doc/sdk/cli/reference.html.textile.liquid
index a76ef2f..c2fbf27 100644
--- a/doc/sdk/cli/reference.html.textile.liquid
+++ b/doc/sdk/cli/reference.html.textile.liquid
@@ -60,7 +60,7 @@ Arguments accepted by the @list@ subcommand include:
     --order, -r <s>:     Order in which to return matching users.
    --select, -s <s>:     Select which fields to return
      --distinct, -d:     Return each distinct object.
-     --no-count, -n:     Don't count items_available.
+         --no-count:     Don't count items_available.
 </pre>
 
 The @--filters@ option takes a string describing a JSON list of filters on which the returned resources should be returned. Each filter is a three-element list of _[field, operator, value]_, where the _operator_ may be one of @=@, @<@, @<=@, @>@, @>=@, @!=@, @like@, or @ilike at .

commit be141b88fe871c7e72b19a5cf1e0aa56bf28283a
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Sat Nov 12 15:13:37 2016 +0000

    Switch from no_count to count to avoid issues with arv CLI / trollop

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index ffbef18..1114ae1 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -482,7 +482,7 @@ class ApplicationController < ActionController::Base
       :limit => @limit,
       :items => @objects.as_api_response(nil, {select: @select})
     }
-    if params[:no_count].nil? || !params[:no_count]
+    if params[:count].nil? || params[:count]
       if @objects.respond_to? :except
         list[:items_available] = @objects.
           except(:limit).except(:offset).
@@ -550,7 +550,7 @@ class ApplicationController < ActionController::Base
       distinct: { type: 'boolean', required: false },
       limit: { type: 'integer', required: false, default: DEFAULT_LIMIT },
       offset: { type: 'integer', required: false, default: 0 },
-      no_count: { type: 'boolean', required: false, default: false },
+      count: { type: 'boolean', required: false, default: true},
     }
   end
 
diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb
index a2f5c18..3952db6 100644
--- a/services/api/app/controllers/arvados/v1/schema_controller.rb
+++ b/services/api/app/controllers/arvados/v1/schema_controller.rb
@@ -254,9 +254,10 @@ class Arvados::V1::SchemaController < ApplicationController
                   description: "Return each distinct object.",
                   location: "query"
                 },
-                no_count: {
+                count: {
                   type: "boolean",
-                  description: "Don't count items_available.",
+                  description: "Count items_available.",
+                  default: "true",
                   location: "query"
                 }
               },

commit 43dcf83e8b5332004bddd01be22476e68b1cef0f
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Sat Nov 12 14:31:00 2016 +0000

    Add --no-count option to CLI reference docs

diff --git a/doc/sdk/cli/reference.html.textile.liquid b/doc/sdk/cli/reference.html.textile.liquid
index ef9882f..a76ef2f 100644
--- a/doc/sdk/cli/reference.html.textile.liquid
+++ b/doc/sdk/cli/reference.html.textile.liquid
@@ -59,7 +59,8 @@ Arguments accepted by the @list@ subcommand include:
   --filters, -f <s>:     Conditions for filtering users.
     --order, -r <s>:     Order in which to return matching users.
    --select, -s <s>:     Select which fields to return
-     --distinct, -d:     Return each distinct object
+     --distinct, -d:     Return each distinct object.
+     --no-count, -n:     Don't count items_available.
 </pre>
 
 The @--filters@ option takes a string describing a JSON list of filters on which the returned resources should be returned. Each filter is a three-element list of _[field, operator, value]_, where the _operator_ may be one of @=@, @<@, @<=@, @>@, @>=@, @!=@, @like@, or @ilike at .

commit bb037e3872214d2b709964405775f476c6b3b550
Author: Joshua C. Randall <jcrandall at alum.mit.edu>
Date:   Sat Nov 12 14:21:24 2016 +0000

    Adds no_count option to list method
    
    When `no_count` is true, the API server will not query the database
    for the count of items and it will not return `items_available` in
    the JSON output.
    
    This is expected to offer a major performance improvement when
    tables are large and the count is not needed, since postgres
    can otherwise take far longer to answer the COUNT() query than
    to answer the main query and return the requested list.

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 776f7e1..ffbef18 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -482,10 +482,12 @@ class ApplicationController < ActionController::Base
       :limit => @limit,
       :items => @objects.as_api_response(nil, {select: @select})
     }
-    if @objects.respond_to? :except
-      list[:items_available] = @objects.
-        except(:limit).except(:offset).
-        count(:id, distinct: true)
+    if params[:no_count].nil? || !params[:no_count]
+      if @objects.respond_to? :except
+        list[:items_available] = @objects.
+          except(:limit).except(:offset).
+          count(:id, distinct: true)
+      end
     end
     list
   end
@@ -548,6 +550,7 @@ class ApplicationController < ActionController::Base
       distinct: { type: 'boolean', required: false },
       limit: { type: 'integer', required: false, default: DEFAULT_LIMIT },
       offset: { type: 'integer', required: false, default: 0 },
+      no_count: { type: 'boolean', required: false, default: false },
     }
   end
 
diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb
index 2c55b15..a2f5c18 100644
--- a/services/api/app/controllers/arvados/v1/schema_controller.rb
+++ b/services/api/app/controllers/arvados/v1/schema_controller.rb
@@ -246,12 +246,17 @@ class Arvados::V1::SchemaController < ApplicationController
                 },
                 select: {
                   type: "array",
-                  description: "Select which fields to return",
+                  description: "Select which fields to return.",
                   location: "query"
                 },
                 distinct: {
                   type: "boolean",
-                  description: "Return each distinct object",
+                  description: "Return each distinct object.",
+                  location: "query"
+                },
+                no_count: {
+                  type: "boolean",
+                  description: "Don't count items_available.",
                   location: "query"
                 }
               },

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list