You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dawid Wysakowicz (Jira)" <ji...@apache.org> on 2020/02/09 17:20:00 UTC

[jira] [Updated] (FLINK-15941) ConfluentSchemaRegistryCoder should not perform HTTP requests for all request

     [ https://issues.apache.org/jira/browse/FLINK-15941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dawid Wysakowicz updated FLINK-15941:
-------------------------------------
    Description:     (was: ConfluentSchemaRegistryCoder should cache ids of schemas that it has already seen.

I think it should be as simple as changing
{code}
	@Override
	public void writeSchema(Schema schema, OutputStream out) throws IOException {
		try {
			int registeredId = schemaRegistryClient.register(subject, schema);
			out.write(CONFLUENT_MAGIC_BYTE);
			byte[] schemaIdBytes = ByteBuffer.allocate(4).putInt(registeredId).array();
			out.write(schemaIdBytes);
		} catch (RestClientException e) {
			throw new IOException("Could not register schema in registry", e);
		}
	}
{code}

to

{code}
	@Override
	public void writeSchema(Schema schema, OutputStream out) throws IOException {
		try {
			int registeredId = schemaRegistryClient.getId(subject, schema);
			out.write(CONFLUENT_MAGIC_BYTE);
			byte[] schemaIdBytes = ByteBuffer.allocate(4).putInt(registeredId).array();
			out.write(schemaIdBytes);
		} catch (RestClientException e) {
			throw new IOException("Could not register schema in registry", e);
		}
	}
{code})

> ConfluentSchemaRegistryCoder should not perform HTTP requests for all request
> -----------------------------------------------------------------------------
>
>                 Key: FLINK-15941
>                 URL: https://issues.apache.org/jira/browse/FLINK-15941
>             Project: Flink
>          Issue Type: Improvement
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>            Reporter: Dawid Wysakowicz
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)