drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacques Nadeau <jacq...@apache.org>
Subject Re: decoding JsonTypeInfo on StoragePluginConfig
Date Mon, 13 Jul 2015 22:54:16 GMT
See here:

http://fasterxml.github.io/jackson-annotations/javadoc/2.4/com/fasterxml/jackson/annotation/JsonTypeInfo.html

Basically, this states that when encoding/decoding from JSON, the "type"
field is used to determine which subclass of StoragePluginConfig should be
materialized.  It also says to store the "type" field as a property inside
the object to be serialized/deserialized.  (Note, another option is to hold
this in a separate container as a WRAPPER_OBJECT).

Interface: probably(?)

Initially there were certain bugs inside of Jackson that caused issues when
using interfaces for certain things.

(As a side commentary, my sense is that people have started moving away
from interfaces in java and towards abstract classes since enhancements can
be given default implementations rather than breaking downstream projects.
We saw this extensively in the move from Hadoop 1 to Hadoop 2.  As such, I
think we should be cautious about when and if we use interfaces.)

On Mon, Jul 13, 2015 at 11:33 AM, Daniel Barclay <dbarclay@maprtech.com>
wrote:

> What exactly does the following Jackson @JsonTypeInfo annotation on
> org.apache.drill.common.logical.StoragePluginConfig do?:
>
>
>   @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include =
> JsonTypeInfo.As.PROPERTY, property="type")
>   public abstract class StoragePluginConfig {
>
>
> Also, would that annotation still have the desired effect if
> StoragePluginConfig were an interface?
>
>
> Daniel
> --
> Daniel Barclay
> MapR Technologies
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message