Removal of "default" cache from REST APIs

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Removal of "default" cache from REST APIs

Evgeniy Rudenko
Hi guys,

Most of the cache APIs are trying to use "default" cache when cacheName is
not provided. This is pointless, because we don't have such cache by
default. I would like to change that and just return "Failed to find
mandatory parameter in request" error if name is absent.

Please tell if you have any concerns. Update can be found at
https://github.com/apache/ignite/pull/8041

--
Best regards,
Evgeniy
Reply | Threaded
Open this post in threaded view
|

Re: Removal of "default" cache from REST APIs

Saikat Maitra
Hi Evgeniy,

The default cacheName is safe fallback when cache name is not provided in
the request. It is part of rest document.

https://apacheignite.readme.io/docs/rest-api#put

When request do not have cacheName since it is optional param then this
DFLT_CACHE_NAME is used
https://github.com/apache/ignite/pull/8041/files#diff-a3477d5e0cfdfcceed3371fc899a9d15L30

Regards,
Saikat

On Wed, Jul 15, 2020 at 10:43 PM Evgeniy Rudenko <[hidden email]>
wrote:

> Hi guys,
>
> Most of the cache APIs are trying to use "default" cache when cacheName is
> not provided. This is pointless, because we don't have such cache by
> default. I would like to change that and just return "Failed to find
> mandatory parameter in request" error if name is absent.
>
> Please tell if you have any concerns. Update can be found at
> https://github.com/apache/ignite/pull/8041
>
> --
> Best regards,
> Evgeniy
>
Reply | Threaded
Open this post in threaded view
|

Re: Removal of "default" cache from REST APIs

Evgeniy Rudenko
Hi Saikat,

I understand this, but as I wrote this is pointless. It is not safe
fallback, because there is no "default" cache. If you will try to use any
API without a name you will receive the following error:

*org.apache.ignite.IgniteCheckedException: Failed to find cache for given
cache name: default*

Better to replace it by the correctly formed error message that will point
to the actual problem of the request. API documents will be updated
accordingly when PR will be merged.

On Sun, Jul 19, 2020 at 12:56 AM Saikat Maitra <[hidden email]>
wrote:

> Hi Evgeniy,
>
> The default cacheName is safe fallback when cache name is not provided in
> the request. It is part of rest document.
>
> https://apacheignite.readme.io/docs/rest-api#put
>
> When request do not have cacheName since it is optional param then this
> DFLT_CACHE_NAME is used
>
> https://github.com/apache/ignite/pull/8041/files#diff-a3477d5e0cfdfcceed3371fc899a9d15L30
>
> Regards,
> Saikat
>
> On Wed, Jul 15, 2020 at 10:43 PM Evgeniy Rudenko <[hidden email]>
> wrote:
>
> > Hi guys,
> >
> > Most of the cache APIs are trying to use "default" cache when cacheName
> is
> > not provided. This is pointless, because we don't have such cache by
> > default. I would like to change that and just return "Failed to find
> > mandatory parameter in request" error if name is absent.
> >
> > Please tell if you have any concerns. Update can be found at
> > https://github.com/apache/ignite/pull/8041
> >
> > --
> > Best regards,
> > Evgeniy
> >
>


--
Best regards,
Evgeniy
Reply | Threaded
Open this post in threaded view
|

Re: Removal of "default" cache from REST APIs

Saikat Maitra
Hi Evgeniy,

Can you please confirm in your configuration you have this example config
file.

https://github.com/apache/ignite/blob/master/examples/config/example-cache.xml#L26-L32

This has instructions on default cache config.

My understanding is when node startup then the default cache should already
be available.

Regards
Saikat

On Sun, Jul 19, 2020 at 11:21 PM Evgeniy Rudenko <[hidden email]>
wrote:

> Hi Saikat,
>
> I understand this, but as I wrote this is pointless. It is not safe
> fallback, because there is no "default" cache. If you will try to use any
> API without a name you will receive the following error:
>
> *org.apache.ignite.IgniteCheckedException: Failed to find cache for given
> cache name: default*
>
> Better to replace it by the correctly formed error message that will point
> to the actual problem of the request. API documents will be updated
> accordingly when PR will be merged.
>
> On Sun, Jul 19, 2020 at 12:56 AM Saikat Maitra <[hidden email]>
> wrote:
>
> > Hi Evgeniy,
> >
> > The default cacheName is safe fallback when cache name is not provided in
> > the request. It is part of rest document.
> >
> > https://apacheignite.readme.io/docs/rest-api#put
> >
> > When request do not have cacheName since it is optional param then this
> > DFLT_CACHE_NAME is used
> >
> >
> https://github.com/apache/ignite/pull/8041/files#diff-a3477d5e0cfdfcceed3371fc899a9d15L30
> >
> > Regards,
> > Saikat
> >
> > On Wed, Jul 15, 2020 at 10:43 PM Evgeniy Rudenko <[hidden email]>
> > wrote:
> >
> > > Hi guys,
> > >
> > > Most of the cache APIs are trying to use "default" cache when cacheName
> > is
> > > not provided. This is pointless, because we don't have such cache by
> > > default. I would like to change that and just return "Failed to find
> > > mandatory parameter in request" error if name is absent.
> > >
> > > Please tell if you have any concerns. Update can be found at
> > > https://github.com/apache/ignite/pull/8041
> > >
> > > --
> > > Best regards,
> > > Evgeniy
> > >
> >
>
>
> --
> Best regards,
> Evgeniy
>
Reply | Threaded
Open this post in threaded view
|

Re: Removal of "default" cache from REST APIs

Ilya Kasnacheev
Hello!

It is only available for example node startup shipped with our examples.

However, it is not available when you just start a node from a downloaded
distribution.

I concur that we should no longer rely on "default" cache.

Regards,
--
Ilya Kasnacheev


ср, 22 июл. 2020 г. в 03:09, Saikat Maitra <[hidden email]>:

> Hi Evgeniy,
>
> Can you please confirm in your configuration you have this example config
> file.
>
>
> https://github.com/apache/ignite/blob/master/examples/config/example-cache.xml#L26-L32
>
> This has instructions on default cache config.
>
> My understanding is when node startup then the default cache should already
> be available.
>
> Regards
> Saikat
>
> On Sun, Jul 19, 2020 at 11:21 PM Evgeniy Rudenko <[hidden email]>
> wrote:
>
> > Hi Saikat,
> >
> > I understand this, but as I wrote this is pointless. It is not safe
> > fallback, because there is no "default" cache. If you will try to use any
> > API without a name you will receive the following error:
> >
> > *org.apache.ignite.IgniteCheckedException: Failed to find cache for given
> > cache name: default*
> >
> > Better to replace it by the correctly formed error message that will
> point
> > to the actual problem of the request. API documents will be updated
> > accordingly when PR will be merged.
> >
> > On Sun, Jul 19, 2020 at 12:56 AM Saikat Maitra <[hidden email]>
> > wrote:
> >
> > > Hi Evgeniy,
> > >
> > > The default cacheName is safe fallback when cache name is not provided
> in
> > > the request. It is part of rest document.
> > >
> > > https://apacheignite.readme.io/docs/rest-api#put
> > >
> > > When request do not have cacheName since it is optional param then this
> > > DFLT_CACHE_NAME is used
> > >
> > >
> >
> https://github.com/apache/ignite/pull/8041/files#diff-a3477d5e0cfdfcceed3371fc899a9d15L30
> > >
> > > Regards,
> > > Saikat
> > >
> > > On Wed, Jul 15, 2020 at 10:43 PM Evgeniy Rudenko <
> [hidden email]>
> > > wrote:
> > >
> > > > Hi guys,
> > > >
> > > > Most of the cache APIs are trying to use "default" cache when
> cacheName
> > > is
> > > > not provided. This is pointless, because we don't have such cache by
> > > > default. I would like to change that and just return "Failed to find
> > > > mandatory parameter in request" error if name is absent.
> > > >
> > > > Please tell if you have any concerns. Update can be found at
> > > > https://github.com/apache/ignite/pull/8041
> > > >
> > > > --
> > > > Best regards,
> > > > Evgeniy
> > > >
> > >
> >
> >
> > --
> > Best regards,
> > Evgeniy
> >
>