Class DeterministicMapOrderGenericDatumWriter<T>

java.lang.Object
org.apache.avro.generic.GenericDatumWriter<T>
org.apache.avro.generic.DeterministicMapOrderGenericDatumWriter<T>
All Implemented Interfaces:
DeterministicMapOrderDatumWriter, org.apache.avro.io.DatumWriter<T>

public class DeterministicMapOrderGenericDatumWriter<T> extends org.apache.avro.generic.GenericDatumWriter<T> implements DeterministicMapOrderDatumWriter
An Avro generic datum writer that sorts the map entries by keys before serializing the map. In original Avro implementation GenericDatumWriter Avro gets all entries from the Map and serializes the entries right away. This may generate inconsistent results if 2 maps have the same entry set but are constructed in the different orders. A specific datum writer is also provided. See DeterministicMapOrderSpecificDatumWriter for more details. TODO: consider putting the class to Fast Avro library
  • Constructor Details

    • DeterministicMapOrderGenericDatumWriter

      public DeterministicMapOrderGenericDatumWriter(org.apache.avro.Schema root)
    • DeterministicMapOrderGenericDatumWriter

      public DeterministicMapOrderGenericDatumWriter(org.apache.avro.generic.GenericData data)
    • DeterministicMapOrderGenericDatumWriter

      public DeterministicMapOrderGenericDatumWriter(org.apache.avro.Schema root, org.apache.avro.generic.GenericData data)
  • Method Details