DESCRIPTION

JVMCBC-197: have keys passed in separately for ViewQuery

Motivation
----------
Recently, a change was made so that the core switches to POST when it
detects that a View query is too large. Body of the post is the keys
parameters (the only one allowed, and also the most probable culprit for
size), extracted for url and set as JSON.
Only problem is that the client url-encodes the keys, which isn't valid
when contained in JSON, so it fails in production.

Modifications
-------------
The ViewQueryRequest was changed to force getting the keys array as a
separate JSON string, not part of the "query" url.

ViewHandler now uses this separate info to decide if a switch to POST
should be made (in which case it injects the keys String into the JSON
object of the body) or if GET is still doable (in which case it encodes
the keys array via URLEncoder).

Added tests to validate this behavior and the ways the URL is built from
both query() and keys() (in the case of the GET).

Results
-------
Keys are now properly encoded by the core directly and work either in a
GET or a PUT.
No more JSON syntax error when querying a view with a large set of keys.

Change-Id: I7cd8b12c070947201483d69d32da9cdd6a44a9d1
Reviewed-on: http://review.couchbase.org/50706
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2015-05-11 12:26:55.803000000

Change has been successfully cherry-picked as 5a02e0f3966e1d8088aeb802142848a8be313de0

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