if(keySerializerDefinition.hasVersion()) {
Map<Integer, String> versions = new HashMap<Integer, String>();
for(Map.Entry<Integer, String> entry: keySerializerDefinition.getAllSchemaInfoVersions()
.entrySet())
versions.put(entry.getKey(), entry.getValue());
keySerializer = new AvroVersionedGenericSerializer(versions);
} else
keySerializer = new AvroVersionedGenericSerializer(keySerializerDefinition.getCurrentSchemaInfo());
if(valueSerializerDefinition.hasVersion()) {
Map<Integer, String> versions = new HashMap<Integer, String>();
for(Map.Entry<Integer, String> entry: valueSerializerDefinition.getAllSchemaInfoVersions()
.entrySet())
versions.put(entry.getKey(), entry.getValue());
valueSerializer = new AvroVersionedGenericSerializer(versions);
} else
valueSerializer = new AvroVersionedGenericSerializer(valueSerializerDefinition.getCurrentSchemaInfo());
}
} catch(Exception e) {
throw new RuntimeException(e);