New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema registry 3/N #1363
Schema registry 3/N #1363
Conversation
# 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
# 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
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
See #1137 for reference