You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Pereslegin (Jira)" <ji...@apache.org> on 2021/12/29 16:26:00 UTC

[jira] [Updated] (IGNITE-16233) Improve public API for setting caller context to service proxy.

     [ https://issues.apache.org/jira/browse/IGNITE-16233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Pereslegin updated IGNITE-16233:
--------------------------------------
    Description: 
*Motivation.*

When retrieving a proxy service, the user can specify optional parameters: {{timeout}} and {{sticky}}.
When adding a new optional parameter (in discussed case - "context"), for the convenience of the user, several methods are added at once (with a different set of optional parameters).
Thus, the number of methods can grow geometrically with the addition of each new parameter.

*Suggested options.*

# Add a new {{ServiceProxyConfiguration}} class which will combine all proxy settings.
{code:java}
ignite.services().serviceProxy(new ServiceProxyConfiguration(name, cls).setContext(callCtx));
{code}  
   {color:#DE350B}Adds yet another "config" object, complicates the use of the API.{color}
# Add a new method "withContext(callCtx)" ({{returns IgniteServices}}) to the {{IgniteServices}} interface.
{code:java}
Ignite.services().withContext(callCtx).serviceProxy(name,...)
{code}
{color:#DE350B}Most of the {{IgniteServices}} methods are not related to the service call context (deploy, cancel of the service, etc. which may be confusing for the user). It's not clear what to do with the "timeout" and "sticky" parameters.{color}
# Add a new "withContext(callCtx)" method which returns a new interface {{IgniteServiceProxies}} (name can be changed).
{code:java}
Ignite.services().withContext(callCtx).serviceProxy(name,...)
{code}
{color:#DE350B}The new interface has a not very clear purpose and naming (looks like "service proxy builder"). May be confusing for the user. It's not clear what to do with the "timeout" and "sticky" parameters.{color}



  was:
*Motivation.*

When retrieving a proxy service, the user can specify optional parameters: {{timeout}} and {{sticky}}.
When adding a new optional parameter (in discussed case - "context"), for the convenience of the user, several methods are added at once (with a different set of optional parameters).
Thus, the number of methods can grow geometrically with the addition of each new parameter.

*Suggested options.*

# Add {{ServiceProxyConfiguration}} which will combine all proxy settings.
{code:java}
ignite.services().serviceProxy(new ServiceProxyConfiguration(name, cls).setContext(callCtx));
{code}  
   {color:#DE350B}Adds yet another "config" object, complicates the use of the API.{color}
# Add a new method "withContext(callCtx)" ({{returns IgniteServices}}) to the {{IgniteServices}} interface.
{code:java}
Ignite.services().withContext(callCtx).serviceProxy(name,...)
{code}
{color:#DE350B}Most of the {{IgniteServices}} methods are not related to the service call context (deploy, cancel of the service, etc. which may be confusing for the user). It's not clear what to do with the "timeout" and "sticky" parameters.{color}
# Add a new "withContext(callCtx)" method which returns a new interface {{IgniteServiceProxies}} (name can be changed).
{code:java}
Ignite.services().withContext(callCtx).serviceProxy(name,...)
{code}
{color:#DE350B}The new interface has a not very clear purpose and naming (looks like "service proxy builder"). May be confusing for the user. It's not clear what to do with the "timeout" and "sticky" parameters.{color}




> Improve public API for setting caller context to service proxy.
> ---------------------------------------------------------------
>
>                 Key: IGNITE-16233
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16233
>             Project: Ignite
>          Issue Type: Sub-task
>            Reporter: Pavel Pereslegin
>            Priority: Major
>             Fix For: 2.13
>
>
> *Motivation.*
> When retrieving a proxy service, the user can specify optional parameters: {{timeout}} and {{sticky}}.
> When adding a new optional parameter (in discussed case - "context"), for the convenience of the user, several methods are added at once (with a different set of optional parameters).
> Thus, the number of methods can grow geometrically with the addition of each new parameter.
> *Suggested options.*
> # Add a new {{ServiceProxyConfiguration}} class which will combine all proxy settings.
> {code:java}
> ignite.services().serviceProxy(new ServiceProxyConfiguration(name, cls).setContext(callCtx));
> {code}  
>    {color:#DE350B}Adds yet another "config" object, complicates the use of the API.{color}
> # Add a new method "withContext(callCtx)" ({{returns IgniteServices}}) to the {{IgniteServices}} interface.
> {code:java}
> Ignite.services().withContext(callCtx).serviceProxy(name,...)
> {code}
> {color:#DE350B}Most of the {{IgniteServices}} methods are not related to the service call context (deploy, cancel of the service, etc. which may be confusing for the user). It's not clear what to do with the "timeout" and "sticky" parameters.{color}
> # Add a new "withContext(callCtx)" method which returns a new interface {{IgniteServiceProxies}} (name can be changed).
> {code:java}
> Ignite.services().withContext(callCtx).serviceProxy(name,...)
> {code}
> {color:#DE350B}The new interface has a not very clear purpose and naming (looks like "service proxy builder"). May be confusing for the user. It's not clear what to do with the "timeout" and "sticky" parameters.{color}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)