Well, it depends on whether the data of interests is on the node where the
Developer REST API is running in the first place, since the Dev REST API
can only run on a Geode Server.  If the data of interests is on the server
where the REST API is running, then no extra hop would be needed in that
case.

Most likely, there will be an extra hop since...

1. Typically the REST API is only run a few nodes in the cluster (far fewer
than potentially the number of nodes in the cluster), and...
2. A REST client (unlike Java//Native clients) does not talk indirectly to
the cluster through a Locator, which technically makes single-hop
possible.  The URL used by a client is to a server running the REST API, so
if that node does not have the data targeted by the Function, then yes, an
extra hop is going to be required.

To get similar behavior as in the Java/Native client drivers, a language
specific (e.g. Python, Ruby, JavaScript, etc) binding (adapter) would be
needed, client-side.

-j


On Fri, Oct 6, 2017 at 3:45 PM, Mangesh Deshmukh <[email protected]>
wrote:

> Hi Mike,
>
>
>
> Even with “filter” supported in REST, it would still make an extra hop,
> correct?
>
>
>
> Thanks,
>
> Mangesh
>
>
>
>
>
> *From: *Michael Stolz <[email protected]>
> *Reply-To: *"[email protected]" <[email protected]>
> *Date: *Friday, October 6, 2017 at 3:01 PM
> *To: *"[email protected]" <[email protected]>
> *Subject: *Re: Executing function on partitioned region
>
>
>
> "with filter" was added to the REST api in 8.x I believe.
>
>
> --
>
> Mike Stolz
>
> Principal Engineer, GemFire Product Lead
>
> Mobile: +1-631-835-4771 <(631)%20835-4771>
>
>
>
> On Fri, Oct 6, 2017 at 2:19 PM, Jens Deppe <[email protected]> wrote:
>
> Hi Mangesh,
>
>
>
> If you have the key for your entry then it will be more performant,
> calling the function, using the API. You achieve this by using the
> 'withFilter(key)' predicate.
>
>
>
> (Java) Clients maintain metadata about where the data is stored for a
> given key and so they're able to leverage that in this situation. For the
> REST API, we unfortunately don't have a way to achieve this mapping at the
> moment, so your REST call will most likely be forwarded to the actual
> server that holds the data, thus incurring an additional hop penalty.
>
>
>
> --Jens
>
>
>
>
>
> On Fri, Oct 6, 2017 at 9:17 AM, Mangesh Deshmukh <[email protected]>
> wrote:
>
> Hi,
>
>
>
> If we enable REST APIs, will it be calling a function on partitioned
> region on all servers that host this region? Is there a way to optimize
> this to go only to the server that hosts the entry?
>
>
>
> Would calling the function using REST be less performant than by calling
> it using API?
>
>
>
> Thanks,
>
> Mangesh
>
>
>
>
>
>
>
>
>



-- 
-John
john.blum10101 (skype)

Reply via email to