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
Add the multi version schema support #3876
Merged
sijie
merged 49 commits into
apache:master
from
congbobo184:schema_analysis_byschemaversion
Apr 28, 2019
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
54d58c0
add the multi version schema support
congbobo 2776e32
recover the code format
congbobo 9714c9d
recover the code format
congbobo 9447588
Modify the cache name
congbobo b01f509
set schema provider in struct schema
congbobo 5dae355
Modify the jude type
congbobo ee531dc
Modify the judge condition
congbobo cea87d0
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo 70ca1fe
add the schema reader and writer
congbobo c491e42
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo ed51af9
generic schema decode by schema version
congbobo dd838ce
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo 9597bc0
remove the dependency
congbobo 7571d7e
modify the generic schema decode type name
congbobo c58da0b
modify the consumerImpl
congbobo a2c45bf
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo d6b908a
struct schema refactor.
congbobo d6c90bb
modify the ProtobufSchema
congbobo 10af2c2
modify the ProtobufSchema
congbobo a3b6966
add schemInfo name
congbobo 4295758
delete AutoProduceBytesSchema in producerBase
congbobo 5abb561
return to the original condition of AutoConsumeSchema and AutoProduce…
congbobo d8a29a0
return to the original condition of AutoConsumeSchema and AutoProduce…
congbobo 3350a80
return to the original condition of AutoConsumeSchema and AutoProduce…
congbobo 18a9170
modify the setSchemaProvider location for create consumer
congbobo b74beed
modify the setSchemaProvider location for create consumer
congbobo c939809
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo db9cb75
1. schema provider logic in client
congbobo 0c7f5c4
restore the consumeImpl
congbobo 3c5a03a
delete the redundant /n
congbobo 59a260c
restore the ConsumerImpl
congbobo 468a861
restore the ConsumerImpl
congbobo ff0aebf
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo c2887f2
Add genericAvroReader test
congbobo 291ab9f
add the license header
congbobo 42407b9
* add the MultiVersionschemaInfoProvider Exception handle
congbobo 5e4a991
* delete the superfluous
congbobo c30f3f9
* fix the HbaseGenericRecordSinkTest and SolrGenericRecordSinkTest, g…
congbobo ffeec02
* fix InfluxDBGenericRecordSinkTest
congbobo 4ff3214
* fix the messsageImpl getValue logic
congbobo 8dd3d79
* add schemaInfoProvider into multiTopicsConsumerImpl
congbobo c2e7724
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo 2f87051
* modify the location for schema for preProcessSchemaBeforeSubscribe
congbobo e210c86
* modify the location of add schemaInfoProvider
congbobo 564dcee
* modify the topic name to get schema Info in MultiTopicsConsumerImpl
congbobo 66819a7
Merge remote-tracking branch 'apache/master' into schema_analysis_bys…
congbobo cd5b485
modify the exception in multi topic for getting provider
congbobo 0691bf3
* add the return
congbobo 091f69c
* modify the parameter name for schema writer method
congbobo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
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
50 changes: 50 additions & 0 deletions
50
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/SchemaInfoProvider.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,50 @@ | ||
/** | ||
* 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.client.api.schema; | ||
|
||
import org.apache.pulsar.common.schema.SchemaInfo; | ||
|
||
/** | ||
* Schema Provider. | ||
*/ | ||
public interface SchemaInfoProvider { | ||
|
||
/** | ||
* Retrieve the schema info of a given <tt>schemaVersion</tt>. | ||
* | ||
* @param schemaVersion schema version | ||
* @return schema info of the provided <tt>schemaVersion</tt> | ||
*/ | ||
SchemaInfo getSchemaByVersion(byte[] schemaVersion); | ||
|
||
/** | ||
* Retrieve the latest schema info. | ||
* | ||
* @return the latest schema | ||
*/ | ||
SchemaInfo getLatestSchema(); | ||
|
||
/** | ||
* Retrieve the topic name. | ||
* | ||
* @return the topic name | ||
*/ | ||
public String getTopicName(); | ||
|
||
} |
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
30 changes: 30 additions & 0 deletions
30
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/schema/SchemaWriter.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,30 @@ | ||
/** | ||
* 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.client.api.schema; | ||
|
||
public interface SchemaWriter<T> { | ||
|
||
/** | ||
* serialize the message into bytes | ||
* | ||
* @param message the message for encode | ||
* @return the serialized bytes | ||
*/ | ||
byte[] write(T message); | ||
} |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@congbobo184 don't you need to return here?
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.
yes, It should be