Warning if no table for BinaryObject

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

Warning if no table for BinaryObject

Mikhail Cherkasov
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.
Reply | Threaded
Open this post in threaded view
|

Re: Warning if no table for BinaryObject

Pavel Tupitsyn
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 <[hidden email]>
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.
>
Reply | Threaded
Open this post in threaded view
|

Re: Warning if no table for BinaryObject

dsetrakyan
In reply to this post by Mikhail Cherkasov
On Fri, Sep 22, 2017 at 9:47 AM, Mikhail Cherkasov <[hidden email]>
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?
Reply | Threaded
Open this post in threaded view
|

Re: Warning if no table for BinaryObject

yzhdanov
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
Reply | Threaded
Open this post in threaded view
|

Re: Warning if no table for BinaryObject

Mikhail Cherkasov
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 <[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

Re: Warning if no table for BinaryObject

dmagda
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 <[hidden email]> 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 <[hidden email]> 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.

Reply | Threaded
Open this post in threaded view
|

Re: Warning if no table for BinaryObject

Mikhail Cherkasov
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 <[hidden email]> 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 <[hidden email]>
> 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 <[hidden email]>
> 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.