Skip to content
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

[fix][fn] fix function failed to start if no typeClassName provided in FunctionDetails #18111

Conversation

freeznet
Copy link
Contributor

@freeznet freeznet commented Oct 19, 2022

Master Issue: #18110

Motivation

When user run pulsar functions directly without pulsar-admin functions create or pulsar-admin functions localrun, it requires to provide typeClassName in functionDetails, otherwise the function will failed to start.

Modifications

try to inferring the typeClassName at runtime for Function, Sink and Source.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository: freeznet#8

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 19, 2022
@freeznet freeznet force-pushed the freeznet/allow-get-function-types-in-runtime branch from b1510fc to 054e9ae Compare October 20, 2022 02:52
@freeznet freeznet self-assigned this Oct 20, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2022

Codecov Report

Merging #18111 (85c16f7) into master (6c65ca0) will increase coverage by 10.94%.
The diff coverage is 30.46%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #18111       +/-   ##
=============================================
+ Coverage     34.91%   45.85%   +10.94%     
- Complexity     5707    17614    +11907     
=============================================
  Files           607     1574      +967     
  Lines         53396   128526    +75130     
  Branches       5712    14149     +8437     
=============================================
+ Hits          18644    58939    +40295     
- Misses        32119    63478    +31359     
- Partials       2633     6109     +3476     
Flag Coverage Δ
unittests 45.85% <30.46%> (+10.94%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../main/java/org/apache/pulsar/PulsarStandalone.java 0.00% <0.00%> (ø)
.../apache/pulsar/broker/admin/impl/ClustersBase.java 76.66% <0.00%> (+67.62%) ⬆️
...pache/pulsar/broker/admin/impl/NamespacesBase.java 61.93% <ø> (+47.40%) ⬆️
.../pulsar/broker/service/AbstractBaseDispatcher.java 52.14% <0.00%> (+6.28%) ⬆️
...che/pulsar/broker/service/BacklogQuotaManager.java 12.39% <0.00%> (+2.91%) ⬆️
.../pulsar/broker/service/BrokerServiceException.java 42.59% <0.00%> (+17.59%) ⬆️
...ava/org/apache/pulsar/broker/service/Consumer.java 68.61% <0.00%> (+6.60%) ⬆️
...ava/org/apache/pulsar/broker/service/Producer.java 62.42% <0.00%> (+2.78%) ⬆️
...pulsar/broker/service/PulsarCommandSenderImpl.java 74.35% <0.00%> (+7.69%) ⬆️
...va/org/apache/pulsar/broker/service/ServerCnx.java 46.82% <0.00%> (+1.48%) ⬆️
... and 1161 more

@freeznet freeznet requested a review from nlu90 October 21, 2022 02:20
@freeznet freeznet added area/function type/bug The PR fixed a bug or issue reported a bug labels Oct 21, 2022
@freeznet freeznet added this to the 2.12.0 milestone Oct 21, 2022
@codelipenghui codelipenghui merged commit 8ad7157 into apache:master Nov 11, 2022
codelipenghui pushed a commit that referenced this pull request Nov 11, 2022
… in `FunctionDetails` (#18111)

(cherry picked from commit 8ad7157)
codelipenghui pushed a commit that referenced this pull request Nov 11, 2022
… in `FunctionDetails` (#18111)

(cherry picked from commit 8ad7157)
codelipenghui pushed a commit that referenced this pull request Nov 11, 2022
… in `FunctionDetails` (#18111)

(cherry picked from commit 8ad7157)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Nov 23, 2022
… in `FunctionDetails` (apache#18111)

(cherry picked from commit 8ad7157)
(cherry picked from commit b873464)
congbobo184 pushed a commit that referenced this pull request Nov 26, 2022
… in `FunctionDetails` (#18111)

(cherry picked from commit 8ad7157)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants