forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Schema Registry proto changes * Infrastructure to store schemas * A default schema registry implementation * Renumber schema fields * Update Pulsar API with schema changes * Revert field number change * Fix merge conflict * Fix broken merge * Address issues in review * Add schema type back to proto definition * Address comments regarding lombok usage * Remove reserved future enum fields * regenerate code from protobuf * Remove unused code * Add schema version to producer success message * plumb schema through to producer * Revert "Add schema version to producer success message" This reverts commit e7e72f4. * Revert "Revert "Add schema version to producer success message"" This reverts commit 7b902f6. * Persist schema on producer connect * Add principal to schema on publish * Reformat function for readability * Remove unused protoc profile * Rename put on schema registry to putIfAbsent * Reformat function for readability * Remove unused protoc profile * Rename put on schema registry to putIfAbsent * fix compile errors from parent branch changes * fix lombok tomfoolery on builder * plumb hash through and allow lookup by data * wip * run tests * wip: address review comments * switch underscore to slash in schema name * blah * Get duplicate schema detection to work * Fix protobuf version incompatibility * fix merge issues * Fix license headers * Address review
- Loading branch information
Showing
11 changed files
with
2,702 additions
and
4 deletions.
There are no files selected for viewing
479 changes: 479 additions & 0 deletions
479
...broker/src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorage.java
Large diffs are not rendered by default.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...src/main/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorageFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pulsar.broker.service.schema; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import org.apache.pulsar.broker.PulsarService; | ||
|
||
@SuppressWarnings("unused") | ||
public class BookkeeperSchemaStorageFactory implements SchemaStorageFactory { | ||
@Override | ||
@NotNull | ||
public SchemaStorage create(PulsarService pulsar) throws Exception { | ||
BookkeeperSchemaStorage service = new BookkeeperSchemaStorage(pulsar); | ||
service.init(); | ||
return service; | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/LongSchemaVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* 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 | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pulsar.broker.service.schema; | ||
|
||
import com.google.common.base.MoreObjects; | ||
import java.nio.ByteBuffer; | ||
import java.util.Objects; | ||
import org.apache.pulsar.common.schema.SchemaVersion; | ||
|
||
class LongSchemaVersion implements SchemaVersion { | ||
private final long version; | ||
|
||
LongSchemaVersion(long version) { | ||
this.version = version; | ||
} | ||
|
||
public long getVersion() { | ||
return version; | ||
} | ||
|
||
@Override | ||
public byte[] bytes() { | ||
ByteBuffer buffer = ByteBuffer.allocate(Long.SIZE); | ||
buffer.putLong(version); | ||
buffer.rewind(); | ||
return buffer.array(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
LongSchemaVersion that = (LongSchemaVersion) o; | ||
return version == that.version; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
|
||
return Objects.hash(version); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return MoreObjects.toStringHelper(this) | ||
.add("version", version) | ||
.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.