mirror of https://github.com/apache/nifi.git
NIFI-3775: This closes #1735. Ensure that a '0' byte is written out to Hortonworks Encoded Schema Reference header to indicate that GenericRecord is being used
Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
parent
16f37763f6
commit
daa277b067
|
@ -46,7 +46,7 @@ public class HortonworksEncodedSchemaReferenceStrategy implements SchemaAccessSt
|
|||
|
||||
@Override
|
||||
public RecordSchema getSchema(final FlowFile flowFile, final InputStream contentStream) throws SchemaNotFoundException, IOException {
|
||||
final byte[] buffer = new byte[13];
|
||||
final byte[] buffer = new byte[14];
|
||||
try {
|
||||
StreamUtils.fillBuffer(contentStream, buffer);
|
||||
} catch (final IOException ioe) {
|
||||
|
|
|
@ -43,10 +43,11 @@ public class HortonworksEncodedSchemaReferenceWriter implements SchemaAccessWrit
|
|||
// This decoding follows the pattern that is provided for serializing data by the Hortonworks Schema Registry serializer
|
||||
// as it is provided at:
|
||||
// https://github.com/hortonworks/registry/blob/master/schema-registry/serdes/src/main/java/com/hortonworks/registries/schemaregistry/serdes/avro/AvroSnapshotSerializer.java
|
||||
final ByteBuffer bb = ByteBuffer.allocate(13);
|
||||
final ByteBuffer bb = ByteBuffer.allocate(14);
|
||||
bb.put((byte) LATEST_PROTOCOL_VERSION);
|
||||
bb.putLong(id);
|
||||
bb.putInt(version);
|
||||
bb.put((byte) 0); // We always use generic records
|
||||
|
||||
out.write(bb.array());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue