Skip to content

Schema registry 4/N - #1381

Merged
merlimat merged 138 commits into
apache:masterfrom
mgodave:schema-registry-4
Apr 6, 2018
Merged

Schema registry 4/N#1381
merlimat merged 138 commits into
apache:masterfrom
mgodave:schema-registry-4

Conversation

@mgodave

@mgodave mgodave commented Mar 14, 2018

Copy link
Copy Markdown
Contributor

See #1137 for reference

Dave Rusek added 30 commits February 12, 2018 18:09
# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
#	pulsar-common/src/main/java/org/apache/pulsar/common/api/Commands.java

@sijie sijie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@merlimat merlimat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, just a couple of questions on the removed fields from protobuf

byte[] encode(T message);
T decode(byte[] bytes);

SchemaInfo getSchemaInfo();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If SchemaInfo becomes part of API, we should move it in the same ..client.api package

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used in multiple places. Are you suggesting I keep it in common but add it to the client package?

private State state;

private final ConcurrentLongHashMap<CompletableFuture<Pair<String, Long>>> pendingRequests = new ConcurrentLongHashMap<>(
private final ConcurrentLongHashMap<CompletableFuture<Triple<String, Long, byte[]>>> pendingRequests = new ConcurrentLongHashMap<>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could switch to a named class instead of the Triple so that it's easier to follow the meaning of each of them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I had a similar thought but took the easy way out :-( I'll add a named class.


message CommandSuccess {
required uint64 request_id = 1;
optional Schema schema = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this needed to get the consumer to be able to auto-discover the schema at the subscribe time?

}

required string name = 1;
required bytes version = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we need to know the version in some cases?

I'd imagine that a producer deriving the schema from a class type, won't know the version. But a consumer receiving a schema, might need the version?

Dave Rusek added 3 commits April 2, 2018 09:55
# Conflicts:
#	pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
#	pulsar-common/src/main/java/org/apache/pulsar/common/api/Commands.java

@merlimat merlimat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@merlimat

merlimat commented Apr 2, 2018

Copy link
Copy Markdown
Contributor

@mgodave there's a file that's missing the license header: ProducerResponse.java

@merlimat

merlimat commented Apr 3, 2018

Copy link
Copy Markdown
Contributor

@mgodave please merge with master again and it should go through CI this time.

@merlimat

merlimat commented Apr 5, 2018

Copy link
Copy Markdown
Contributor

@mgodave there is a conflict with a change that went into master again, sorry.

I had changed getTopicReference() to return Optional<Topic>

@merlimat merlimat added the type/feature The PR added a new feature or issue requested a new feature label Apr 6, 2018
@merlimat merlimat added this to the 2.0.0-incubating milestone Apr 6, 2018
@sijie

sijie commented Apr 6, 2018

Copy link
Copy Markdown
Member

retest this please

@merlimat
merlimat merged commit 1eb8068 into apache:master Apr 6, 2018
@mgodave
mgodave deleted the schema-registry-4 branch April 9, 2018 15:32
codelipenghui pushed a commit that referenced this pull request Jun 13, 2022
#16026)

Cherry-pick #15956.
### Motivation
Currently, we need admin permissions to operate the schema API. This is because the admin permission was defined when the schema API was first added. See #1381.
Later, then adding authentication granularity with #6428, we don't change the schema API part.  So leave the admin permission today.

But the binary protocol allows the produce/consume permission to get the schema, so change the related method permission to `produce/consume`.
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jun 13, 2022
…#15956) (apache#16026)

Cherry-pick apache#15956.
### Motivation
Currently, we need admin permissions to operate the schema API. This is because the admin permission was defined when the schema API was first added. See apache#1381.
Later, then adding authentication granularity with apache#6428, we don't change the schema API part.  So leave the admin permission today.

But the binary protocol allows the produce/consume permission to get the schema, so change the related method permission to `produce/consume`.

(cherry picked from commit f3b4e86)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature The PR added a new feature or issue requested a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants