Repository navigation
Conversation
I found some wrong typing in doc when i using golang client. Most of them are package name missioning.
Co-authored-by: k2la <[email protected]>
| this.schemaInfoProvider = schemaInfoProvider; | ||
| } | ||
|
|
||
| public Schema<?> atSchemaVersion(byte[] schemaVersion) { |
There was a problem hiding this comment.
asI understand, unknown schema version will result in an exception. In current implementation in RuntimeException wrapping outcome of getSchemaByVersion.
I'd make it more explicit, add "throws", throw typed exception to force code upstream handle that.
Also MultiVersionSchemaInfoProvider's loadSchema does o -> o.orElse(null) so it can return null, I don't think it is explicitly anticipated.
Please add unit tests for this case.
There was a problem hiding this comment.
I added explicit documentation for edge cases:
- null schemaVersion
- unknown schemaVersion
Also I have enhanced the default implementation, in case of support for multi version this method must be overridden.
| * @return the schema at that specific version | ||
| */ | ||
| default Schema<?> atSchemaVersion(byte[] schemaVersion) { | ||
| return this; |
There was a problem hiding this comment.
Is this ok if supportSchemaVersioning() == true and schema versions mismatch?
What's the contract for the case when schema at this version cannot be found? null, exception, whatever other schema version we find?
There was a problem hiding this comment.
good point, I am adding "throws SchemaSerializationException" (that is the common Schema related exception for problems with the registry)
| return Optional.empty(); | ||
| } | ||
| byte[] schemaVersion = getSchemaVersion(); | ||
| return Optional.of(schema.atSchemaVersion(schemaVersion)); |
There was a problem hiding this comment.
depending on what happens with unknown schema version, this can throw exception or may need .ofNullable
There was a problem hiding this comment.
here we are consuming a Message, so if we have a version this version must exist
I believe it is good to see a RuntimeException in this impossible case
…che#10391) * PIP-45: Implement load managers locks using coordination service * Handle executor rejected exception when shutting down * Fixed SimpleLoadManager still updating the load report on zk client * Removed unused import * Fixed imports order * Simplified listLocks calls * Addressed comments * Removed updateOrCreate * Remove additional put method that's not needed anymore * Removed unused import * Fixed LoadBalanceTest * Fixed ModularLoadManagerImplTest
…onfiguration (apache#10441) * using ObjectMapper to parse sink config fixed minor issue in closing some of the PulsarClientImpl resources * using ObjectMapper to parse source config * code review changes * removed unused import
* Improved in max-pending-bytes mechanism for broker * Fixed imports * Switched to LongAdder
58121f6 to
a1d4530
Compare
…ons boot (#13) (apache#12667) (cherry picked from commit 515a69f)
getSchematogetSchemaInternalThe schema returned by Message.getSchema has these properties: