You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Mikhail Cherkasov <mc...@gridgain.com> on 2017/09/22 16:47:51 UTC

Warning if no table for BinaryObject

Hi all,

I've seen several times that due wrong cache configuration people can't
find
data in cache and blame Ignite that it's buggy and doesn't work.

And it's very difficult to find an error in the code, especially if you
don't have reach experience with Ignite.

One of the very common case is that user specifys a name to QueryEntity
value type:
    queryEntity.setValueType("MyCoolName")
and later put data to cache like:
    ignite.binary.toBinary(value)

The example is simple and the error is obvious when you see this two lines
close to each other, however, in real life, cache definition and data
ingestion are separated by tons of code.

We can save a lot of man-hours for our users if Ignite will print a warning
If a cache has a configured QE and user puts BinaryObject with typeName
which doesn't correspond to any QE.

The warning should be printed only once, something like:
[WARN] No table is found for %typeName% binary object.

Thoughts?


-- 
Thanks,
Mikhail.

Re: Warning if no table for BinaryObject

Posted by Pavel Tupitsyn <pt...@apache.org>.
We could even add a configuration switch to throw an exception in such case.

I guess that in majority of use cases there is a single type per cache,
and we should have a way to enforce that.

On Fri, Sep 22, 2017 at 7:47 PM, Mikhail Cherkasov <mc...@gridgain.com>
wrote:

> Hi all,
>
> I've seen several times that due wrong cache configuration people can't
> find
> data in cache and blame Ignite that it's buggy and doesn't work.
>
> And it's very difficult to find an error in the code, especially if you
> don't have reach experience with Ignite.
>
> One of the very common case is that user specifys a name to QueryEntity
> value type:
>     queryEntity.setValueType("MyCoolName")
> and later put data to cache like:
>     ignite.binary.toBinary(value)
>
> The example is simple and the error is obvious when you see this two lines
> close to each other, however, in real life, cache definition and data
> ingestion are separated by tons of code.
>
> We can save a lot of man-hours for our users if Ignite will print a warning
> If a cache has a configured QE and user puts BinaryObject with typeName
> which doesn't correspond to any QE.
>
> The warning should be printed only once, something like:
> [WARN] No table is found for %typeName% binary object.
>
> Thoughts?
>
>
> --
> Thanks,
> Mikhail.
>

Re: Warning if no table for BinaryObject

Posted by Mikhail Cherkasov <mc...@gridgain.com>.
Hi Denis,

I filed a ticket: https://issues.apache.org/jira/browse/IGNITE-6528

Thanks,
Mikhail.

On Tue, Sep 26, 2017 at 6:58 PM, Denis Magda <dm...@apache.org> wrote:

> Mikhail,
>
> Could you prepare a properly described ticket encompassing the suggested
> warning? Let’s do the improvement for the upcoming release.
>
> —
> Denis
>
> > On Sep 26, 2017, at 7:23 AM, Mikhail Cherkasov <mc...@gridgain.com>
> wrote:
> >
> > Hi Dmitry,
> >
> > The problem is that we don't have strong typing when defining QueryEntriy
> > and a user can use an arbitrary string id to
> > define a type, but he should use the same string id to obtain binary
> object
> > builder, however, people sometimes confusing this.
> > So the user can define QueryEntity with value type:
> > queryEntity.setValueType("MyCoolName") and
> > later put to cache the following binary object:
> > ignite.binary.toBinary(value), but this object won't be indexed, because
> > ignite.binary.toBinary uses class name as string id while indexing
> expects
> > to find "MyCoolName" as id.
> >
> > There's no bug in ignite about this, but I think the warning can make
> > users' life easy and
> > make ignite configuration more friendly to new users.
> >
> > Thanks,
> > Mikhail.
> >
> >
> >
> >
> > On Tue, Sep 26, 2017 at 8:15 AM, Yakov Zhdanov <yz...@apache.org>
> wrote:
> >
> >> Pavel, we can optionally enforce that, but not by default.
> >>
> >> Dmitry, the problem is the following. User configures Ignite cache and
> >> query entity, does several puts than empty results for SQL. The reason
> is
> >> very simple - typo in class name or simply different classes in
> >> configuration and of actual cache entry. The fix is pretty simple and
> make
> >> product more usable.
> >>
> >> --Yakov
> >>
> >
> >
> >
> > --
> > Thanks,
> > Mikhail.
>
>


-- 
Thanks,
Mikhail.

Re: Warning if no table for BinaryObject

Posted by Denis Magda <dm...@apache.org>.
Mikhail,

Could you prepare a properly described ticket encompassing the suggested warning? Let’s do the improvement for the upcoming release.

—
Denis

> On Sep 26, 2017, at 7:23 AM, Mikhail Cherkasov <mc...@gridgain.com> wrote:
> 
> Hi Dmitry,
> 
> The problem is that we don't have strong typing when defining QueryEntriy
> and a user can use an arbitrary string id to
> define a type, but he should use the same string id to obtain binary object
> builder, however, people sometimes confusing this.
> So the user can define QueryEntity with value type:
> queryEntity.setValueType("MyCoolName") and
> later put to cache the following binary object:
> ignite.binary.toBinary(value), but this object won't be indexed, because
> ignite.binary.toBinary uses class name as string id while indexing expects
> to find "MyCoolName" as id.
> 
> There's no bug in ignite about this, but I think the warning can make
> users' life easy and
> make ignite configuration more friendly to new users.
> 
> Thanks,
> Mikhail.
> 
> 
> 
> 
> On Tue, Sep 26, 2017 at 8:15 AM, Yakov Zhdanov <yz...@apache.org> wrote:
> 
>> Pavel, we can optionally enforce that, but not by default.
>> 
>> Dmitry, the problem is the following. User configures Ignite cache and
>> query entity, does several puts than empty results for SQL. The reason is
>> very simple - typo in class name or simply different classes in
>> configuration and of actual cache entry. The fix is pretty simple and make
>> product more usable.
>> 
>> --Yakov
>> 
> 
> 
> 
> -- 
> Thanks,
> Mikhail.


Re: Warning if no table for BinaryObject

Posted by Mikhail Cherkasov <mc...@gridgain.com>.
Hi Dmitry,

The problem is that we don't have strong typing when defining QueryEntriy
and a user can use an arbitrary string id to
define a type, but he should use the same string id to obtain binary object
builder, however, people sometimes confusing this.
So the user can define QueryEntity with value type:
 queryEntity.setValueType("MyCoolName") and
later put to cache the following binary object:
ignite.binary.toBinary(value), but this object won't be indexed, because
ignite.binary.toBinary uses class name as string id while indexing expects
to find "MyCoolName" as id.

There's no bug in ignite about this, but I think the warning can make
users' life easy and
make ignite configuration more friendly to new users.

Thanks,
Mikhail.




On Tue, Sep 26, 2017 at 8:15 AM, Yakov Zhdanov <yz...@apache.org> wrote:

> Pavel, we can optionally enforce that, but not by default.
>
> Dmitry, the problem is the following. User configures Ignite cache and
> query entity, does several puts than empty results for SQL. The reason is
> very simple - typo in class name or simply different classes in
> configuration and of actual cache entry. The fix is pretty simple and make
> product more usable.
>
> --Yakov
>



-- 
Thanks,
Mikhail.

Re: Warning if no table for BinaryObject

Posted by Yakov Zhdanov <yz...@apache.org>.
Pavel, we can optionally enforce that, but not by default.

Dmitry, the problem is the following. User configures Ignite cache and
query entity, does several puts than empty results for SQL. The reason is
very simple - typo in class name or simply different classes in
configuration and of actual cache entry. The fix is pretty simple and make
product more usable.

--Yakov

Re: Warning if no table for BinaryObject

Posted by Dmitriy Setrakyan <ds...@apache.org>.
On Fri, Sep 22, 2017 at 9:47 AM, Mikhail Cherkasov <mc...@gridgain.com>
wrote:

> Hi all,
>
> I've seen several times that due wrong cache configuration people can't
> find
> data in cache and blame Ignite that it's buggy and doesn't work.
>
> And it's very difficult to find an error in the code, especially if you
> don't have reach experience with Ignite.
>
> One of the very common case is that user specifys a name to QueryEntity
> value type:
>     queryEntity.setValueType("MyCoolName")
> and later put data to cache like:
>     ignite.binary.toBinary(value)
>
> The example is simple and the error is obvious when you see this two lines
> close to each other, however, in real life, cache definition and data
> ingestion are separated by tons of code.
>
>
Mikhail, the example may be simple and obvious to some, but not to most
(including me). Can you please explain what it is we are trying to solve?
What is wrong with the above code snippet?