Non-intrusive way to detect which type is using kryo ?

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

Non-intrusive way to detect which type is using kryo ?

Kien Truong
Hi,

Are there any way to only log when Kryo serializer is used? It's a pain to disable generic type then try to solve the exception one by one.

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

Re: Non-intrusive way to detect which type is using kryo ?

Antoine Philippot
Hi Kien,

The only way I found is to add this line at the beginning of the application to detect kryo serialization : 
`com.esotericsoftware.minlog.Log.set(Log.LEVEL_DEBUG)`

Antoine

Le mar. 28 nov. 2017 à 02:41, Kien Truong <[hidden email]> a écrit :
Hi,

Are there any way to only log when Kryo serializer is used? It's a pain to disable generic type then try to solve the exception one by one.

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

Re: Non-intrusive way to detect which type is using kryo ?

Timo Walther
In reply to this post by Kien Truong
Hi Kien,

at the moment I'm working on some improvements to the type system that
will make it easier to tell if a type is a POJO or not. I have some
utility in mind like `ensurePojo(MyType.class)` that would throw an
exception with a reason why this type must be treated as a generic type.

Would this help in your case?

Regards,
Timo

Am 11/28/17 um 2:40 AM schrieb Kien Truong:
> Hi,
>
> Are there any way to only log when Kryo serializer is used? It's a
> pain to disable generic type then try to solve the exception one by one.
>
> Best regards,
> Kien


Reply | Threaded
Open this post in threaded view
|

Re: Non-intrusive way to detect which type is using kryo ?

Kien Truong
Hi Timo,

Having a utility like that would be great. It'd be even better if it's
can be executed without having to actually run a cluster.


Best regards,

Kien


On 11/28/2017 3:39 PM, Timo Walther wrote:

> Hi Kien,
>
> at the moment I'm working on some improvements to the type system that
> will make it easier to tell if a type is a POJO or not. I have some
> utility in mind like `ensurePojo(MyType.class)` that would throw an
> exception with a reason why this type must be treated as a generic type.
>
> Would this help in your case?
>
> Regards,
> Timo
>
> Am 11/28/17 um 2:40 AM schrieb Kien Truong:
>> Hi,
>>
>> Are there any way to only log when Kryo serializer is used? It's a
>> pain to disable generic type then try to solve the exception one by one.
>>
>> Best regards,
>> Kien
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Non-intrusive way to detect which type is using kryo ?

Timo Walther
Generally, you don't need to run it on the cluster. Types are available
in the so-called pre-flight phase (before calling env.execute()). So you
can just print the types in your IDE while developing:
"println(stream.getType)"

Regards,
Timo


Am 12/1/17 um 1:42 PM schrieb Kien Truong:

> Hi Timo,
>
> Having a utility like that would be great. It'd be even better if it's
> can be executed without having to actually run a cluster.
>
>
> Best regards,
>
> Kien
>
>
> On 11/28/2017 3:39 PM, Timo Walther wrote:
>> Hi Kien,
>>
>> at the moment I'm working on some improvements to the type system
>> that will make it easier to tell if a type is a POJO or not. I have
>> some utility in mind like `ensurePojo(MyType.class)` that would throw
>> an exception with a reason why this type must be treated as a generic
>> type.
>>
>> Would this help in your case?
>>
>> Regards,
>> Timo
>>
>> Am 11/28/17 um 2:40 AM schrieb Kien Truong:
>>> Hi,
>>>
>>> Are there any way to only log when Kryo serializer is used? It's a
>>> pain to disable generic type then try to solve the exception one by
>>> one.
>>>
>>> Best regards,
>>> Kien
>>
>>