-
Notifications
You must be signed in to change notification settings - Fork 76
added Avro support for KafkaAdapter #645
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
Open
mildek
wants to merge
17
commits into
main
Choose a base branch
from
feat/add-kafka-avro-protocol
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e3ea18f
added Avro support for KafkaAdapter
mildek 8ce67ec
Merge remote-tracking branch 'origin/main' into feat/add-kafka-avro-p…
mildek 7396b22
ruffed scripts
mildek aa8a87b
conditionally skip avro installation for arm macos
mildek 7eaf32a
fixed bugs, enabled osx-arm wheel
mildek 1f4ab48
fix: linted docs
mildek 26b6b99
fix: add /utf-8 flag for Windows MSVC builds
mildek cbdb742
fix: add workaround for avro-cpp fmt::formatter incompatibility on Wi…
mildek 63bfb8b
fix: pin fmt to v11.x for avro-cpp compatibility on Windows
mildek e0d5cd9
fix: workaround for avro-cpp fmt formatter on Windows instead of pinning
mildek e9d65cb
fix: workaround for avro-cpp fmt formatter on Windows
mildek acd75a1
fix: patch avro-cpp headers at configure time for fmt v12 compatibili…
mildek fda0344
fix: address code review feedback
mildek ec0d6b7
- Extract version from library soname on conda-forge
mildek d2e8cf7
updated vcpkg sha in setup.py
mildek f064828
fix: check avro-cpp version instead of code pattern, make Avro optional
mildek 3ece184
fix: update vcpkg to get avro-cpp 1.12.1 for fmt v12 compatibility
mildek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,51 @@ | ||
| find_path(Avro_INCLUDE_DIR NAMES avro/Encoder.hh) | ||
| find_library(Avro_LIBRARY NAMES avrocpp libavrocpp) | ||
|
|
||
| # ============================================================================= | ||
| # Check for conda-forge avro-cpp fmt::formatter incompatibility on Windows | ||
| # ============================================================================= | ||
| # conda-forge's avro-cpp has fmt::formatter specializations with non-const | ||
| # format() methods, but fmt v12+ requires const. This causes MSVC error C2766. | ||
| # | ||
| # If detected, Avro_FOUND is set to FALSE and Kafka adapter will be disabled. | ||
| # ============================================================================= | ||
|
|
||
| set(Avro_COMPATIBLE TRUE) | ||
|
|
||
| if(WIN32 AND Avro_INCLUDE_DIR AND NOT CSP_USE_VCPKG) | ||
| set(_avro_node_hh "${Avro_INCLUDE_DIR}/avro/Node.hh") | ||
| if(EXISTS "${_avro_node_hh}") | ||
| file(READ "${_avro_node_hh}" _node_hh_content) | ||
| string(FIND "${_node_hh_content}" "fmt::formatter<avro::Name>" _has_formatter) | ||
| if(NOT _has_formatter EQUAL -1) | ||
| # Check for non-const format() - the bug pattern | ||
| string(REGEX MATCH "auto format\\([^)]+\\)[^c]*\\{" _buggy_pattern "${_node_hh_content}") | ||
| if(_buggy_pattern) | ||
| set(Avro_COMPATIBLE FALSE) | ||
| message(WARNING | ||
| "avro-cpp has incompatible fmt::formatter (non-const format()). " | ||
| "Kafka adapter will be disabled. Update avro-cpp when conda-forge releases a fix.") | ||
| endif() | ||
| endif() | ||
| endif() | ||
| endif() | ||
|
|
||
| if(Avro_COMPATIBLE AND Avro_INCLUDE_DIR AND Avro_LIBRARY) | ||
| if(NOT TARGET Avro::avrocpp) | ||
| add_library(Avro::avrocpp SHARED IMPORTED) | ||
| if(WIN32) | ||
| set_property(TARGET Avro::avrocpp PROPERTY IMPORTED_IMPLIB "${Avro_LIBRARY}") | ||
| else() | ||
| set_property(TARGET Avro::avrocpp PROPERTY IMPORTED_LOCATION "${Avro_LIBRARY}") | ||
| endif() | ||
| target_include_directories(Avro::avrocpp INTERFACE ${Avro_INCLUDE_DIR}) | ||
| endif() | ||
| endif() | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| if(Avro_COMPATIBLE) | ||
| find_package_handle_standard_args(Avro DEFAULT_MSG Avro_LIBRARY Avro_INCLUDE_DIR) | ||
| else() | ||
| set(Avro_FOUND FALSE) | ||
| endif() | ||
| mark_as_advanced(Avro_INCLUDE_DIR Avro_LIBRARY) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,16 @@ | ||
| #ifndef _IN_CSP_ADAPTERS_UTILS_AVROINCLUDES_H | ||
| #define _IN_CSP_ADAPTERS_UTILS_AVROINCLUDES_H | ||
|
|
||
| // Centralized avro includes. | ||
|
|
||
| #include <avro/Compiler.hh> | ||
| #include <avro/Decoder.hh> | ||
| #include <avro/Encoder.hh> | ||
| #include <avro/Generic.hh> | ||
| #include <avro/GenericDatum.hh> | ||
| #include <avro/Node.hh> | ||
| #include <avro/Schema.hh> | ||
| #include <avro/Stream.hh> | ||
| #include <avro/ValidSchema.hh> | ||
|
|
||
| #endif |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.