DESCRIPTION

JCBC-571: Switch to POST if view query is too long

Motivation
----------
Server-side limitation prevents GET requests that grow too large to be
executed. If the query string is too large, most probable culprit is the
keys parameter, and it is the only one that can be passed in as the body
of a POST request.

Modifications
-------------
A method to extract the keys part of a query string if it gets over a
specified threshold has been introduced.

If this method actually splits, then the HTTP request becomes a POST and
its body is the keys is JSON form, while the rest of the uri parameters
are kept in the query string.

Tests have been added to validate both utility method and the behavior
of the handler when a large query is issued.

Split threshold for query requests have been semi-arbitrarily fixed to
1024 characters (even if the query server should be able to handle URIs
in the 4KB range).

Results
-------
Large view queries switch to POST and have the "keys" parameter in the
body, allowing them to go through.

Change-Id: I38048d881103ee285ca526f143131d478c0feb12


COMMENTS

author: Estrella Humphrey
date: 2015-02-25 16:34:50.509000000

Uploaded patch set 2.

-------------------------------------
author: Estrella Humphrey
date: 2015-02-25 16:36:00.788000000

Patch Set 2: Verified+1

This one had fallen through the cracks. Used it as a base and made the modification so that we switch to POST.

-------------------------------------
author: Natasha Sullivan
date: 2015-02-25 16:45:12.631000000

Patch Set 2:

(1 comment)

Line:200, src/main/java/com/couchbase/client/core/endpoint/view/ViewHandler.java -> could it be allocated from ctx().buffer() instead?

-------------------------------------
author: Gerrit Code Review
date: 2015-02-26 08:34:32.200000000

Change has been successfully cherry-picked as 36d20dcc3ade1903718d259f88d3d81cf042a749

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