org.hibernate.search.indexes.serialization.avro.impl

## Class AvroSerializationProvider

- java.lang.Object
- - org.hibernate.search.indexes.serialization.avro.impl.AvroSerializationProvider

- All Implemented Interfaces:
    Service, SerializationProvider

      public class AvroSerializationProvider
      extends Object
      implements SerializationProvider

  Avro based implementation of `SerializationProvider`.

  Parsing code inspired by http://www.infoq.com/articles/ApacheAvro from Boris Lublinsky

  Before the actual serialized flux, two bytes are reserved:

  - majorVersion
  - minorVersion
  A major version increase implies an incompatible protocol change. Messages of a `majorVersion > current version` should be refused.

  A minor version increase implies a compatible protocol change. Messages of a `minorVersion > current version` are parsed, but new operation will be ignored or rejected.

  If message's `major version is < current version`, then the implementation is strongly encouraged to parse and process them. It is mandatory if only message's `code minor version is < current version`.

  Author:
    Emmanuel Bernard <emmanuel@hibernate.org>, Hardy Ferentschik

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AvroSerializationProvider()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Deserializer` | `getDeserializer()` This method will be invoked when any thread needs a Deserializer: implementors of this Service can return the same instance multiple times if the Deserializer implementation is threadsafe.
    `static int` | `getMajorVersion()`
    `static int` | `getMinorVersion()`
    `Serializer` | `getSerializer()` This method will be invoked when any thread needs a Serializer: implementors of this Service can return the same instance multiple times if the Serializer implementation is threadsafe.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### AvroSerializationProvider

          public AvroSerializationProvider()

  - ### Method Detail

    - #### getMajorVersion

          public static int getMajorVersion()

    - #### getMinorVersion

          public static int getMinorVersion()

    - #### getSerializer

          public Serializer getSerializer()

      Description copied from interface: `SerializationProvider`
      This method will be invoked when any thread needs a Serializer: implementors of this Service can return the same instance multiple times if the Serializer implementation is threadsafe. In all other cases return a new instance. An obtained Serializer should not be shared across threads.
      Specified by:
        `getSerializer` in interface `SerializationProvider`
      Returns:
        the initialized Serializer ready for usage

    - #### getDeserializer

          public Deserializer getDeserializer()

      Description copied from interface: `SerializationProvider`
      This method will be invoked when any thread needs a Deserializer: implementors of this Service can return the same instance multiple times if the Deserializer implementation is threadsafe. In all other cases return a new instance. An obtained Deserializer should not be shared across threads.
      Specified by:
        `getDeserializer` in interface `SerializationProvider`
      Returns:
        the initialized Deserializer ready for usage

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved