Skip to content

Schema registry 3/N - #1363

Merged
merlimat merged 79 commits into
apache:masterfrom
mgodave:schema-registry-3
Mar 14, 2018
Merged

merlimat merged 79 commits into
apache:masterfrom
mgodave:schema-registry-3

Conversation

@mgodave

@mgodave mgodave commented Mar 9, 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
Dave Rusek added 18 commits March 2, 2018 14:10
# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
#	pulsar-common/pom.xml
# Conflicts:
#	pulsar-broker/pom.xml
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaStorage.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/StoredSchema.java
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/proto/SchemaRegistryFormat.java
#	pulsar-common/src/main/java/org/apache/pulsar/common/schema/EmptyVersion.java
#	pulsar-common/src/main/java/org/apache/pulsar/common/schema/SchemaData.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.

Looks good

* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>

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.

The <p> is failing the license check

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.

ok, just re-ran the formatter.

@VisibleForTesting
public void init() throws KeeperException, InterruptedException {
try {
zooKeeper.create(SchemaPath, new byte[]{}, Acl, CreateMode.PERSISTENT);

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.

Every time we do this it will actually do the write the operation on journal and then log something in zk server that it failed.

If it's very unlikely that the condition is true (just the very first time), we do and exists() call to avoid the write.

@Override
public SchemaVersion versionFromBytes(byte[] version) {
ByteBuffer bb = ByteBuffer.wrap(version);
return new LongSchemaVersion(bb.get());

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.

get() is just reading the first byte here and ignoring the remaining 7

@mgodave mgodave Mar 12, 2018 •

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.

Yup. Good catch. it was a type it should have been getLong() but I guess the tests pass since the version numbers tend to be low and fit within the first byte.

@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 merged commit 80dc0de into apache:master Mar 14, 2018
@mgodave
mgodave deleted the schema-registry-3 branch March 14, 2018 15:28
sijie pushed a commit to sijie/pulsar that referenced this pull request Aug 26, 2020
zymap pushed a commit to zymap/pulsar that referenced this pull request Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants