Compare commits
No commits in common. "3.2" and "dubbo-3.2.10" have entirely different histories.
3.2
...
dubbo-3.2.
|
|
@ -19,55 +19,13 @@
|
|||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
tab_width = 4
|
||||
max_line_length = 120
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.java]
|
||||
ij_java_continuation_indent_size = 8
|
||||
ij_java_keep_control_statement_in_one_line = false
|
||||
ij_java_for_brace_force = always
|
||||
ij_java_if_brace_force = always
|
||||
ij_java_keep_first_column_comment = false
|
||||
ij_java_keep_line_breaks = false
|
||||
ij_java_keep_simple_blocks_in_one_line = true
|
||||
ij_java_keep_simple_classes_in_one_line = true
|
||||
ij_java_keep_simple_lambdas_in_one_line = true
|
||||
ij_java_keep_simple_methods_in_one_line = true
|
||||
ij_java_keep_blank_lines_in_code = 1
|
||||
ij_java_keep_blank_lines_in_declarations = 1
|
||||
ij_java_class_count_to_use_import_on_demand = 999
|
||||
ij_java_names_count_to_use_import_on_demand = 999
|
||||
ij_java_imports_layout = org.apache.dubbo.**, |, javax.**, |, java.**, |, *, |, $*
|
||||
ij_java_insert_inner_class_imports = true
|
||||
ij_java_space_before_array_initializer_left_brace = true
|
||||
ij_java_method_parameters_new_line_after_left_paren = true
|
||||
ij_java_wrap_comments = true
|
||||
ij_java_wrap_long_lines = true
|
||||
ij_java_enum_constants_wrap = split_into_lines
|
||||
ij_java_method_call_chain_wrap = split_into_lines
|
||||
ij_java_method_parameters_wrap = on_every_item
|
||||
ij_java_extends_list_wrap = on_every_item
|
||||
ij_java_extends_keyword_wrap = normal
|
||||
ij_java_binary_operation_wrap = normal
|
||||
ij_java_binary_operation_sign_on_next_line = true
|
||||
|
||||
[*.json]
|
||||
tab_width = 2
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[*.xml]
|
||||
ij_xml_attribute_wrap = off
|
||||
ij_xml_text_wrap = off
|
||||
ij_xml_keep_blank_lines = 1
|
||||
|
||||
[pom.xml]
|
||||
indent_size = 2
|
||||
# 4 space indentation
|
||||
[*.{java,xml}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
|
|
|||
|
|
@ -1,88 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
title: "[General][Java SDK (Component)] xxx"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to share your idea! We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
If you need to report a security issue, please visit [our security policy](https://github.com/apache/dubbo/security/policy).
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English idea is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
- "Go SDK (apache/dubbo-go)"
|
||||
- "Go Samples (apache/dubbo-go-samples)"
|
||||
- "Rust SDK (apache/dubbo-rust)"
|
||||
- "Node.js SDK (apache/dubbo-js)"
|
||||
- "Python SDK (apache/dubbo-python)"
|
||||
- "Kubernetes Integration (apache/dubbo-kubernetes)"
|
||||
- "Pixiu Gateway (apache/dubbo-go-pixiu)"
|
||||
- "Pixiu Gateway Samples (apache/dubbo-go-pixiu-samples)"
|
||||
- "Admin (apache/dubbo-admin)"
|
||||
- "Website (apache/dubbo-website)"
|
||||
- "Awesome (apache/dubbo-awesome)"
|
||||
- "Initializer (apache/dubbo-intializer)"
|
||||
- "Others (apache/dubbo-xxx)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Details
|
||||
description: Anything you want to ask?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
title: "[Q/A][Java SDK (Component)] xxx"
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to report the question! We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
If you need to report a security issue, please visit [our security policy](https://github.com/apache/dubbo/security/policy).
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English question is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
- "Go SDK (apache/dubbo-go)"
|
||||
- "Go Samples (apache/dubbo-go-samples)"
|
||||
- "Rust SDK (apache/dubbo-rust)"
|
||||
- "Node.js SDK (apache/dubbo-js)"
|
||||
- "Python SDK (apache/dubbo-python)"
|
||||
- "Kubernetes Integration (apache/dubbo-kubernetes)"
|
||||
- "Pixiu Gateway (apache/dubbo-go-pixiu)"
|
||||
- "Pixiu Gateway Samples (apache/dubbo-go-pixiu-samples)"
|
||||
- "Admin (apache/dubbo-admin)"
|
||||
- "Website (apache/dubbo-website)"
|
||||
- "Awesome (apache/dubbo-awesome)"
|
||||
- "Initializer (apache/dubbo-intializer)"
|
||||
- "Others (apache/dubbo-xxx)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Details
|
||||
description: Anything you want to know?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
name: Bug Report
|
||||
description: File a bug report
|
||||
title: "[Bug] "
|
||||
labels: ["type/need-triage", "component/need-triage"]
|
||||
projects: ["apache/337"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to report the problem! We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
Please make sure what you are reporting is indeed a bug with reproducible steps, if you want to ask questions
|
||||
or share ideas, please [subscribe to our mailing list](mailto:dev-subscribe@dubbo.apache.org) and sent
|
||||
emails to [our mailing list](mailto:dev@dubbo.apache.org), you can also head to our
|
||||
[Discussion](https://github.com/apache/dubbo/discussions) tab.
|
||||
|
||||
If you need to report a security issue, please visit [our security policy](https://github.com/apache/dubbo/security/policy).
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English issues is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Search before asking
|
||||
description: >
|
||||
Please make sure to search in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) first to see
|
||||
whether the same issue was reported already.
|
||||
options:
|
||||
- label: >
|
||||
I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar
|
||||
issues.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Dubbo Version
|
||||
description: "Which Dubbo version, JDK version and operating system did you use?"
|
||||
placeholder: "Example: Dubbo Java 3.2.12, OpenJDK 1.8, Ubuntu 20.04"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce this issue
|
||||
description: >
|
||||
Describe how to reproduce this issue.If you are not able to provide a reproducible case,
|
||||
please open a [Discussion](https://github.com/apache/dubbo/discussions) instead.
|
||||
placeholder: >
|
||||
Please provide the context in which the problem occurred and explain what happened.
|
||||
A [GitHub address] would be helpful for maintainers to reproduce the problem.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What you expected to happen
|
||||
description: What do you think went wrong?
|
||||
placeholder: >
|
||||
Please explain why you think the behaviour is erroneous. It is extremely helpful if you copy and paste
|
||||
the fragment of logs showing the exact error messages or wrong behaviour and screenshots for
|
||||
UI problems. You can include files by dragging and dropping them here.
|
||||
|
||||
**NOTE**: please copy and paste texts instead of taking screenshots of them for easy future search.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Anything else
|
||||
description: Anything else we need to know?
|
||||
placeholder: >
|
||||
How often does this problem occur? (Once? Every time? Only when certain conditions are met?)
|
||||
Any relevant logs to include? Put them here inside fenced
|
||||
``` ``` blocks or inside a collapsable details tag if it's too long:
|
||||
<details><summary>x.log</summary> lots of stuff </details>
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you willing to submit a pull request to fix on your own?
|
||||
description: >
|
||||
This is absolutely not required, but we are happy to guide you in the contribution process
|
||||
especially if you already have a good understanding of how to implement the fix.
|
||||
Dubbo is a totally community-driven project and we love to bring new contributors in.
|
||||
options:
|
||||
- label: Yes I am willing to submit a pull request on my own!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
name: Feature Request
|
||||
description: Create a Feature Request for Dubbo
|
||||
title: "[Feature] "
|
||||
labels: ["type/need-triage", "component/need-triage"]
|
||||
projects: ["apache/337"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
<img src="https://dubbo.apache.org/imgs/nav_logo2.png" alt="Dubbo logo" height="90px" align="right" />
|
||||
|
||||
Thank you for finding the time to propose new feature!
|
||||
|
||||
We really appreciate the community efforts to improve Dubbo.
|
||||
|
||||
**Dubbo is open for world wide collaboration, please make sure that all the content you provide is in English.**
|
||||
Remember that non-English issues is quite not friendly for everyone, and might unable to get the response!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Pre-check
|
||||
options:
|
||||
- label: >
|
||||
I am sure that all the content I provide is in English.
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Search before asking
|
||||
description: >
|
||||
Please make sure to search in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) first to see
|
||||
whether the same feature was requested already.
|
||||
options:
|
||||
- label: >
|
||||
I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar
|
||||
feature requirement.
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Apache Dubbo Component
|
||||
description: |
|
||||
What Apache Dubbo component are you using? Apache Dubbo has many subprojects, please make sure
|
||||
to choose the component that you want to ask questions about.
|
||||
multiple: false
|
||||
options:
|
||||
- "Java SDK (apache/dubbo)"
|
||||
- "Java Samples (apache/dubbo-samples)"
|
||||
- "Java Integration Cases (apache/dubbo-integration-cases)"
|
||||
- "Java SPI Extensions (apache/dubbo-spi-extensions)"
|
||||
- "Java Benchmark (apache/dubbo-benchmark)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Descriptions
|
||||
description: A short description of your feature
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Related issues
|
||||
description: Is there currently another issue associated with this?
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you willing to submit a pull request to fix on your own?
|
||||
description: >
|
||||
This is absolutely not required, but we are happy to guide you in the contribution process
|
||||
especially if you already have a good understanding of how to implement the feature.
|
||||
Dubbo is a totally community-driven project and we love to bring new contributors in.
|
||||
options:
|
||||
- label: Yes I am willing to submit a pull request on my own!
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Code of Conduct
|
||||
description: The Code of Conduct helps create a safe space for everyone. We require that everyone agrees to it.
|
||||
options:
|
||||
- label: >
|
||||
I agree to follow this project's
|
||||
[Code of Conduct](https://www.apache.org/foundation/policies/conduct)
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Thanks for completing our form!"
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
name: Bug Report
|
||||
about: Report a bug in Dubbo
|
||||
title: ''
|
||||
labels: type/bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
|
||||
|
||||
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
|
||||
|
||||
### Environment
|
||||
|
||||
* Dubbo version: xxx
|
||||
* Operating System version: xxx
|
||||
* Java version: xxx
|
||||
|
||||
### Steps to reproduce this issue
|
||||
|
||||
1. xxx
|
||||
2. xxx
|
||||
3. xxx
|
||||
|
||||
Pls. provide [GitHub address] to reproduce this issue.
|
||||
|
||||
### Expected Behavior
|
||||
|
||||
<!-- What do you expect from the above steps?-->
|
||||
|
||||
### Actual Behavior
|
||||
|
||||
<!-- What actually happens? -->
|
||||
|
||||
If there is an exception, please attach the exception trace:
|
||||
|
||||
```
|
||||
Just put your stack trace here!
|
||||
```
|
||||
|
|
@ -1,22 +1,8 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
blank_issues_enabled: false
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Question & FAQ & Proposal
|
||||
url: https://github.com/apache/dubbo/discussions/
|
||||
about: Ask a question, request support or submit a proposal for Apache Dubbo.
|
||||
- name: Dubbo Community Repo
|
||||
url: https://github.com/apache/dubbo-website
|
||||
about: Please see our community docs here.
|
||||
- name: Report a security issue
|
||||
url: https://github.com/apache/dubbo/security/policy
|
||||
about: Please report security vulnerabilities using these instructions.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
name: Discussion
|
||||
about: Start a discussion for Dubbo
|
||||
title: ''
|
||||
labels: type/discussion
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
|
||||
|
||||
<!-- For all design discussions please continue. -->
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
name: Feature Request
|
||||
about: Create a Feature Request for Dubbo
|
||||
title: ''
|
||||
labels: type/feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
|
||||
|
||||
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
|
||||
- [ ] I have searched the [release notes](https://github.com/apache/dubbo/releases) of this repository and believe that this is not a duplicate.
|
||||
|
||||
## Describe the feature
|
||||
<!-- Please also discuss possible business value -->
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
name: Proposal
|
||||
about: Create a technical proposal for Dubbo
|
||||
title: ''
|
||||
labels: type/proposal
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
|
||||
|
||||
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
|
||||
|
||||
## Describe the proposal
|
||||
<!-- Please use this for a concrete design proposal for functionality. -->
|
||||
<!-- If you just want to request a new feature and discuss the possible business value, create a Feature Request. -->
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
name: Question
|
||||
about: Ask a question about Dubbo
|
||||
title: ''
|
||||
labels: type/question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
|
||||
|
||||
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
|
||||
|
||||
## Ask your question here
|
||||
|
|
@ -18,49 +18,7 @@ env:
|
|||
'
|
||||
|
||||
jobs:
|
||||
check-format:
|
||||
name: Check if code needs formatting
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Maven
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 21
|
||||
distribution: zulu
|
||||
- name: Check if code aligns with code style
|
||||
id: check
|
||||
run: mvn --log-file mvn.log spotless:check
|
||||
continue-on-error: true
|
||||
- name: Upload checkstyle result
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: checkstyle-result
|
||||
path: mvn.log
|
||||
- name: Generate Summary for successful run
|
||||
if: ${{ steps.check.outcome == 'success' }}
|
||||
run: |
|
||||
echo ":ballot_box_with_check: Kudos! No formatting issues found!" >> $GITHUB_STEP_SUMMARY
|
||||
- name: Generate Summary for failed run
|
||||
if: ${{ steps.check.outcome == 'failure' }}
|
||||
run: |
|
||||
echo "## :negative_squared_cross_mark: Formatting issues found!" >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
cat mvn.log | grep "ERROR" | sed 's/Check if code needs formatting Check if code aligns with code style [0-9A-Z:.-]\+//' | sed 's/\[ERROR] //' | head -n -11 >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "Please run \`mvn spotless:apply\` to fix the formatting issues." >> $GITHUB_STEP_SUMMARY
|
||||
- name: Fail if code needs formatting
|
||||
if: ${{ steps.check.outcome == 'failure' }}
|
||||
uses: actions/github-script@v7.0.1
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
core.setFailed("Formatting issues found!")
|
||||
|
||||
license:
|
||||
name: "Check License"
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
@ -85,8 +43,6 @@ jobs:
|
|||
mode: check
|
||||
|
||||
build-source:
|
||||
name: "Build Dubbo"
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.dubbo-version.outputs.version }}
|
||||
|
|
@ -142,7 +98,6 @@ jobs:
|
|||
|
||||
unit-test-prepare:
|
||||
name: "Preparation for Unit Test"
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
|
@ -191,7 +146,7 @@ jobs:
|
|||
echo "--- End Print Rsa Public Key"
|
||||
|
||||
unit-test:
|
||||
needs: [check-format, build-source, unit-test-prepare]
|
||||
needs: [build-source, unit-test-prepare]
|
||||
name: "Unit Test On ubuntu-latest"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
|
|
@ -257,7 +212,6 @@ jobs:
|
|||
path: "**/target/site/**/jacoco.xml"
|
||||
|
||||
samples-test-prepare:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 3
|
||||
|
|
@ -275,7 +229,7 @@ jobs:
|
|||
name: samples-test-list
|
||||
path: test/jobs
|
||||
samples-test-job:
|
||||
needs: [check-format, build-source, samples-test-prepare]
|
||||
needs: [build-source, samples-test-prepare]
|
||||
name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
|
|
@ -342,7 +296,7 @@ jobs:
|
|||
name: samples-test-result
|
||||
path: test/jobs/*-result*
|
||||
samples-test-result:
|
||||
needs: [check-format, samples-test-job]
|
||||
needs: [samples-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
|
|
@ -361,7 +315,6 @@ jobs:
|
|||
run: ./test/scripts/merge-test-results.sh
|
||||
|
||||
integration-test-prepare:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
JOB_COUNT: 3
|
||||
|
|
@ -379,7 +332,7 @@ jobs:
|
|||
name: test-list
|
||||
path: test/jobs
|
||||
integration-test-job:
|
||||
needs: [check-format, build-source, integration-test-prepare]
|
||||
needs: [build-source, integration-test-prepare]
|
||||
name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}})"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
|
|
@ -446,7 +399,7 @@ jobs:
|
|||
name: test-result
|
||||
path: test/jobs/*-result*
|
||||
integration-test-result:
|
||||
needs: [check-format, integration-test-job]
|
||||
needs: [integration-test-job]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
|
|
@ -466,7 +419,7 @@ jobs:
|
|||
|
||||
jacoco-result-merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-format, integration-test-result, samples-test-result, unit-test]
|
||||
needs: [integration-test-result, samples-test-result, unit-test]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
|
@ -522,7 +475,6 @@ jobs:
|
|||
verbose: true
|
||||
|
||||
error-code-inspecting:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
@ -561,7 +513,6 @@ jobs:
|
|||
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt
|
||||
|
||||
native-image-inspecting:
|
||||
needs: check-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
@ -579,10 +530,10 @@ jobs:
|
|||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.3-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.3-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.3-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.3-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -477,10 +477,10 @@ jobs:
|
|||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.3-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.3-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.3-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.3-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -477,10 +477,10 @@ jobs:
|
|||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.3-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.3-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.3-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.3-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ jobs:
|
|||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 21
|
||||
java-version: 8
|
||||
- uses: actions/cache@v3
|
||||
name: "Cache local Maven repository"
|
||||
with:
|
||||
|
|
@ -477,10 +477,10 @@ jobs:
|
|||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.3-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.3-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.3-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.3-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -472,10 +472,10 @@ jobs:
|
|||
|
||||
- name: "Setup Zookeeper environment"
|
||||
run: |
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.4/apache-zookeeper-3.8.4-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.4-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.4-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.4-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.4-bin/bin/zkServer.sh start
|
||||
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.3/apache-zookeeper-3.8.3-bin.tar.gz
|
||||
tar -zxvf apache-zookeeper-3.8.3-bin.tar.gz
|
||||
mv apache-zookeeper-3.8.3-bin/conf/zoo_sample.cfg apache-zookeeper-3.8.3-bin/conf/zoo.cfg
|
||||
apache-zookeeper-3.8.3-bin/bin/zkServer.sh start
|
||||
|
||||
- name: "Check environment"
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ target/
|
|||
.settings/
|
||||
.project
|
||||
.classpath
|
||||
.externalToolBuilders
|
||||
maven-eclipse.xml
|
||||
|
||||
# idea ignore
|
||||
.idea/
|
||||
|
|
@ -52,6 +50,3 @@ dubbo-demo/dubbo-demo-triple/build/*
|
|||
|
||||
.git.exec.error
|
||||
|
||||
# log files generated by testcase.
|
||||
dubbo-rpc/dubbo-rpc-api/custom-access.log*
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ header:
|
|||
- '**/*.fc'
|
||||
- '**/*.javascript'
|
||||
- '**/*.properties'
|
||||
- '**/*.thrift'
|
||||
- '**/*.sh'
|
||||
- '**/*.bat'
|
||||
- '**/*.md'
|
||||
|
|
|
|||
2
NOTICE
2
NOTICE
|
|
@ -1,5 +1,5 @@
|
|||
Apache Dubbo
|
||||
Copyright 2018-2024 The Apache Software Foundation
|
||||
Copyright 2018-2023 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
|
|
|
|||
101
README.md
101
README.md
|
|
@ -6,10 +6,13 @@
|
|||

|
||||
[](http://isitmaintained.com/project/apache/dubbo "Average time to resolve an issue")
|
||||
[](http://isitmaintained.com/project/apache/dubbo "Percentage of issues still open")
|
||||
[](https://twitter.com/intent/tweet?text=Apache%20Dubbo%20is%20a%20high-performance%2C%20java%20based%2C%20open%20source%20RPC%20framework.&url=http://dubbo.apache.org/&via=ApacheDubbo&hashtags=rpc,java,dubbo,micro-service)
|
||||
[](https://twitter.com/intent/follow?screen_name=ApacheDubbo)
|
||||
[](https://gitter.im/alibaba/dubbo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit the [official site](http://dubbo.apache.org) for the quick start guide and documentation, as well as the [wiki](https://github.com/apache/dubbo/wiki) for news, FAQ, and release notes.
|
||||
|
||||
We are now collecting Dubbo user info to help us to improve Dubbo further. Kindly support us by providing your usage information on [Wanted: who's using dubbo](https://github.com/apache/dubbo/discussions/13842), thanks :)
|
||||
We are now collecting Dubbo user info to help us to improve Dubbo further. Kindly support us by providing your usage information on [issue#9436: Wanted: who's using dubbo](https://github.com/apache/dubbo/issues/9436), thanks :)
|
||||
|
||||
## Architecture
|
||||
|
||||
|
|
@ -39,7 +42,7 @@ There's a [README](https://github.com/apache/dubbo-samples/blob/389cd612f1ea57ee
|
|||
|
||||
```xml
|
||||
<properties>
|
||||
<dubbo.version>3.2.13-SNAPSHOT</dubbo.version>
|
||||
<dubbo.version>3.2.5</dubbo.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
|
@ -183,85 +186,55 @@ To avoid intermittent test failures (i.e., flaky tests), it is recommended to ha
|
|||
* Minimum of 2CPUs.
|
||||
* Minimum of 2Gb of RAM.
|
||||
|
||||
### How does the Dubbo Community collaborate?
|
||||
|
||||
The Dubbo Community primarily communicates on GitHub through issues, discussions, and pull requests.
|
||||
|
||||
- Issues: We use issues to track bugs and tasks. Any **work-related** item is associated with an issue.
|
||||
- Discussions: We use discussions for questions, early proposals, and announcements. Any **idea-related** item is associated with a discussion.
|
||||
- Pull Requests: We use pull requests to merge a set of changes from contributors into Dubbo.
|
||||
|
||||
We have also implemented [a project board](https://github.com/orgs/apache/projects/337) to monitor all the items.
|
||||
|
||||
Any essential changes should be discussed on the mailing list before they happen.
|
||||
|
||||
### Seeking for help
|
||||
|
||||
If you have questions such as:
|
||||
|
||||
- What is Dubbo?
|
||||
- How do I use Dubbo?
|
||||
- Why did an unexpected result occur?
|
||||
|
||||
Please start a discussion at https://github.com/apache/dubbo/discussions.
|
||||
|
||||
However, if you encounter the following situations:
|
||||
|
||||
- You're certain there's a bug that Dubbo needs to fix,
|
||||
- You believe a feature could be enhanced,
|
||||
- You have a detailed proposal for improving Dubbo,
|
||||
|
||||
Please open an issue at https://github.com/apache/dubbo/issues.
|
||||
|
||||
To ask effective questions, we recommend reading **[How To Ask Questions The Smart Way](https://github.com/selfteaching/How-To-Ask-Questions-The-Smart-Way/blob/master/How-To-Ask-Questions-The-Smart-Way.md)** first.
|
||||
|
||||
### Contribution
|
||||
|
||||
- Browse the "help wanted" tasks in the [Dubbo project board](https://github.com/orgs/apache/projects/337).
|
||||
- Participate in discussions on the mailing list. See the subscription [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide).
|
||||
- Respond to queries in the [discussions](https://github.com/apache/dubbo/issues).
|
||||
- Resolve bugs reported in [issues](https://github.com/apache/dubbo/issues) and send us a pull request.
|
||||
- Review existing [pull requests](https://github.com/apache/dubbo/pulls).
|
||||
- Enhance the [website](https://github.com/apache/dubbo-website). We typically need:
|
||||
- Blog posts
|
||||
- Translations for documentation
|
||||
- Use cases showcasing Dubbo integration in enterprise systems.
|
||||
- Improve the [dubbo-admin](https://github.com/apache/dubbo-admin).
|
||||
- Contribute to the projects listed in the [ecosystem](https://github.com/apache/?q=dubbo&type=all&language=&sort=).
|
||||
- Any other forms of contribution not listed above are also welcome.
|
||||
- If you're interested in contributing, please send an email to [dev@dubbo.apache.org](mailto:dev@dubbo.apache.org) to let us know!
|
||||
|
||||
For further details, please refer our [guide](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md) about how to contribute Dubbo.
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Please follow the [template](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md) for reporting any issues.
|
||||
|
||||
## Reporting a security vulnerability
|
||||
|
||||
Please report security vulnerabilities to [us](mailto:security@dubbo.apache.org) privately.
|
||||
|
||||
## Contact
|
||||
|
||||
* Mailing list:
|
||||
* dev list: for dev/user discussion. [subscribe](mailto:dev-subscribe@dubbo.apache.org), [unsubscribe](mailto:dev-unsubscribe@dubbo.apache.org), [archive](https://lists.apache.org/list.html?dev@dubbo.apache.org), [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide)
|
||||
* dev list: for dev/user discussion. [subscribe](mailto:dev-subscribe@dubbo.apache.org), [unsubscribe](mailto:dev-unsubscribe@dubbo.apache.org), [archive](https://lists.apache.org/list.html?dev@dubbo.apache.org), [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide)
|
||||
|
||||
* Bugs: [Issues](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md)
|
||||
* Gitter: [Gitter channel](https://gitter.im/alibaba/dubbo)
|
||||
* Twitter: [@ApacheDubbo](https://twitter.com/ApacheDubbo)
|
||||
|
||||
## Contributing
|
||||
|
||||
See [CONTRIBUTING](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md) for details on submitting patches and the contribution workflow.
|
||||
|
||||
### How can I contribute?
|
||||
|
||||
* Take a look at issues with tags marked [`Good first issue`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or [`Help wanted`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
|
||||
* Join the discussion on the mailing list, subscription [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide).
|
||||
* Answer questions on [issues](https://github.com/apache/dubbo/issues).
|
||||
* Fix bugs reported on [issues](https://github.com/apache/dubbo/issues), and send us a pull request.
|
||||
* Review the existing [pull request](https://github.com/apache/dubbo/pulls).
|
||||
* Improve the [website](https://github.com/apache/dubbo-website), typically we need
|
||||
* blog post
|
||||
* translation on documentation
|
||||
* use cases around the integration of Dubbo in enterprise systems.
|
||||
* Improve the [dubbo-admin/dubbo-monitor](https://github.com/apache/dubbo-admin).
|
||||
* Contribute to the projects listed in [ecosystem](https://github.com/dubbo).
|
||||
* Other forms of contribution not explicitly enumerated above.
|
||||
* If you would like to contribute, please send an email to dev@dubbo.apache.org to let us know!
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Please follow the [template](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md) for reporting any issues.
|
||||
|
||||
## Reporting a security vulnerability
|
||||
|
||||
Please report security vulnerabilities to [us](mailto:security@dubbo.apache.org) privately.
|
||||
|
||||
## Dubbo ecosystem
|
||||
|
||||
* [Dubbo Ecosystem Entry](https://github.com/apache?utf8=%E2%9C%93&q=dubbo&type=&language=) - A GitHub group `dubbo` to gather all Dubbo relevant projects not appropriate in [apache](https://github.com/apache) group yet
|
||||
* [Dubbo Website](https://github.com/apache/dubbo-website) - Apache Dubbo official website
|
||||
* [Dubbo Samples](https://github.com/apache/dubbo-samples) - samples for Apache Dubbo
|
||||
* [Dubbo Spring Boot](https://github.com/apache/dubbo-spring-boot-project) - Spring Boot Project for Dubbo
|
||||
* [Dubbo Admin](https://github.com/apache/dubbo-admin) - The reference implementation for Dubbo admin
|
||||
* [Dubbo Awesome](https://github.com/apache/dubbo-awesome) - Dubbo's slides and video links in Meetup
|
||||
|
||||
#### Language
|
||||
|
||||
* [Go](https://github.com/apache/dubbo-go) (recommended)
|
||||
* [Rust](https://github.com/apache/dubbo-rust)
|
||||
* [Go](https://github.com/dubbo/dubbo-go) (recommended)
|
||||
* [Node.js](https://github.com/apache/dubbo-js)
|
||||
* [Python](https://github.com/dubbo/py-client-for-apache-dubbo)
|
||||
* [PHP](https://github.com/apache/dubbo-php-framework)
|
||||
|
|
@ -269,4 +242,4 @@ Please report security vulnerabilities to [us](mailto:security@dubbo.apache.org)
|
|||
|
||||
## License
|
||||
|
||||
Apache Dubbo software is licensed under the Apache License Version 2.0. See the [LICENSE](https://github.com/apache/dubbo/blob/master/LICENSE) file for details.
|
||||
Apache Dubbo software is licensed under the Apache License Version 2.0. See the [LICENSE](https://github.com/apache/dubbo/blob/master/LICENSE) file for details.
|
||||
|
|
|
|||
12
SECURITY.md
12
SECURITY.md
|
|
@ -5,15 +5,13 @@
|
|||
Below is a table that shows versions that we accept security fixes.
|
||||
|
||||
| Version | Supported |
|
||||
|---------| ------------------ |
|
||||
| 3.3.x | :white_check_mark: |
|
||||
| 3.2.x | :white_check_mark: |
|
||||
| 3.1.x | :white_check_mark: |
|
||||
| 3.0.x | :x: |
|
||||
| 2.7.x | :x: |
|
||||
| 2.6.x | :x: |
|
||||
| ------- | ------------------ |
|
||||
| 3.0.x | :white_check_mark: |
|
||||
| 2.7.x | :white_check_mark: |
|
||||
| 2.6.x | :white_check_mark: |
|
||||
| 2.5.x | :x: |
|
||||
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
The Apache Software Foundation takes a rigorous standpoint in annihilating the security issues in its software projects. Apache Dubbo is highly sensitive and forthcoming to issues pertaining to its features and functionality.
|
||||
|
|
|
|||
|
|
@ -32,3 +32,4 @@ ignore:
|
|||
- "**/dubbo-native-plugin/**"
|
||||
- "**/dubbo-common/src/main/java/org/apache/dubbo/common/json/*.java" # internal JSON impl is deprecate, ignore test coverage for them
|
||||
- "**/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/AnnotationBean.java" # Deprecated
|
||||
- "**/dubbo-rpc/dubbo-rpc-thrift/**"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
|
||||
<spotless-maven-plugin.version>2.41.1</spotless-maven-plugin.version>
|
||||
<spotless.action>check</spotless.action>
|
||||
<dubbo-shared-resources.version>1.0.0</dubbo-shared-resources.version>
|
||||
<palantirJavaFormat.version>2.38.0</palantirJavaFormat.version>
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ public class SingleRouterChain<T> {
|
|||
public RouterSnapshotNode<T> buildRouterSnapshot(
|
||||
URL url, BitList<Invoker<T>> availableInvokers, Invocation invocation) {
|
||||
BitList<Invoker<T>> resultInvokers = availableInvokers.clone();
|
||||
RouterSnapshotNode<T> parentNode = new RouterSnapshotNode<>("Parent", resultInvokers.clone());
|
||||
RouterSnapshotNode<T> parentNode = new RouterSnapshotNode<T>("Parent", resultInvokers.clone());
|
||||
parentNode.setNodeOutputInvokers(resultInvokers.clone());
|
||||
|
||||
// 1. route state router
|
||||
|
|
@ -227,7 +227,7 @@ public class SingleRouterChain<T> {
|
|||
return parentNode;
|
||||
}
|
||||
|
||||
RouterSnapshotNode<T> commonRouterNode = new RouterSnapshotNode<>("CommonRouter", resultInvokers.clone());
|
||||
RouterSnapshotNode<T> commonRouterNode = new RouterSnapshotNode<T>("CommonRouter", resultInvokers.clone());
|
||||
parentNode.appendNode(commonRouterNode);
|
||||
List<Invoker<T>> commonRouterResult = resultInvokers;
|
||||
|
||||
|
|
@ -237,7 +237,7 @@ public class SingleRouterChain<T> {
|
|||
List<Invoker<T>> inputInvokers = new ArrayList<>(commonRouterResult);
|
||||
|
||||
RouterSnapshotNode<T> currentNode =
|
||||
new RouterSnapshotNode<>(router.getClass().getSimpleName(), inputInvokers);
|
||||
new RouterSnapshotNode<T>(router.getClass().getSimpleName(), inputInvokers);
|
||||
|
||||
// append to router node chain
|
||||
commonRouterNode.appendNode(currentNode);
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ public abstract class AbstractConfigurator implements Configurator {
|
|||
}
|
||||
|
||||
private Set<String> genConditionKeys() {
|
||||
Set<String> conditionKeys = new HashSet<>();
|
||||
Set<String> conditionKeys = new HashSet<String>();
|
||||
conditionKeys.add(CATEGORY_KEY);
|
||||
conditionKeys.add(Constants.CHECK_KEY);
|
||||
conditionKeys.add(DYNAMIC_KEY);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
|||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository;
|
||||
import org.apache.dubbo.common.utils.ConcurrentHashSet;
|
||||
import org.apache.dubbo.common.utils.LockUtils;
|
||||
import org.apache.dubbo.common.utils.NetUtils;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
import org.apache.dubbo.metrics.event.MetricsEventBus;
|
||||
|
|
@ -57,8 +56,6 @@ import java.util.concurrent.ScheduledFuture;
|
|||
import java.util.concurrent.Semaphore;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER;
|
||||
|
|
@ -125,8 +122,6 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
|
||||
private volatile ScheduledFuture<?> connectivityCheckFuture;
|
||||
|
||||
private final ReentrantLock invokerRefreshLock = new ReentrantLock();
|
||||
|
||||
/**
|
||||
* The max count of invokers for each reconnect task select to try to reconnect.
|
||||
*/
|
||||
|
|
@ -298,19 +293,17 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
|
||||
@Override
|
||||
public void addInvalidateInvoker(Invoker<T> invoker) {
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
// 1. remove this invoker from validInvokers list, this invoker will not be listed in the next time
|
||||
if (removeValidInvoker(invoker)) {
|
||||
// 2. add this invoker to reconnect list
|
||||
invokersToReconnect.add(invoker);
|
||||
// 3. try start check connectivity task
|
||||
checkConnectivity();
|
||||
// 1. remove this invoker from validInvokers list, this invoker will not be listed in the next time
|
||||
if (removeValidInvoker(invoker)) {
|
||||
// 2. add this invoker to reconnect list
|
||||
invokersToReconnect.add(invoker);
|
||||
// 3. try start check connectivity task
|
||||
checkConnectivity();
|
||||
|
||||
logger.info("The invoker " + invoker.getUrl()
|
||||
+ " has been added to invalidate list due to connectivity problem. "
|
||||
+ "Will trying to reconnect to it in the background.");
|
||||
}
|
||||
});
|
||||
logger.info("The invoker " + invoker.getUrl()
|
||||
+ " has been added to invalidate list due to connectivity problem. "
|
||||
+ "Will trying to reconnect to it in the background.");
|
||||
}
|
||||
}
|
||||
|
||||
public void checkConnectivity() {
|
||||
|
|
@ -329,30 +322,23 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
// 1. pick invokers from invokersToReconnect
|
||||
// limit max reconnectTaskTryCount, prevent this task hang up all the connectivityExecutor
|
||||
// for long time
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
if (invokersToReconnect.size() < reconnectTaskTryCount) {
|
||||
invokersToTry.addAll(invokersToReconnect);
|
||||
} else {
|
||||
for (int i = 0; i < reconnectTaskTryCount; i++) {
|
||||
Invoker<T> tInvoker = invokersToReconnect.get(
|
||||
ThreadLocalRandom.current().nextInt(invokersToReconnect.size()));
|
||||
if (!invokersToTry.contains(tInvoker)) {
|
||||
// ignore if is selected, invokersToTry's size is always smaller than
|
||||
// reconnectTaskTryCount + 1
|
||||
invokersToTry.add(tInvoker);
|
||||
}
|
||||
if (invokersToReconnect.size() < reconnectTaskTryCount) {
|
||||
invokersToTry.addAll(invokersToReconnect);
|
||||
} else {
|
||||
for (int i = 0; i < reconnectTaskTryCount; i++) {
|
||||
Invoker<T> tInvoker = invokersToReconnect.get(
|
||||
ThreadLocalRandom.current().nextInt(invokersToReconnect.size()));
|
||||
if (!invokersToTry.contains(tInvoker)) {
|
||||
// ignore if is selected, invokersToTry's size is always smaller than
|
||||
// reconnectTaskTryCount + 1
|
||||
invokersToTry.add(tInvoker);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 2. try to check the invoker's status
|
||||
for (Invoker<T> invoker : invokersToTry) {
|
||||
AtomicBoolean invokerExist = new AtomicBoolean(false);
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
invokerExist.set(invokers.contains(invoker));
|
||||
});
|
||||
// Should not lock here, `invoker.isAvailable` may need some time to check
|
||||
if (invokerExist.get()) {
|
||||
if (invokers.contains(invoker)) {
|
||||
if (invoker.isAvailable()) {
|
||||
needDeleteList.add(invoker);
|
||||
}
|
||||
|
|
@ -362,37 +348,22 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
}
|
||||
|
||||
// 3. recover valid invoker
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
for (Invoker<T> tInvoker : needDeleteList) {
|
||||
if (invokers.contains(tInvoker)) {
|
||||
addValidInvoker(tInvoker);
|
||||
logger.info("Recover service address: " + tInvoker.getUrl()
|
||||
+ " from invalid list.");
|
||||
} else {
|
||||
logger.info(
|
||||
"The invoker " + tInvoker.getUrl()
|
||||
+ " has been removed from invokers list. Will remove it in reconnect list.");
|
||||
}
|
||||
invokersToReconnect.remove(tInvoker);
|
||||
for (Invoker<T> tInvoker : needDeleteList) {
|
||||
if (invokers.contains(tInvoker)) {
|
||||
addValidInvoker(tInvoker);
|
||||
logger.info(
|
||||
"Recover service address: " + tInvoker.getUrl() + " from invalid list.");
|
||||
}
|
||||
});
|
||||
} catch (Throwable t) {
|
||||
logger.error(
|
||||
LoggerCodeConstants.INTERNAL_ERROR,
|
||||
"",
|
||||
"",
|
||||
"Error occurred when check connectivity. ",
|
||||
t);
|
||||
invokersToReconnect.remove(tInvoker);
|
||||
}
|
||||
} finally {
|
||||
checkConnectivityPermit.release();
|
||||
}
|
||||
|
||||
// 4. submit new task if it has more to recover
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
if (!invokersToReconnect.isEmpty()) {
|
||||
checkConnectivity();
|
||||
}
|
||||
});
|
||||
if (!invokersToReconnect.isEmpty()) {
|
||||
checkConnectivity();
|
||||
}
|
||||
MetricsEventBus.publish(RegistryEvent.refreshDirectoryEvent(
|
||||
applicationModel, getSummary(), getDirectoryMeta()));
|
||||
},
|
||||
|
|
@ -411,11 +382,9 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
* 4. all the invokers disappeared from total invokers should be removed in the disabled invokers list
|
||||
*/
|
||||
public void refreshInvoker() {
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
if (invokersInitialized) {
|
||||
refreshInvokerInternal();
|
||||
}
|
||||
});
|
||||
if (invokersInitialized) {
|
||||
refreshInvokerInternal();
|
||||
}
|
||||
MetricsEventBus.publish(
|
||||
RegistryEvent.refreshDirectoryEvent(applicationModel, getSummary(), getDirectoryMeta()));
|
||||
}
|
||||
|
|
@ -424,7 +393,7 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
private void refreshInvokerInternal() {
|
||||
private synchronized void refreshInvokerInternal() {
|
||||
BitList<Invoker<T>> copiedInvokers = invokers.clone();
|
||||
refreshInvokers(copiedInvokers, invokersToReconnect);
|
||||
refreshInvokers(copiedInvokers, disabledInvokers);
|
||||
|
|
@ -445,29 +414,25 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
|
||||
@Override
|
||||
public void addDisabledInvoker(Invoker<T> invoker) {
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
if (invokers.contains(invoker)) {
|
||||
disabledInvokers.add(invoker);
|
||||
removeValidInvoker(invoker);
|
||||
logger.info("Disable service address: " + invoker.getUrl() + ".");
|
||||
}
|
||||
});
|
||||
if (invokers.contains(invoker)) {
|
||||
disabledInvokers.add(invoker);
|
||||
removeValidInvoker(invoker);
|
||||
logger.info("Disable service address: " + invoker.getUrl() + ".");
|
||||
}
|
||||
MetricsEventBus.publish(
|
||||
RegistryEvent.refreshDirectoryEvent(applicationModel, getSummary(), getDirectoryMeta()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recoverDisabledInvoker(Invoker<T> invoker) {
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
if (disabledInvokers.remove(invoker)) {
|
||||
try {
|
||||
addValidInvoker(invoker);
|
||||
logger.info("Recover service address: " + invoker.getUrl() + " from disabled list.");
|
||||
} catch (Throwable ignore) {
|
||||
if (disabledInvokers.remove(invoker)) {
|
||||
try {
|
||||
addValidInvoker(invoker);
|
||||
logger.info("Recover service address: " + invoker.getUrl() + " from disabled list.");
|
||||
} catch (Throwable ignore) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
MetricsEventBus.publish(
|
||||
RegistryEvent.refreshDirectoryEvent(applicationModel, getSummary(), getDirectoryMeta()));
|
||||
}
|
||||
|
|
@ -526,11 +491,9 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
}
|
||||
|
||||
protected void setInvokers(BitList<Invoker<T>> invokers) {
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
this.invokers = invokers;
|
||||
refreshInvokerInternal();
|
||||
this.invokersInitialized = true;
|
||||
});
|
||||
this.invokers = invokers;
|
||||
refreshInvokerInternal();
|
||||
this.invokersInitialized = true;
|
||||
|
||||
MetricsEventBus.publish(
|
||||
RegistryEvent.refreshDirectoryEvent(applicationModel, getSummary(), getDirectoryMeta()));
|
||||
|
|
@ -538,31 +501,29 @@ public abstract class AbstractDirectory<T> implements Directory<T> {
|
|||
|
||||
protected void destroyInvokers() {
|
||||
// set empty instead of clearing to support concurrent access.
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
this.invokers = BitList.emptyList();
|
||||
this.validInvokers = BitList.emptyList();
|
||||
this.invokersInitialized = false;
|
||||
});
|
||||
this.invokers = BitList.emptyList();
|
||||
this.validInvokers = BitList.emptyList();
|
||||
this.invokersInitialized = false;
|
||||
}
|
||||
|
||||
private boolean addValidInvoker(Invoker<T> invoker) {
|
||||
AtomicBoolean result = new AtomicBoolean(false);
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
result.set(this.validInvokers.add(invoker));
|
||||
});
|
||||
boolean result;
|
||||
synchronized (this.validInvokers) {
|
||||
result = this.validInvokers.add(invoker);
|
||||
}
|
||||
MetricsEventBus.publish(
|
||||
RegistryEvent.refreshDirectoryEvent(applicationModel, getSummary(), getDirectoryMeta()));
|
||||
return result.get();
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean removeValidInvoker(Invoker<T> invoker) {
|
||||
AtomicBoolean result = new AtomicBoolean(false);
|
||||
LockUtils.safeLock(invokerRefreshLock, LockUtils.DEFAULT_TIMEOUT, () -> {
|
||||
result.set(this.validInvokers.remove(invoker));
|
||||
});
|
||||
boolean result;
|
||||
synchronized (this.validInvokers) {
|
||||
result = this.validInvokers.remove(invoker);
|
||||
}
|
||||
MetricsEventBus.publish(
|
||||
RegistryEvent.refreshDirectoryEvent(applicationModel, getSummary(), getDirectoryMeta()));
|
||||
return result.get();
|
||||
return result;
|
||||
}
|
||||
|
||||
protected abstract List<Invoker<T>> doList(
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.dubbo.rpc.cluster.filter.support;
|
|||
import org.apache.dubbo.common.extension.Activate;
|
||||
import org.apache.dubbo.common.extension.ExtensionLoader;
|
||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||
import org.apache.dubbo.common.utils.NetUtils;
|
||||
import org.apache.dubbo.rpc.AsyncRpcResult;
|
||||
import org.apache.dubbo.rpc.Filter;
|
||||
import org.apache.dubbo.rpc.Invocation;
|
||||
|
|
@ -62,7 +63,10 @@ public class ConsumerContextFilter implements ClusterFilter, ClusterFilter.Liste
|
|||
|
||||
@Override
|
||||
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
|
||||
RpcContext.getServiceContext().setInvoker(invoker).setInvocation(invocation);
|
||||
RpcContext.getServiceContext()
|
||||
.setInvoker(invoker)
|
||||
.setInvocation(invocation)
|
||||
.setLocalAddress(NetUtils.getLocalHost(), 0);
|
||||
|
||||
RpcContext context = RpcContext.getClientAttachment();
|
||||
context.setAttachment(REMOTE_APPLICATION_KEY, invoker.getUrl().getApplication());
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ public class ConsistentHashLoadBalance extends AbstractLoadBalance {
|
|||
*/
|
||||
public static final String HASH_ARGUMENTS = "hash.arguments";
|
||||
|
||||
private final ConcurrentMap<String, ConsistentHashSelector<?>> selectors = new ConcurrentHashMap<>();
|
||||
private final ConcurrentMap<String, ConsistentHashSelector<?>> selectors =
|
||||
new ConcurrentHashMap<String, ConsistentHashSelector<?>>();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
|
|
@ -74,7 +75,7 @@ public class ConsistentHashLoadBalance extends AbstractLoadBalance {
|
|||
private final int[] argumentIndex;
|
||||
|
||||
ConsistentHashSelector(List<Invoker<T>> invokers, String methodName, int identityHashCode) {
|
||||
this.virtualInvokers = new TreeMap<>();
|
||||
this.virtualInvokers = new TreeMap<Long, Invoker<T>>();
|
||||
this.identityHashCode = identityHashCode;
|
||||
URL url = invokers.get(0).getUrl();
|
||||
this.replicaNumber = url.getMethodParameter(methodName, HASH_NODES, 160);
|
||||
|
|
@ -96,12 +97,14 @@ public class ConsistentHashLoadBalance extends AbstractLoadBalance {
|
|||
}
|
||||
|
||||
public Invoker<T> select(Invocation invocation) {
|
||||
String key = toKey(RpcUtils.getArguments(invocation));
|
||||
|
||||
byte[] digest = Bytes.getMD5(key);
|
||||
byte[] digest = Bytes.getMD5(RpcUtils.getMethodName(invocation));
|
||||
return selectForKey(hash(digest, 0));
|
||||
}
|
||||
|
||||
private String toKey(Object[] args, boolean isGeneric) {
|
||||
return isGeneric ? toKey((Object[]) args[1]) : toKey(args);
|
||||
}
|
||||
|
||||
private String toKey(Object[] args) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
for (int i : argumentIndex) {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class MapMerger implements Merger<Map<?, ?>> {
|
|||
if (ArrayUtils.isEmpty(items)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<Object, Object> result = new HashMap<>();
|
||||
Map<Object, Object> result = new HashMap<Object, Object>();
|
||||
Stream.of(items).filter(Objects::nonNull).forEach(result::putAll);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class MergerFactory implements ScopeModelAware {
|
|||
|
||||
private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(MergerFactory.class);
|
||||
|
||||
private ConcurrentMap<Class<?>, Merger<?>> MERGER_CACHE = new ConcurrentHashMap<>();
|
||||
private ConcurrentMap<Class<?>, Merger<?>> MERGER_CACHE = new ConcurrentHashMap<Class<?>, Merger<?>>();
|
||||
private ScopeModel scopeModel;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class SetMerger implements Merger<Set<?>> {
|
|||
if (ArrayUtils.isEmpty(items)) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
Set<Object> result = new HashSet<>();
|
||||
Set<Object> result = new HashSet<Object>();
|
||||
Stream.of(items).filter(Objects::nonNull).forEach(result::addAll);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ public class ConditionStateRouter<T> extends AbstractStateRouter<T> {
|
|||
CLUSTER_CONDITIONAL_ROUTE_LIST_EMPTY,
|
||||
"condition state router thenCondition is empty",
|
||||
"",
|
||||
"The current consumer in the service blocklist. consumer: " + NetUtils.getLocalHost()
|
||||
"The current consumer in the service blacklist. consumer: " + NetUtils.getLocalHost()
|
||||
+ ", service: " + url.getServiceKey());
|
||||
if (needToPrintMessage) {
|
||||
messageHolder.set("Empty return. Reason: ThenCondition is empty.");
|
||||
|
|
|
|||
|
|
@ -30,6 +30,6 @@ public class ConditionStateRouterFactory extends CacheableStateRouterFactory {
|
|||
|
||||
@Override
|
||||
protected <T> StateRouter<T> createRouter(Class<T> interfaceClass, URL url) {
|
||||
return new ConditionStateRouter<>(url);
|
||||
return new ConditionStateRouter<T>(url);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,6 @@ public class ServiceStateRouterFactory extends CacheableStateRouterFactory {
|
|||
|
||||
@Override
|
||||
protected <T> StateRouter<T> createRouter(Class<T> interfaceClass, URL url) {
|
||||
return new ServiceStateRouter<>(url);
|
||||
return new ServiceStateRouter<T>(url);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public class MeshRuleCache<T> {
|
|||
Collections.unmodifiableMap(totalSubsetMap),
|
||||
unmatchedInvokers);
|
||||
} else {
|
||||
return new MeshRuleCache<>(
|
||||
return new MeshRuleCache<T>(
|
||||
Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(), invokers);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,6 @@ public class MockStateRouterFactory implements StateRouterFactory {
|
|||
|
||||
@Override
|
||||
public <T> StateRouter<T> getRouter(Class<T> interfaceClass, URL url) {
|
||||
return new MockInvokersSelector<>(url);
|
||||
return new MockInvokersSelector<T>(url);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,23 +93,23 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
// Provided by BitList only
|
||||
public synchronized List<E> getOriginList() {
|
||||
public List<E> getOriginList() {
|
||||
return originList;
|
||||
}
|
||||
|
||||
public synchronized void addIndex(int index) {
|
||||
public void addIndex(int index) {
|
||||
this.rootSet.set(index);
|
||||
}
|
||||
|
||||
public synchronized int totalSetSize() {
|
||||
public int totalSetSize() {
|
||||
return this.originList.size();
|
||||
}
|
||||
|
||||
public synchronized boolean indexExist(int index) {
|
||||
public boolean indexExist(int index) {
|
||||
return this.rootSet.get(index);
|
||||
}
|
||||
|
||||
public synchronized E getByIndex(int index) {
|
||||
public E getByIndex(int index) {
|
||||
return this.originList.get(index);
|
||||
}
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
* @param target target bitList
|
||||
* @return this bitList only contains those elements contain in both two list and source bitList's tailList
|
||||
*/
|
||||
public synchronized BitList<E> and(BitList<E> target) {
|
||||
public BitList<E> and(BitList<E> target) {
|
||||
rootSet.and(target.rootSet);
|
||||
if (target.getTailList() != null) {
|
||||
target.getTailList().forEach(this::addToTailList);
|
||||
|
|
@ -128,28 +128,28 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
return this;
|
||||
}
|
||||
|
||||
public synchronized BitList<E> or(BitList<E> target) {
|
||||
public BitList<E> or(BitList<E> target) {
|
||||
BitSet resultSet = (BitSet) rootSet.clone();
|
||||
resultSet.or(target.rootSet);
|
||||
return new BitList<>(originList, resultSet, tailList);
|
||||
}
|
||||
|
||||
public synchronized boolean hasMoreElementInTailList() {
|
||||
public boolean hasMoreElementInTailList() {
|
||||
return CollectionUtils.isNotEmpty(tailList);
|
||||
}
|
||||
|
||||
public synchronized List<E> getTailList() {
|
||||
public List<E> getTailList() {
|
||||
return tailList;
|
||||
}
|
||||
|
||||
public synchronized void addToTailList(E e) {
|
||||
public void addToTailList(E e) {
|
||||
if (tailList == null) {
|
||||
tailList = new LinkedList<>();
|
||||
}
|
||||
tailList.add(e);
|
||||
}
|
||||
|
||||
public synchronized E randomSelectOne() {
|
||||
public E randomSelectOne() {
|
||||
int originSize = originList.size();
|
||||
int tailSize = tailList != null ? tailList.size() : 0;
|
||||
int totalSize = originSize + tailSize;
|
||||
|
|
@ -181,18 +181,18 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
|
||||
// Provided by JDK List interface
|
||||
@Override
|
||||
public synchronized int size() {
|
||||
public int size() {
|
||||
return rootSet.cardinality() + (CollectionUtils.isNotEmpty(tailList) ? tailList.size() : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean contains(Object o) {
|
||||
public boolean contains(Object o) {
|
||||
int idx = originList.indexOf(o);
|
||||
return (idx >= 0 && rootSet.get(idx)) || (CollectionUtils.isNotEmpty(tailList) && tailList.contains(o));
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized Iterator<E> iterator() {
|
||||
public Iterator<E> iterator() {
|
||||
return new BitListIterator<>(this, 0);
|
||||
}
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
* Notice: It is not recommended adding duplicated element.
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean add(E e) {
|
||||
public boolean add(E e) {
|
||||
int index = originList.indexOf(e);
|
||||
if (index > -1) {
|
||||
rootSet.set(index);
|
||||
|
|
@ -225,7 +225,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
* If the element is not contained in originList, try to remove from tailList.
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean remove(Object o) {
|
||||
public boolean remove(Object o) {
|
||||
int idx = originList.indexOf(o);
|
||||
if (idx > -1 && rootSet.get(idx)) {
|
||||
rootSet.set(idx, false);
|
||||
|
|
@ -242,7 +242,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
* This may change the default behaviour when adding new element later.
|
||||
*/
|
||||
@Override
|
||||
public synchronized void clear() {
|
||||
public void clear() {
|
||||
rootSet.clear();
|
||||
// to remove references
|
||||
originList = Collections.emptyList();
|
||||
|
|
@ -252,7 +252,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized E get(int index) {
|
||||
public E get(int index) {
|
||||
int bitIndex = -1;
|
||||
if (index < 0) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
|
|
@ -272,7 +272,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized E remove(int index) {
|
||||
public E remove(int index) {
|
||||
int bitIndex = -1;
|
||||
if (index >= rootSet.cardinality()) {
|
||||
if (CollectionUtils.isNotEmpty(tailList)) {
|
||||
|
|
@ -290,7 +290,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized int indexOf(Object o) {
|
||||
public int indexOf(Object o) {
|
||||
int bitIndex = -1;
|
||||
for (int i = 0; i < rootSet.cardinality(); i++) {
|
||||
bitIndex = rootSet.nextSetBit(bitIndex + 1);
|
||||
|
|
@ -311,7 +311,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public synchronized boolean addAll(Collection<? extends E> c) {
|
||||
public boolean addAll(Collection<? extends E> c) {
|
||||
if (c instanceof BitList) {
|
||||
rootSet.or(((BitList<? extends E>) c).rootSet);
|
||||
if (((BitList<? extends E>) c).hasMoreElementInTailList()) {
|
||||
|
|
@ -325,7 +325,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized int lastIndexOf(Object o) {
|
||||
public int lastIndexOf(Object o) {
|
||||
int bitIndex = -1;
|
||||
int index = -1;
|
||||
if (CollectionUtils.isNotEmpty(tailList)) {
|
||||
|
|
@ -344,22 +344,22 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean isEmpty() {
|
||||
public boolean isEmpty() {
|
||||
return this.rootSet.isEmpty() && CollectionUtils.isEmpty(tailList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized ListIterator<E> listIterator() {
|
||||
public ListIterator<E> listIterator() {
|
||||
return new BitListIterator<>(this, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized ListIterator<E> listIterator(int index) {
|
||||
public ListIterator<E> listIterator(int index) {
|
||||
return new BitListIterator<>(this, index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized BitList<E> subList(int fromIndex, int toIndex) {
|
||||
public BitList<E> subList(int fromIndex, int toIndex) {
|
||||
BitSet resultSet = (BitSet) rootSet.clone();
|
||||
List<E> copiedTailList = tailList == null ? null : new LinkedList<>(tailList);
|
||||
if (toIndex < size()) {
|
||||
|
|
@ -414,7 +414,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean hasNext() {
|
||||
public boolean hasNext() {
|
||||
if (isInTailList) {
|
||||
return tailListIterator.hasNext();
|
||||
} else {
|
||||
|
|
@ -428,7 +428,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized E next() {
|
||||
public E next() {
|
||||
if (isInTailList) {
|
||||
if (tailListIterator.hasNext()) {
|
||||
index += 1;
|
||||
|
|
@ -457,7 +457,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean hasPrevious() {
|
||||
public boolean hasPrevious() {
|
||||
if (isInTailList) {
|
||||
boolean hasPreviousInTailList = tailListIterator.hasPrevious();
|
||||
if (hasPreviousInTailList) {
|
||||
|
|
@ -471,7 +471,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized E previous() {
|
||||
public E previous() {
|
||||
if (isInTailList) {
|
||||
boolean hasPreviousInTailList = tailListIterator.hasPrevious();
|
||||
if (hasPreviousInTailList) {
|
||||
|
|
@ -503,17 +503,17 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized int nextIndex() {
|
||||
public int nextIndex() {
|
||||
return hasNext() ? index + 1 : index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized int previousIndex() {
|
||||
public int previousIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void remove() {
|
||||
public void remove() {
|
||||
if (lastReturnedIndex == -1) {
|
||||
throw new IllegalStateException();
|
||||
} else {
|
||||
|
|
@ -533,17 +533,17 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized void set(E e) {
|
||||
public void set(E e) {
|
||||
throw new UnsupportedOperationException("Set method is not supported in BitListIterator!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void add(E e) {
|
||||
public void add(E e) {
|
||||
throw new UnsupportedOperationException("Add method is not supported in BitListIterator!");
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized ArrayList<E> cloneToArrayList() {
|
||||
public ArrayList<E> cloneToArrayList() {
|
||||
if (rootSet.cardinality() == originList.size() && (CollectionUtils.isEmpty(tailList))) {
|
||||
return new ArrayList<>(originList);
|
||||
}
|
||||
|
|
@ -553,7 +553,7 @@ public class BitList<E> extends AbstractList<E> implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public synchronized BitList<E> clone() {
|
||||
public BitList<E> clone() {
|
||||
return new BitList<>(
|
||||
originList, (BitSet) rootSet.clone(), tailList == null ? null : new LinkedList<>(tailList));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,6 @@ public class TagStateRouterFactory extends CacheableStateRouterFactory {
|
|||
|
||||
@Override
|
||||
protected <T> StateRouter<T> createRouter(Class<T> interfaceClass, URL url) {
|
||||
return new TagStateRouter<>(url);
|
||||
return new TagStateRouter<T>(url);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ public class FailoverClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
int len = calculateInvokeTimes(methodName);
|
||||
// retry loop.
|
||||
RpcException le = null; // last exception.
|
||||
List<Invoker<T>> invoked = new ArrayList<>(copyInvokers.size()); // invoked invokers.
|
||||
Set<String> providers = new HashSet<>(len);
|
||||
List<Invoker<T>> invoked = new ArrayList<Invoker<T>>(copyInvokers.size()); // invoked invokers.
|
||||
Set<String> providers = new HashSet<String>(len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
// Reselect before retry to avoid a change of candidate `invokers`.
|
||||
// NOTE: if `invokers` changed, then `invoked` also lose accuracy.
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ public class MergeableCluster extends AbstractCluster {
|
|||
|
||||
@Override
|
||||
public <T> AbstractClusterInvoker<T> doJoin(Directory<T> directory) throws RpcException {
|
||||
return new MergeableClusterInvoker<>(directory);
|
||||
return new MergeableClusterInvoker<T>(directory);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.dubbo.rpc.cluster.support;
|
||||
|
||||
import org.apache.dubbo.common.constants.LoggerCodeConstants;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.utils.ConfigUtils;
|
||||
|
|
@ -70,10 +69,8 @@ public class MergeableClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
return invokeWithContext(invoker, invocation);
|
||||
} catch (RpcException e) {
|
||||
if (e.isNoInvokerAvailableAfterFilter()) {
|
||||
log.debug(
|
||||
"No available provider for service" + getUrl().getServiceKey() + " on group "
|
||||
+ invoker.getUrl().getGroup() + ", will continue to try another group.",
|
||||
e);
|
||||
log.debug("No available provider for service" + getUrl().getServiceKey() + " on group "
|
||||
+ invoker.getUrl().getGroup() + ", will continue to try another group.");
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
|
|
@ -96,21 +93,7 @@ public class MergeableClusterInvoker<T> extends AbstractClusterInvoker<T> {
|
|||
for (final Invoker<T> invoker : invokers) {
|
||||
RpcInvocation subInvocation = new RpcInvocation(invocation, invoker);
|
||||
subInvocation.setAttachment(ASYNC_KEY, "true");
|
||||
try {
|
||||
results.put(invoker.getUrl().getServiceKey(), invokeWithContext(invoker, subInvocation));
|
||||
} catch (RpcException e) {
|
||||
if (e.isNoInvokerAvailableAfterFilter()) {
|
||||
log.warn(
|
||||
LoggerCodeConstants.CLUSTER_NO_VALID_PROVIDER,
|
||||
e.getCause().getMessage(),
|
||||
"",
|
||||
"No available provider for service" + getUrl().getServiceKey() + " on group "
|
||||
+ invoker.getUrl().getGroup() + ", will continue to try another group.",
|
||||
e);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
results.put(invoker.getUrl().getServiceKey(), invokeWithContext(invoker, subInvocation));
|
||||
}
|
||||
|
||||
Object result;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,6 @@ public class ZoneAwareCluster extends AbstractCluster {
|
|||
|
||||
@Override
|
||||
protected <T> AbstractClusterInvoker<T> doJoin(Directory<T> directory) throws RpcException {
|
||||
return new ZoneAwareClusterInvoker<>(directory);
|
||||
return new ZoneAwareClusterInvoker<T>(directory);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public class MockClusterWrapper implements Cluster {
|
|||
|
||||
@Override
|
||||
public <T> Invoker<T> join(Directory<T> directory, boolean buildFilterChain) throws RpcException {
|
||||
return new MockClusterInvoker<>(directory, this.cluster.join(directory, buildFilterChain));
|
||||
return new MockClusterInvoker<T>(directory, this.cluster.join(directory, buildFilterChain));
|
||||
}
|
||||
|
||||
public Cluster getCluster() {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package org.apache.dubbo.rpc.cluster.loadbalance;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.rpc.Invocation;
|
||||
import org.apache.dubbo.rpc.Invoker;
|
||||
import org.apache.dubbo.rpc.cluster.LoadBalance;
|
||||
import org.apache.dubbo.rpc.cluster.RouterChain;
|
||||
|
|
@ -26,15 +25,11 @@ import org.apache.dubbo.rpc.cluster.router.state.BitList;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
class ConsistentHashLoadBalanceTest extends LoadBalanceBaseTest {
|
||||
|
||||
|
|
@ -50,34 +45,6 @@ class ConsistentHashLoadBalanceTest extends LoadBalanceBaseTest {
|
|||
Assertions.assertEquals(hitted, genericHitted, "hitted should equals to genericHitted");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testArgumentMatchAll() {
|
||||
Map<Invoker, AtomicLong> counter = new ConcurrentHashMap<Invoker, AtomicLong>();
|
||||
LoadBalance lb = getLoadBalance(ConsistentHashLoadBalance.NAME);
|
||||
for (Invoker invoker : invokers) {
|
||||
counter.put(invoker, new AtomicLong(0));
|
||||
}
|
||||
URL url = invokers.get(0).getUrl();
|
||||
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
Invocation invocation = mock(Invocation.class);
|
||||
String methodName = "method1";
|
||||
given(invocation.getMethodName()).willReturn("$invoke");
|
||||
String[] paraTypes = new String[] {String.class.getName(), String.class.getName(), String.class.getName()};
|
||||
Object[] argsObject = new Object[] {"arg" + i, "arg2", "arg3"};
|
||||
Object[] args = new Object[] {methodName, paraTypes, argsObject};
|
||||
given(invocation.getArguments()).willReturn(args);
|
||||
|
||||
for (int j = 0; j < 5; j++) {
|
||||
Invoker sinvoker = lb.select(invokers, url, invocation);
|
||||
counter.get(sinvoker).incrementAndGet();
|
||||
}
|
||||
}
|
||||
for (Invoker invoker : invokers) {
|
||||
Assertions.assertTrue(counter.get(invoker).get() > 0);
|
||||
}
|
||||
}
|
||||
|
||||
private Invoker findHitted(Map<Invoker, AtomicLong> invokerCounter) {
|
||||
Invoker invoker = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ import java.util.HashSet;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
@ -578,44 +576,4 @@ class BitListTest {
|
|||
set.add(new LinkedList<>(Arrays.asList("A", "B", "C", "D", "E", "F", "G")));
|
||||
Assertions.assertEquals(2, set.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testConcurrent() throws InterruptedException {
|
||||
for (int i = 0; i < 100000; i++) {
|
||||
BitList<String> bitList = new BitList<>(Collections.singletonList("test"));
|
||||
bitList.remove("test");
|
||||
|
||||
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||
CountDownLatch countDownLatch2 = new CountDownLatch(2);
|
||||
|
||||
Thread thread1 = new Thread(() -> {
|
||||
try {
|
||||
countDownLatch.await();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
bitList.add("test");
|
||||
countDownLatch2.countDown();
|
||||
});
|
||||
|
||||
AtomicReference<BitList<String>> ref = new AtomicReference<>();
|
||||
Thread thread2 = new Thread(() -> {
|
||||
try {
|
||||
countDownLatch.await();
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
ref.set(bitList.clone());
|
||||
countDownLatch2.countDown();
|
||||
});
|
||||
|
||||
thread1.start();
|
||||
thread2.start();
|
||||
|
||||
countDownLatch.countDown();
|
||||
countDownLatch2.await();
|
||||
|
||||
Assertions.assertDoesNotThrow(() -> ref.get().iterator().hasNext());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,10 +99,5 @@
|
|||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ public /*final**/ class URL implements Serializable {
|
|||
}
|
||||
|
||||
static String appendDefaultPort(String address, int defaultPort) {
|
||||
if (StringUtils.isNotEmpty(address) && defaultPort > 0) {
|
||||
if (address != null && address.length() > 0 && defaultPort > 0) {
|
||||
int i = address.indexOf(':');
|
||||
if (i < 0) {
|
||||
return address + ":" + defaultPort;
|
||||
|
|
@ -525,7 +525,7 @@ public /*final**/ class URL implements Serializable {
|
|||
List<URL> urls = new ArrayList<>();
|
||||
urls.add(this);
|
||||
String[] backups = getParameter(RemotingConstants.BACKUP_KEY, new String[0]);
|
||||
if (ArrayUtils.isNotEmpty(backups)) {
|
||||
if (backups != null && backups.length > 0) {
|
||||
for (String backup : backups) {
|
||||
urls.add(this.setAddress(backup));
|
||||
}
|
||||
|
|
@ -805,7 +805,7 @@ public /*final**/ class URL implements Serializable {
|
|||
|
||||
public boolean hasParameter(String key) {
|
||||
String value = getParameter(key);
|
||||
return StringUtils.isNotEmpty(value);
|
||||
return value != null && value.length() > 0;
|
||||
}
|
||||
|
||||
public String getMethodParameterAndDecoded(String method, String key) {
|
||||
|
|
@ -1061,7 +1061,7 @@ public /*final**/ class URL implements Serializable {
|
|||
}
|
||||
|
||||
public URL addParameters(String... pairs) {
|
||||
if (ArrayUtils.isEmpty(pairs)) {
|
||||
if (pairs == null || pairs.length == 0) {
|
||||
return this;
|
||||
}
|
||||
if (pairs.length % 2 != 0) {
|
||||
|
|
@ -1295,19 +1295,6 @@ public /*final**/ class URL implements Serializable {
|
|||
return serviceNameBuilder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* The format is "{interface}:[version]"
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCompatibleColonSeparatedKey() {
|
||||
StringBuilder serviceNameBuilder = new StringBuilder();
|
||||
serviceNameBuilder.append(this.getServiceInterface());
|
||||
compatibleAppend(serviceNameBuilder, VERSION_KEY);
|
||||
compatibleAppend(serviceNameBuilder, GROUP_KEY);
|
||||
return serviceNameBuilder.toString();
|
||||
}
|
||||
|
||||
private void append(StringBuilder target, String parameterName, boolean first) {
|
||||
String parameterValue = this.getParameter(parameterName);
|
||||
if (!isBlank(parameterValue)) {
|
||||
|
|
@ -1320,14 +1307,6 @@ public /*final**/ class URL implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
private void compatibleAppend(StringBuilder target, String parameterName) {
|
||||
String parameterValue = this.getParameter(parameterName);
|
||||
if (!isBlank(parameterValue)) {
|
||||
target.append(':');
|
||||
target.append(parameterValue);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The format of return value is '{group}/{interfaceName}:{version}'
|
||||
*
|
||||
|
|
@ -1397,10 +1376,6 @@ public /*final**/ class URL implements Serializable {
|
|||
return buildString(true, false, true, true);
|
||||
}
|
||||
|
||||
public String toServiceString(String... parameters) {
|
||||
return buildString(true, true, true, true, parameters);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getServiceName() {
|
||||
return getServiceInterface();
|
||||
|
|
@ -1614,9 +1589,9 @@ public /*final**/ class URL implements Serializable {
|
|||
return attributes == null ? Collections.emptyMap() : attributes;
|
||||
}
|
||||
|
||||
public URL addAttributes(Map<String, Object> attributeMap) {
|
||||
if (attributeMap != null) {
|
||||
attributes.putAll(attributeMap);
|
||||
public URL addAttributes(Map<String, Object> attributes) {
|
||||
if (attributes != null) {
|
||||
attributes.putAll(attributes);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
|
@ -1743,7 +1718,7 @@ public /*final**/ class URL implements Serializable {
|
|||
|
||||
public boolean hasServiceParameter(String service, String key) {
|
||||
String value = getServiceParameter(service, key);
|
||||
return StringUtils.isNotEmpty(value);
|
||||
return value != null && value.length() > 0;
|
||||
}
|
||||
|
||||
public float getPositiveServiceParameter(String service, String key, float defaultValue) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package org.apache.dubbo.common;
|
||||
|
||||
import org.apache.dubbo.common.url.component.ServiceConfigURL;
|
||||
import org.apache.dubbo.common.utils.ArrayUtils;
|
||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
import org.apache.dubbo.rpc.model.ScopeModel;
|
||||
|
|
@ -377,7 +376,7 @@ public final class URLBuilder extends ServiceConfigURL {
|
|||
|
||||
@Override
|
||||
public URLBuilder addParameters(String... pairs) {
|
||||
if (ArrayUtils.isEmpty(pairs)) {
|
||||
if (pairs == null || pairs.length == 0) {
|
||||
return this;
|
||||
}
|
||||
if (pairs.length % 2 != 0) {
|
||||
|
|
@ -417,7 +416,7 @@ public final class URLBuilder extends ServiceConfigURL {
|
|||
|
||||
@Override
|
||||
public URLBuilder removeParameters(String... keys) {
|
||||
if (ArrayUtils.isEmpty(keys)) {
|
||||
if (keys == null || keys.length == 0) {
|
||||
return this;
|
||||
}
|
||||
for (String key : keys) {
|
||||
|
|
@ -459,7 +458,7 @@ public final class URLBuilder extends ServiceConfigURL {
|
|||
return false;
|
||||
}
|
||||
String value = getMethodParameter(method, key);
|
||||
return StringUtils.isNotEmpty(value);
|
||||
return value != null && value.length() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.dubbo.common;
|
||||
|
||||
import org.apache.dubbo.common.constants.CommonConstants;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
|
|
@ -61,7 +60,7 @@ public final class Version {
|
|||
public static final int LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT = 2000200; // 2.0.2
|
||||
|
||||
public static final int HIGHEST_PROTOCOL_VERSION = 2009900; // 2.0.99
|
||||
private static final Map<String, Integer> VERSION2INT = new HashMap<>();
|
||||
private static final Map<String, Integer> VERSION2INT = new HashMap<String, Integer>();
|
||||
|
||||
static {
|
||||
// get dubbo version and last commit id
|
||||
|
|
@ -85,8 +84,7 @@ public final class Version {
|
|||
}
|
||||
|
||||
private static void tryLoadVersionFromResource() throws IOException {
|
||||
Enumeration<URL> configLoader =
|
||||
Version.class.getClassLoader().getResources(CommonConstants.DUBBO_VERSIONS_KEY + "/dubbo-common");
|
||||
Enumeration<URL> configLoader = Version.class.getClassLoader().getResources("META-INF/versions/dubbo-common");
|
||||
if (configLoader.hasMoreElements()) {
|
||||
URL url = configLoader.nextElement();
|
||||
try (BufferedReader reader =
|
||||
|
|
@ -314,7 +312,7 @@ public final class Version {
|
|||
|
||||
private static void checkArtifact(String artifactId) throws IOException {
|
||||
Enumeration<URL> artifactEnumeration =
|
||||
Version.class.getClassLoader().getResources(CommonConstants.DUBBO_VERSIONS_KEY + artifactId);
|
||||
Version.class.getClassLoader().getResources("META-INF/versions/" + artifactId);
|
||||
while (artifactEnumeration.hasMoreElements()) {
|
||||
URL url = artifactEnumeration.nextElement();
|
||||
try (BufferedReader reader =
|
||||
|
|
@ -350,7 +348,7 @@ public final class Version {
|
|||
|
||||
private static Set<String> loadArtifactIds() throws IOException {
|
||||
Enumeration<URL> artifactsEnumeration =
|
||||
Version.class.getClassLoader().getResources(CommonConstants.DUBBO_VERSIONS_KEY + "/.artifacts");
|
||||
Version.class.getClassLoader().getResources("META-INF/versions/.artifacts");
|
||||
Set<String> artifactIds = new HashSet<>();
|
||||
while (artifactsEnumeration.hasMoreElements()) {
|
||||
URL url = artifactsEnumeration.nextElement();
|
||||
|
|
|
|||
|
|
@ -25,13 +25,11 @@ import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
|||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.resource.Disposable;
|
||||
import org.apache.dubbo.common.utils.ConcurrentHashMapUtils;
|
||||
import org.apache.dubbo.common.utils.ConcurrentHashSet;
|
||||
import org.apache.dubbo.common.utils.StringUtils;
|
||||
import org.apache.dubbo.rpc.model.ScopeModelAccessor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
|
@ -55,7 +53,7 @@ public class ScopeBeanFactory {
|
|||
private final List<BeanInfo> registeredBeanInfos = new CopyOnWriteArrayList<>();
|
||||
private InstantiationStrategy instantiationStrategy;
|
||||
private final AtomicBoolean destroyed = new AtomicBoolean();
|
||||
private final Set<Class<?>> registeredClasses = new ConcurrentHashSet<>();
|
||||
private List<Class<?>> registeredClasses = new ArrayList<>();
|
||||
|
||||
public ScopeBeanFactory(ScopeBeanFactory parent, ExtensionAccessor extensionAccessor) {
|
||||
this.parent = parent;
|
||||
|
|
@ -301,7 +299,7 @@ public class ScopeBeanFactory {
|
|||
}
|
||||
}
|
||||
|
||||
public Set<Class<?>> getRegisteredClasses() {
|
||||
public List<Class<?>> getRegisteredClasses() {
|
||||
return registeredClasses;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import java.util.Map;
|
|||
public final class JavaBeanSerializeUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(JavaBeanSerializeUtil.class);
|
||||
private static final Map<String, Class<?>> TYPES = new HashMap<>();
|
||||
private static final Map<String, Class<?>> TYPES = new HashMap<String, Class<?>>();
|
||||
private static final String ARRAY_PREFIX = "[";
|
||||
private static final String REFERENCE_TYPE_PREFIX = "L";
|
||||
private static final String REFERENCE_TYPE_SUFFIX = ";";
|
||||
|
|
@ -72,7 +72,7 @@ public final class JavaBeanSerializeUtil {
|
|||
if (obj instanceof JavaBeanDescriptor) {
|
||||
return (JavaBeanDescriptor) obj;
|
||||
}
|
||||
IdentityHashMap<Object, JavaBeanDescriptor> cache = new IdentityHashMap<>();
|
||||
IdentityHashMap<Object, JavaBeanDescriptor> cache = new IdentityHashMap<Object, JavaBeanDescriptor>();
|
||||
return createDescriptorIfAbsent(obj, accessor, cache);
|
||||
}
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ public final class JavaBeanSerializeUtil {
|
|||
if (beanDescriptor == null) {
|
||||
return null;
|
||||
}
|
||||
IdentityHashMap<JavaBeanDescriptor, Object> cache = new IdentityHashMap<>();
|
||||
IdentityHashMap<JavaBeanDescriptor, Object> cache = new IdentityHashMap<JavaBeanDescriptor, Object>();
|
||||
Object result = instantiateForDeserialize(beanDescriptor, loader, cache);
|
||||
deserializeInternal(result, beanDescriptor, loader, cache);
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public abstract class Mixin {
|
|||
|
||||
Class<?> neighbor = null;
|
||||
// impl methods.
|
||||
Set<String> worked = new HashSet<>();
|
||||
Set<String> worked = new HashSet<String>();
|
||||
for (int i = 0; i < ics.length; i++) {
|
||||
if (!Modifier.isPublic(ics[i].getModifiers())) {
|
||||
String npkg = ics[i].getPackage().getName();
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ import javassist.CtMethod;
|
|||
* Wrapper.
|
||||
*/
|
||||
public abstract class Wrapper {
|
||||
// class wrapper map
|
||||
private static final ConcurrentMap<Class<?>, Wrapper> WRAPPER_MAP = new ConcurrentHashMap<>();
|
||||
private static final ConcurrentMap<Class<?>, Wrapper> WRAPPER_MAP =
|
||||
new ConcurrentHashMap<Class<?>, Wrapper>(); // class wrapper map
|
||||
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||
private static final String[] OBJECT_METHODS = new String[] {"getClass", "hashCode", "toString", "equals"};
|
||||
private static final Wrapper OBJECT_WRAPPER = new Wrapper() {
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ public class ClassUtils {
|
|||
}
|
||||
|
||||
public static <K, V> Map<K, V> toMap(Map.Entry<K, V>[] entries) {
|
||||
Map<K, V> map = new HashMap<>();
|
||||
Map<K, V> map = new HashMap<K, V>();
|
||||
if (entries != null && entries.length > 0) {
|
||||
for (Map.Entry<K, V> entry : entries) {
|
||||
map.put(entry.getKey(), entry.getValue());
|
||||
|
|
|
|||
|
|
@ -31,9 +31,10 @@ import java.io.StringReader;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
|
|
@ -42,7 +43,6 @@ import java.util.Set;
|
|||
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_SERVER_SHUTDOWN_TIMEOUT;
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.SHUTDOWN_WAIT_KEY;
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.SHUTDOWN_WAIT_SECONDS_KEY;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_PROPERTY_TYPE_MISMATCH;
|
||||
|
||||
/**
|
||||
* Utilities for manipulating configurations from different sources
|
||||
|
|
@ -57,18 +57,18 @@ public final class ConfigurationUtils {
|
|||
}
|
||||
|
||||
private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(ConfigurationUtils.class);
|
||||
private static final Set<String> securityKey;
|
||||
private static final List<String> securityKey;
|
||||
|
||||
private static volatile long expectedShutdownTime = Long.MAX_VALUE;
|
||||
|
||||
static {
|
||||
Set<String> keys = new HashSet<>();
|
||||
List<String> keys = new LinkedList<>();
|
||||
keys.add("accesslog");
|
||||
keys.add("router");
|
||||
keys.add("rule");
|
||||
keys.add("runtime");
|
||||
keys.add("type");
|
||||
securityKey = Collections.unmodifiableSet(keys);
|
||||
securityKey = Collections.unmodifiableList(keys);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -213,15 +213,11 @@ public final class ConfigurationUtils {
|
|||
properties.load(new StringReader(content));
|
||||
properties.stringPropertyNames().forEach(k -> {
|
||||
boolean deny = false;
|
||||
// check whether property name is safe or not based on the last fragment kebab-case comparison.
|
||||
String[] fragments = k.split("\\.");
|
||||
if (securityKey.contains(StringUtils.convertToSplitName(fragments[fragments.length - 1], "-"))) {
|
||||
deny = true;
|
||||
logger.warn(
|
||||
COMMON_PROPERTY_TYPE_MISMATCH,
|
||||
"security properties are not allowed to be set",
|
||||
"",
|
||||
String.format("'%s' is not allowed to be set as it is on the security key list.", k));
|
||||
for (String key : securityKey) {
|
||||
if (k.contains(key)) {
|
||||
deny = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!deny) {
|
||||
map.put(k, properties.getProperty(k));
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ import java.util.Map;
|
|||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_UNEXPECTED_EXCEPTION;
|
||||
|
||||
public class ModuleEnvironment extends Environment implements ModuleExt {
|
||||
|
||||
// delegate
|
||||
|
|
@ -92,13 +94,19 @@ public class ModuleEnvironment extends Environment implements ModuleExt {
|
|||
@Override
|
||||
public Configuration getDynamicGlobalConfiguration() {
|
||||
if (dynamicConfiguration == null) {
|
||||
CompositeConfiguration configuration = new CompositeConfiguration();
|
||||
configuration.addConfiguration(applicationDelegate.getDynamicGlobalConfiguration());
|
||||
configuration.addConfiguration(orderedPropertiesConfiguration);
|
||||
return configuration;
|
||||
return applicationDelegate.getDynamicGlobalConfiguration();
|
||||
}
|
||||
|
||||
if (dynamicGlobalConfiguration == null) {
|
||||
if (dynamicConfiguration == null) {
|
||||
if (logger.isWarnEnabled()) {
|
||||
logger.warn(
|
||||
COMMON_UNEXPECTED_EXCEPTION,
|
||||
"",
|
||||
"",
|
||||
"dynamicConfiguration is null , return globalConfiguration.");
|
||||
}
|
||||
return getConfiguration();
|
||||
}
|
||||
dynamicGlobalConfiguration = new CompositeConfiguration();
|
||||
dynamicGlobalConfiguration.addConfiguration(dynamicConfiguration);
|
||||
dynamicGlobalConfiguration.addConfiguration(getConfiguration());
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import static org.apache.dubbo.common.utils.PathUtils.normalize;
|
|||
* <ul>
|
||||
* <li>{@link FileSystemDynamicConfiguration "file"}</li>
|
||||
* <li>{@link org.apache.dubbo.configcenter.support.zookeeper.ZookeeperDynamicConfiguration "zookeeper"}</li>
|
||||
* <li>{@link org.apache.dubbo.configcenter.consul.ConsulDynamicConfiguration "consul"}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see DynamicConfiguration
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import java.util.concurrent.ExecutorService;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
public interface CommonConstants {
|
||||
|
||||
String DUBBO = "dubbo";
|
||||
|
||||
String TRIPLE = "tri";
|
||||
|
|
@ -268,14 +267,12 @@ public interface CommonConstants {
|
|||
String $INVOKE = "$invoke";
|
||||
|
||||
String $INVOKE_ASYNC = "$invokeAsync";
|
||||
|
||||
String GENERIC_PARAMETER_DESC = "Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/Object;";
|
||||
|
||||
/**
|
||||
* echo call
|
||||
*/
|
||||
String $ECHO = "$echo";
|
||||
|
||||
/**
|
||||
* package version in the manifest
|
||||
*/
|
||||
|
|
@ -286,19 +283,12 @@ public interface CommonConstants {
|
|||
int MAX_PROXY_COUNT = 65535;
|
||||
|
||||
String MONITOR_KEY = "monitor";
|
||||
|
||||
String BACKGROUND_KEY = "background";
|
||||
|
||||
String CLUSTER_KEY = "cluster";
|
||||
|
||||
String USERNAME_KEY = "username";
|
||||
|
||||
String PASSWORD_KEY = "password";
|
||||
|
||||
String HOST_KEY = "host";
|
||||
|
||||
String PORT_KEY = "port";
|
||||
|
||||
String DUBBO_IP_TO_BIND = "DUBBO_IP_TO_BIND";
|
||||
|
||||
/**
|
||||
|
|
@ -318,29 +308,21 @@ public interface CommonConstants {
|
|||
String SHUTDOWN_WAIT_SECONDS_KEY = "dubbo.service.shutdown.wait.seconds";
|
||||
|
||||
String SHUTDOWN_WAIT_KEY = "dubbo.service.shutdown.wait";
|
||||
|
||||
String DUBBO_PROTOCOL = "dubbo";
|
||||
|
||||
String DUBBO_LABELS = "dubbo.labels";
|
||||
|
||||
String DUBBO_ENV_KEYS = "dubbo.env.keys";
|
||||
|
||||
String CONFIG_CONFIGFILE_KEY = "config-file";
|
||||
|
||||
String CONFIG_ENABLE_KEY = "highest-priority";
|
||||
|
||||
String CONFIG_NAMESPACE_KEY = "namespace";
|
||||
|
||||
String CHECK_KEY = "check";
|
||||
|
||||
String BACKLOG_KEY = "backlog";
|
||||
|
||||
String HEARTBEAT_EVENT = null;
|
||||
|
||||
String MOCK_HEARTBEAT_EVENT = "H";
|
||||
|
||||
String READONLY_EVENT = "R";
|
||||
|
||||
String WRITEABLE_EVENT = "W";
|
||||
|
||||
String REFERENCE_FILTER_KEY = "reference.filter";
|
||||
|
|
@ -477,7 +459,6 @@ public interface CommonConstants {
|
|||
String REGISTRY_DELAY_NOTIFICATION_KEY = "delay-notification";
|
||||
|
||||
String CACHE_CLEAR_TASK_INTERVAL = "dubbo.application.url.cache.task.interval";
|
||||
|
||||
String CACHE_CLEAR_WAITING_THRESHOLD = "dubbo.application.url.cache.clear.waiting";
|
||||
|
||||
String CLUSTER_INTERCEPTOR_COMPATIBLE_KEY = "dubbo.application.cluster.interceptor.compatible";
|
||||
|
|
@ -634,18 +615,17 @@ public interface CommonConstants {
|
|||
String SERVICE_EXECUTOR = "service-executor";
|
||||
|
||||
String EXECUTOR_MANAGEMENT_MODE = "executor-management-mode";
|
||||
|
||||
String EXECUTOR_MANAGEMENT_MODE_DEFAULT = "default";
|
||||
|
||||
String EXECUTOR_MANAGEMENT_MODE_ISOLATION = "isolation";
|
||||
|
||||
/**
|
||||
*
|
||||
* used in JVMUtil.java ,Control stack print lines, default is 32 lines
|
||||
*
|
||||
*/
|
||||
String DUBBO_JSTACK_MAXLINE = "dubbo.jstack-dump.max-line";
|
||||
|
||||
String ENCODE_IN_IO_THREAD_KEY = "encode.in.io";
|
||||
|
||||
boolean DEFAULT_ENCODE_IN_IO_THREAD = false;
|
||||
|
||||
/**
|
||||
|
|
@ -666,8 +646,4 @@ public interface CommonConstants {
|
|||
String DUBBO_MANUAL_REGISTER_KEY = "dubbo.application.manual-register";
|
||||
|
||||
String DUBBO2_COMPACT_ENABLE = "dubbo.compact.enable";
|
||||
|
||||
String ZOOKEEPER_ENSEMBLE_TRACKER_KEY = "zookeeper.ensemble.tracker";
|
||||
|
||||
String DUBBO_VERSIONS_KEY = "META-INF/dubbo-versions";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,11 +141,4 @@ public interface RegistryConstants {
|
|||
String ENABLE_EMPTY_PROTECTION_KEY = "enable-empty-protection";
|
||||
boolean DEFAULT_ENABLE_EMPTY_PROTECTION = false;
|
||||
String REGISTER_CONSUMER_URL_KEY = "register-consumer-url";
|
||||
|
||||
/**
|
||||
* export noting suffix servicename
|
||||
* by default, dubbo export servicename is "${interface}:${version}:", this servicename with ':' suffix
|
||||
* for compatible, we should export noting suffix servicename, eg: ${interface}:${version}
|
||||
*/
|
||||
String NACOE_REGISTER_COMPATIBLE = "nacos.register-compatible";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ import java.util.Map;
|
|||
public interface JSON {
|
||||
boolean isSupport();
|
||||
|
||||
boolean isJson(String json);
|
||||
|
||||
<T> T toJavaObject(String json, Type type);
|
||||
|
||||
<T> List<T> toJavaList(String json, Class<T> clazz);
|
||||
|
|
|
|||
|
|
@ -19,17 +19,9 @@ package org.apache.dubbo.common.json.impl;
|
|||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson2.JSONValidator;
|
||||
import com.alibaba.fastjson2.JSONWriter;
|
||||
|
||||
public class FastJson2Impl extends AbstractJSONImpl {
|
||||
|
||||
@Override
|
||||
public boolean isJson(String json) {
|
||||
JSONValidator validator = JSONValidator.from(json);
|
||||
return validator.validate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T toJavaObject(String json, Type type) {
|
||||
return com.alibaba.fastjson2.JSON.parseObject(json, type);
|
||||
|
|
|
|||
|
|
@ -23,16 +23,6 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
|||
|
||||
public class FastJsonImpl extends AbstractJSONImpl {
|
||||
|
||||
@Override
|
||||
public boolean isJson(String json) {
|
||||
try {
|
||||
Object obj = com.alibaba.fastjson.JSON.parse(json);
|
||||
return obj instanceof com.alibaba.fastjson.JSONObject || obj instanceof com.alibaba.fastjson.JSONArray;
|
||||
} catch (com.alibaba.fastjson.JSONException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T toJavaObject(String json, Type type) {
|
||||
return com.alibaba.fastjson.JSON.parseObject(json, type);
|
||||
|
|
|
|||
|
|
@ -20,25 +20,12 @@ import java.lang.reflect.Type;
|
|||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
public class GsonImpl extends AbstractJSONImpl {
|
||||
// weak reference of com.google.gson.Gson, prevent throw exception when init
|
||||
private volatile Object gsonCache = null;
|
||||
|
||||
@Override
|
||||
public boolean isJson(String json) {
|
||||
try {
|
||||
JsonElement jsonElement = JsonParser.parseString(json);
|
||||
return jsonElement.isJsonObject() || jsonElement.isJsonArray();
|
||||
} catch (JsonSyntaxException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T toJavaObject(String json, Type type) {
|
||||
return getGson().fromJson(json, type);
|
||||
|
|
|
|||
|
|
@ -20,9 +20,7 @@ import java.lang.reflect.Type;
|
|||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.json.JsonMapper;
|
||||
|
|
@ -33,16 +31,6 @@ public class JacksonImpl extends AbstractJSONImpl {
|
|||
|
||||
private volatile Object jacksonCache = null;
|
||||
|
||||
@Override
|
||||
public boolean isJson(String json) {
|
||||
try {
|
||||
JsonNode node = objectMapper.readTree(json);
|
||||
return node.isObject() || node.isArray();
|
||||
} catch (JsonProcessingException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T toJavaObject(String json, Type type) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,4 @@ public interface DataStore {
|
|||
void put(String componentName, String key, Object value);
|
||||
|
||||
void remove(String componentName, String key);
|
||||
|
||||
default void addListener(DataStoreUpdateListener dataStoreUpdateListener) {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* 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.dubbo.common.store;
|
||||
|
||||
public interface DataStoreUpdateListener {
|
||||
void onUpdate(String componentName, String key, Object value);
|
||||
}
|
||||
|
|
@ -16,13 +16,8 @@
|
|||
*/
|
||||
package org.apache.dubbo.common.store.support;
|
||||
|
||||
import org.apache.dubbo.common.constants.LoggerCodeConstants;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.store.DataStore;
|
||||
import org.apache.dubbo.common.store.DataStoreUpdateListener;
|
||||
import org.apache.dubbo.common.utils.ConcurrentHashMapUtils;
|
||||
import org.apache.dubbo.common.utils.ConcurrentHashSet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -30,11 +25,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
public class SimpleDataStore implements DataStore {
|
||||
private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(SimpleDataStore.class);
|
||||
|
||||
// <component name or id, <data-name, data-value>>
|
||||
private final ConcurrentMap<String, ConcurrentMap<String, Object>> data = new ConcurrentHashMap<>();
|
||||
private final ConcurrentHashSet<DataStoreUpdateListener> listeners = new ConcurrentHashSet<>();
|
||||
|
||||
@Override
|
||||
public Map<String, Object> get(String componentName) {
|
||||
|
|
@ -59,7 +52,6 @@ public class SimpleDataStore implements DataStore {
|
|||
Map<String, Object> componentData =
|
||||
ConcurrentHashMapUtils.computeIfAbsent(data, componentName, k -> new ConcurrentHashMap<>());
|
||||
componentData.put(key, value);
|
||||
notifyListeners(componentName, key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -68,27 +60,5 @@ public class SimpleDataStore implements DataStore {
|
|||
return;
|
||||
}
|
||||
data.get(componentName).remove(key);
|
||||
notifyListeners(componentName, key, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(DataStoreUpdateListener dataStoreUpdateListener) {
|
||||
listeners.add(dataStoreUpdateListener);
|
||||
}
|
||||
|
||||
private void notifyListeners(String componentName, String key, Object value) {
|
||||
for (DataStoreUpdateListener listener : listeners) {
|
||||
try {
|
||||
listener.onUpdate(componentName, key, value);
|
||||
} catch (Throwable t) {
|
||||
logger.warn(
|
||||
LoggerCodeConstants.INTERNAL_ERROR,
|
||||
"",
|
||||
"",
|
||||
"Failed to notify data store update listener. " + "ComponentName: " + componentName + " Key: "
|
||||
+ key,
|
||||
t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class InternalThreadLocalMap {
|
|||
|
||||
private Object[] indexedVariables;
|
||||
|
||||
private static ThreadLocal<InternalThreadLocalMap> slowThreadLocalMap = new ThreadLocal<>();
|
||||
private static ThreadLocal<InternalThreadLocalMap> slowThreadLocalMap = new ThreadLocal<InternalThreadLocalMap>();
|
||||
|
||||
private static final AtomicInteger NEXT_INDEX = new AtomicInteger();
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ public class AbortPolicyWithReport extends ThreadPoolExecutor.AbortPolicy {
|
|||
// 0-1 - Thread pool is EXHAUSTED!
|
||||
logger.warn(COMMON_THREAD_POOL_EXHAUSTED, "too much client requesting provider", "", msg);
|
||||
|
||||
if (Boolean.parseBoolean(url.getParameter(DUMP_ENABLE, Boolean.TRUE.toString()))) {
|
||||
if (Boolean.parseBoolean(url.getParameter(DUMP_ENABLE, "true"))) {
|
||||
dumpJStack();
|
||||
}
|
||||
|
||||
|
|
@ -156,13 +156,13 @@ public class AbortPolicyWithReport extends ThreadPoolExecutor.AbortPolicy {
|
|||
if (!guard.tryAcquire()) {
|
||||
return;
|
||||
}
|
||||
ExecutorService pool = null;
|
||||
// To avoid multiple dump, check again
|
||||
if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) {
|
||||
return;
|
||||
}
|
||||
|
||||
ExecutorService pool = Executors.newSingleThreadExecutor();
|
||||
try {
|
||||
// To avoid multiple dump, check again
|
||||
if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) {
|
||||
return;
|
||||
}
|
||||
pool = Executors.newSingleThreadExecutor();
|
||||
pool.execute(() -> {
|
||||
String dumpPath = getDumpPath();
|
||||
|
||||
|
|
@ -186,14 +186,12 @@ public class AbortPolicyWithReport extends ThreadPoolExecutor.AbortPolicy {
|
|||
logger.error(COMMON_UNEXPECTED_CREATE_DUMP, "", "", "dump jStack error", t);
|
||||
} finally {
|
||||
lastPrintTime = System.currentTimeMillis();
|
||||
guard.release();
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
guard.release();
|
||||
// must shut down thread pool ,if not will lead to OOM
|
||||
if (pool != null) {
|
||||
pool.shutdown();
|
||||
}
|
||||
// must shutdown thread pool ,if not will lead to OOM
|
||||
pool.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ public class HashedWheelTimer implements Timer {
|
|||
}
|
||||
|
||||
private final class Worker implements Runnable {
|
||||
private final Set<Timeout> unprocessedTimeouts = new HashSet<>();
|
||||
private final Set<Timeout> unprocessedTimeouts = new HashSet<Timeout>();
|
||||
|
||||
private long tick;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,12 +113,12 @@ public class ServiceConfigURL extends URL {
|
|||
}
|
||||
|
||||
@Override
|
||||
public URL addAttributes(Map<String, Object> attributeMap) {
|
||||
public URL addAttributes(Map<String, Object> attributes) {
|
||||
Map<String, Object> newAttributes = new HashMap<>();
|
||||
if (this.attributes != null) {
|
||||
newAttributes.putAll(this.attributes);
|
||||
}
|
||||
newAttributes.putAll(attributeMap);
|
||||
newAttributes.putAll(attributes);
|
||||
return new ServiceConfigURL(getUrlAddress(), getUrlParam(), newAttributes);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class CIDRUtils {
|
|||
|
||||
private byte[] toBytes(byte[] array, int targetSize) {
|
||||
int counter = 0;
|
||||
List<Byte> newArr = new ArrayList<>();
|
||||
List<Byte> newArr = new ArrayList<Byte>();
|
||||
while (counter < targetSize && (array.length - 1 - counter >= 0)) {
|
||||
newArr.add(0, array[array.length - 1 - counter]);
|
||||
counter++;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class ConfigUtils {
|
|||
*/
|
||||
public static List<String> mergeValues(
|
||||
ExtensionDirector extensionDirector, Class<?> type, String cfg, List<String> def) {
|
||||
List<String> defaults = new ArrayList<>();
|
||||
List<String> defaults = new ArrayList<String>();
|
||||
if (def != null) {
|
||||
for (String name : def) {
|
||||
if (extensionDirector.getExtensionLoader(type).hasExtension(name)) {
|
||||
|
|
@ -96,7 +96,7 @@ public class ConfigUtils {
|
|||
}
|
||||
}
|
||||
|
||||
List<String> names = new ArrayList<>();
|
||||
List<String> names = new ArrayList<String>();
|
||||
|
||||
// add initial values
|
||||
String[] configs = (cfg == null || cfg.trim().length() == 0) ? new String[0] : COMMA_SPLIT_PATTERN.split(cfg);
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ public class IOUtils {
|
|||
* @throws IOException If an I/O error occurs
|
||||
*/
|
||||
public static String[] readLines(InputStream is) throws IOException {
|
||||
List<String> lines = new ArrayList<>();
|
||||
List<String> lines = new ArrayList<String>();
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
|
|
|
|||
|
|
@ -146,8 +146,4 @@ public class JsonUtils {
|
|||
public static List<String> checkStringList(List<?> rawList) {
|
||||
return getJson().checkStringList(rawList);
|
||||
}
|
||||
|
||||
public static boolean checkJson(String json) {
|
||||
return getJson().isJson(json);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
* 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.dubbo.common.utils;
|
||||
|
||||
import org.apache.dubbo.common.constants.LoggerCodeConstants;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
|
||||
public class LockUtils {
|
||||
private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(LockUtils.class);
|
||||
|
||||
public static final int DEFAULT_TIMEOUT = 60_000;
|
||||
|
||||
public static void safeLock(Lock lock, int timeout, Runnable runnable) {
|
||||
try {
|
||||
if (!lock.tryLock(timeout, TimeUnit.MILLISECONDS)) {
|
||||
logger.error(
|
||||
LoggerCodeConstants.INTERNAL_ERROR,
|
||||
"",
|
||||
"",
|
||||
"Try to lock failed, timeout: " + timeout,
|
||||
new TimeoutException());
|
||||
}
|
||||
runnable.run();
|
||||
} catch (InterruptedException e) {
|
||||
logger.warn(LoggerCodeConstants.INTERNAL_ERROR, "", "", "Try to lock failed", e);
|
||||
Thread.currentThread().interrupt();
|
||||
} finally {
|
||||
try {
|
||||
lock.unlock();
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* 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.dubbo.common.utils;
|
||||
|
||||
import org.apache.dubbo.common.logger.Logger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.PROTOBUF_MESSAGE_CLASS_NAME;
|
||||
|
||||
public class ProtobufUtils {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ProtobufUtils.class);
|
||||
|
||||
private static Class<?> protobufClss;
|
||||
|
||||
private ProtobufUtils() {}
|
||||
|
||||
static {
|
||||
try {
|
||||
protobufClss = ClassUtils.forName(PROTOBUF_MESSAGE_CLASS_NAME, ProtobufUtils.class.getClassLoader());
|
||||
} catch (Throwable t) {
|
||||
logger.info("protobuf's dependency is absent");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isProtobufClass(Class<?> pojoClazz) {
|
||||
if (protobufClss != null) {
|
||||
return protobufClss.isAssignableFrom(pojoClazz);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ import java.util.List;
|
|||
public class Stack<E> {
|
||||
private int mSize = 0;
|
||||
|
||||
private final List<E> mElements = new ArrayList<>();
|
||||
private final List<E> mElements = new ArrayList<E>();
|
||||
|
||||
public Stack() {}
|
||||
|
||||
|
|
|
|||
|
|
@ -861,7 +861,7 @@ public final class StringUtils {
|
|||
*/
|
||||
private static Map<String, String> parseKeyValuePair(String str, String itemSeparator) {
|
||||
String[] tmp = str.split(itemSeparator);
|
||||
Map<String, String> map = new HashMap<>(tmp.length);
|
||||
Map<String, String> map = new HashMap<String, String>(tmp.length);
|
||||
for (int i = 0; i < tmp.length; i++) {
|
||||
Matcher matcher = KVP_PATTERN.matcher(tmp[i]);
|
||||
if (!matcher.matches()) {
|
||||
|
|
@ -885,7 +885,7 @@ public final class StringUtils {
|
|||
*/
|
||||
public static Map<String, String> parseQueryString(String qs) {
|
||||
if (isEmpty(qs)) {
|
||||
return new HashMap<>();
|
||||
return new HashMap<String, String>();
|
||||
}
|
||||
return parseKeyValuePair(qs, "\\&");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ public class UrlUtils {
|
|||
throw new IllegalArgumentException(
|
||||
"Addresses is not allowed to be empty, please re-enter."); // here won't be empty
|
||||
}
|
||||
List<URL> registries = new ArrayList<>();
|
||||
List<URL> registries = new ArrayList<URL>();
|
||||
for (String addr : addresses) {
|
||||
registries.add(parseURL(addr, defaults));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.apache.dubbo.common.Version;
|
|||
import org.apache.dubbo.common.config.ConfigurationUtils;
|
||||
import org.apache.dubbo.common.config.Environment;
|
||||
import org.apache.dubbo.common.config.InmemoryConfiguration;
|
||||
import org.apache.dubbo.common.utils.Assert;
|
||||
import org.apache.dubbo.common.utils.ClassUtils;
|
||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||
import org.apache.dubbo.common.utils.ConfigUtils;
|
||||
|
|
@ -53,6 +54,7 @@ import static org.apache.dubbo.common.constants.CommonConstants.RELEASE_KEY;
|
|||
import static org.apache.dubbo.common.constants.CommonConstants.TAG_KEY;
|
||||
import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY;
|
||||
import static org.apache.dubbo.common.constants.LoggerCodeConstants.CONFIG_NO_METHOD_FOUND;
|
||||
import static org.apache.dubbo.common.constants.MetricsConstants.PROTOCOL_PROMETHEUS;
|
||||
|
||||
/**
|
||||
* AbstractDefaultConfig
|
||||
|
|
@ -204,7 +206,7 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
/**
|
||||
* The url of the reference service
|
||||
*/
|
||||
protected final transient List<URL> urls = new ArrayList<>();
|
||||
protected final transient List<URL> urls = new ArrayList<URL>();
|
||||
|
||||
@Transient
|
||||
public List<URL> getExportedUrls() {
|
||||
|
|
@ -265,6 +267,23 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated After metrics config is refactored.
|
||||
* This method should no longer use and will be deleted in the future.
|
||||
*/
|
||||
@Deprecated
|
||||
protected void appendMetricsCompatible(Map<String, String> map) {
|
||||
MetricsConfig metricsConfig = getConfigManager().getMetrics().orElse(null);
|
||||
if (metricsConfig != null) {
|
||||
String protocol = Optional.ofNullable(metricsConfig.getProtocol()).orElse(PROTOCOL_PROMETHEUS);
|
||||
if (!StringUtils.isEquals(protocol, PROTOCOL_PROMETHEUS)) {
|
||||
Assert.notEmptyString(metricsConfig.getPort(), "Metrics port cannot be null");
|
||||
map.put("metrics.protocol", protocol);
|
||||
map.put("metrics.port", metricsConfig.getPort());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To obtain the method list in the port, use reflection when in native mode and javassist otherwise.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -155,12 +155,6 @@ public abstract class AbstractServiceConfig extends AbstractInterfaceConfig {
|
|||
*/
|
||||
private Integer payload;
|
||||
|
||||
/**
|
||||
* Whether to use java_package in IDL as path. Default use package.
|
||||
* This param only available when service using native stub.
|
||||
*/
|
||||
private Boolean useJavaPackageAsPath;
|
||||
|
||||
public AbstractServiceConfig() {}
|
||||
|
||||
public AbstractServiceConfig(ModuleModel moduleModel) {
|
||||
|
|
@ -176,9 +170,7 @@ public abstract class AbstractServiceConfig extends AbstractInterfaceConfig {
|
|||
if (dynamic == null) {
|
||||
dynamic = true;
|
||||
}
|
||||
if (useJavaPackageAsPath == null) {
|
||||
useJavaPackageAsPath = false;
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(preferSerialization)) {
|
||||
preferSerialization = serialization;
|
||||
}
|
||||
|
|
@ -396,13 +388,4 @@ public abstract class AbstractServiceConfig extends AbstractInterfaceConfig {
|
|||
public void setPayload(Integer payload) {
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
@Parameter(excluded = true, attribute = false)
|
||||
public Boolean getUseJavaPackageAsPath() {
|
||||
return useJavaPackageAsPath;
|
||||
}
|
||||
|
||||
public void setUseJavaPackageAsPath(Boolean useJavaPackageAsPath) {
|
||||
this.useJavaPackageAsPath = useJavaPackageAsPath;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ public class ApplicationConfig extends AbstractConfig {
|
|||
}
|
||||
|
||||
public void setRegistry(RegistryConfig registry) {
|
||||
List<RegistryConfig> registries = new ArrayList<>(1);
|
||||
List<RegistryConfig> registries = new ArrayList<RegistryConfig>(1);
|
||||
registries.add(registry);
|
||||
this.registries = registries;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,11 +149,7 @@ public interface Constants {
|
|||
|
||||
String SERVER_THREAD_POOL_NAME = "DubboServerHandler";
|
||||
|
||||
String SERVER_THREAD_POOL_PREFIX = SERVER_THREAD_POOL_NAME + "-";
|
||||
|
||||
String CLIENT_THREAD_POOL_NAME = "DubboClientHandler";
|
||||
|
||||
String CLIENT_THREAD_POOL_PREFIX = CLIENT_THREAD_POOL_NAME + "-";
|
||||
|
||||
String REST_PROTOCOL = "rest";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,13 @@ public class MetricsConfig extends AbstractConfig {
|
|||
*/
|
||||
private Integer collectorSyncPeriod;
|
||||
|
||||
/**
|
||||
* @deprecated After metrics config is refactored.
|
||||
* This parameter should no longer use and will be deleted in the future.
|
||||
*/
|
||||
@Deprecated
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* The prometheus metrics config
|
||||
*/
|
||||
|
|
@ -100,9 +107,6 @@ public class MetricsConfig extends AbstractConfig {
|
|||
*/
|
||||
private Boolean useGlobalRegistry;
|
||||
|
||||
/**
|
||||
* Enable rpc metrics.
|
||||
*/
|
||||
private Boolean enableRpc;
|
||||
|
||||
/**
|
||||
|
|
@ -159,6 +163,14 @@ public class MetricsConfig extends AbstractConfig {
|
|||
this.enableRegistry = enableRegistry;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public PrometheusConfig getPrometheus() {
|
||||
return prometheus;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ public class ModuleConfig extends AbstractConfig {
|
|||
}
|
||||
|
||||
public void setRegistry(RegistryConfig registry) {
|
||||
List<RegistryConfig> registries = new ArrayList<>(1);
|
||||
List<RegistryConfig> registries = new ArrayList<RegistryConfig>(1);
|
||||
registries.add(registry);
|
||||
this.registries = registries;
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ public class ModuleConfig extends AbstractConfig {
|
|||
|
||||
/**
|
||||
* Whether start module in background.
|
||||
* If start in background, do not await finish on Spring ContextRefreshedEvent.
|
||||
* If start in backgound, do not await finish on Spring ContextRefreshedEvent.
|
||||
*
|
||||
* @see org.apache.dubbo.config.spring.context.DubboDeployApplicationListener
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import static org.apache.dubbo.common.constants.CommonConstants.EXTRA_KEYS_KEY;
|
|||
import static org.apache.dubbo.common.constants.CommonConstants.SHUTDOWN_WAIT_KEY;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.ENABLE_EMPTY_PROTECTION_KEY;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTER_MODE_KEY;
|
||||
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_CLUSTER_KEY;
|
||||
import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY;
|
||||
import static org.apache.dubbo.common.utils.PojoUtils.updatePropertyIfAbsent;
|
||||
|
||||
|
|
@ -220,6 +221,7 @@ public class RegistryConfig extends AbstractConfig {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Parameter(key = REGISTRY_CLUSTER_KEY)
|
||||
public String getId() {
|
||||
return super.getId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,17 +257,7 @@ public @interface DubboService {
|
|||
String[] listener() default {};
|
||||
|
||||
/**
|
||||
* Customized parameter key-value pair, for example:
|
||||
* <pre>
|
||||
* ["a","b"] ==> {a=b}
|
||||
* [" a "," b "] ==> {a=b}
|
||||
* ["a=b"] ==>{a=b}
|
||||
* ["a:b"] ==>{a=b}
|
||||
* ["a=b","c","d"] ==>{a=b,c=d}
|
||||
* ["a","a:b"] ==>{a="a:b"}
|
||||
* ["a","a,b"] ==>{a="a,b"}
|
||||
* </pre>
|
||||
* @see org.apache.dubbo.config.spring.util.DubboAnnotationUtils#convertParameters(java.lang.String[])
|
||||
* Customized parameter key-value pair, for example: {key1, value1, key2, value2}
|
||||
*/
|
||||
String[] parameters() default {};
|
||||
|
||||
|
|
@ -337,21 +327,4 @@ public @interface DubboService {
|
|||
* Payload max length.
|
||||
*/
|
||||
String payload() default "";
|
||||
|
||||
/**
|
||||
* The serialization type
|
||||
*/
|
||||
String serialization() default "";
|
||||
|
||||
/**
|
||||
* If the parameter has a value, the consumer will read the parameter first.
|
||||
* If the Dubbo Sdk you are using contains the serialization type, the serialization method specified by the argument is used.
|
||||
* <p>
|
||||
* When this parameter is null or the serialization type specified by this parameter does not exist in the Dubbo SDK, the serialization type specified by serialization is used.
|
||||
* If the Dubbo SDK if still does not exist, the default type of the Dubbo SDK is used.
|
||||
* For Dubbo SDK >= 3.2, <code>preferSerialization</code> takes precedence over <code>serialization</code>
|
||||
* <p>
|
||||
* The configuration supports multiple, which are separated by commas.Such as:<code>fastjson2,fastjson,hessian2</code>
|
||||
*/
|
||||
String preferSerialization() default "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,18 +32,15 @@ import java.util.Map;
|
|||
public final class DefaultTypeBuilder {
|
||||
|
||||
public static TypeDefinition build(Class<?> clazz, Map<String, TypeDefinition> typeCache) {
|
||||
String className = clazz.getCanonicalName();
|
||||
if (className == null) {
|
||||
className = clazz.getName();
|
||||
}
|
||||
final String canonicalName = clazz.getCanonicalName();
|
||||
|
||||
// Try to get a cached definition
|
||||
TypeDefinition td = typeCache.get(className);
|
||||
TypeDefinition td = typeCache.get(canonicalName);
|
||||
if (td != null) {
|
||||
return td;
|
||||
}
|
||||
td = new TypeDefinition(className);
|
||||
typeCache.put(className, td);
|
||||
td = new TypeDefinition(canonicalName);
|
||||
typeCache.put(canonicalName, td);
|
||||
|
||||
// Primitive type
|
||||
if (!JaketConfigurationUtils.needAnalyzing(clazz)) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public final class ClassUtils {
|
|||
* @return methods list
|
||||
*/
|
||||
public static List<Method> getPublicNonStaticMethods(final Class<?> clazz) {
|
||||
List<Method> result = new ArrayList<>();
|
||||
List<Method> result = new ArrayList<Method>();
|
||||
|
||||
Method[] methods = clazz.getMethods();
|
||||
for (Method method : methods) {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class ProviderModel extends ServiceModel {
|
|||
}
|
||||
|
||||
public List<ProviderMethodModel> getAllMethodModels() {
|
||||
List<ProviderMethodModel> result = new ArrayList<>();
|
||||
List<ProviderMethodModel> result = new ArrayList<ProviderMethodModel>();
|
||||
for (List<ProviderMethodModel> models : methods.values()) {
|
||||
result.addAll(models);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import java.util.stream.Stream;
|
|||
|
||||
public class StubMethodDescriptor implements MethodDescriptor, PackableMethod {
|
||||
private static final Logger logger = LoggerFactory.getLogger(StubMethodDescriptor.class);
|
||||
private final ServiceDescriptor serviceDescriptor;
|
||||
private final ConcurrentMap<String, Object> attributeMap = new ConcurrentHashMap<>();
|
||||
private final String methodName;
|
||||
private final String[] compatibleParamSignatures;
|
||||
|
|
@ -45,12 +46,14 @@ public class StubMethodDescriptor implements MethodDescriptor, PackableMethod {
|
|||
String methodName,
|
||||
Class<?> requestClass,
|
||||
Class<?> responseClass,
|
||||
StubServiceDescriptor serviceDescriptor,
|
||||
RpcType rpcType,
|
||||
Pack requestPack,
|
||||
Pack responsePack,
|
||||
UnPack requestUnpack,
|
||||
UnPack responseUnpack) {
|
||||
this.methodName = methodName;
|
||||
this.serviceDescriptor = serviceDescriptor;
|
||||
this.rpcType = rpcType;
|
||||
this.requestPack = requestPack;
|
||||
this.responsePack = responsePack;
|
||||
|
|
@ -62,6 +65,7 @@ public class StubMethodDescriptor implements MethodDescriptor, PackableMethod {
|
|||
this.compatibleParamSignatures =
|
||||
Stream.of(parameterClasses).map(Class::getName).toArray(String[]::new);
|
||||
this.returnTypes = new Type[] {responseClass, responseClass};
|
||||
serviceDescriptor.addMethod(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ org.apache.commons.fileupload
|
|||
org.apache.commons.jelly.
|
||||
org.apache.commons.logging.
|
||||
org.apache.commons.proxy.
|
||||
org.apache.cxf.jaxrs.provider.
|
||||
org.apache.hadoop.shaded.com.zaxxer.hikari.
|
||||
org.apache.http.auth.
|
||||
org.apache.http.conn.
|
||||
|
|
@ -190,6 +191,7 @@ org.thymeleaf.
|
|||
org.yaml.snakeyaml.tokens.
|
||||
pstore.shaded.org.apache.commons.collections.
|
||||
sun.print.
|
||||
sun.rmi.
|
||||
sun.rmi.server.
|
||||
sun.rmi.transport.
|
||||
weblogic.ejb20.internal.
|
||||
weblogic.jms.common.
|
||||
|
|
|
|||
|
|
@ -38,11 +38,8 @@ class URLStrParserTest {
|
|||
testCases.add("dubbo://192.168.1.1");
|
||||
testCases.add("dubbo://192.168.1.1?");
|
||||
testCases.add("dubbo://127.0.0.1?test=中文测试");
|
||||
testCases.add("dubbo://admin:admin123@192.168.1.41:28113/org.test.api"
|
||||
+ ".DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org"
|
||||
+ ".test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4"
|
||||
+ ".17&service.filter=bootMetrics&side=provider&status=server&threads=200×tamp=1583136298859"
|
||||
+ "&version=1.0.0");
|
||||
testCases.add(
|
||||
"dubbo://admin:admin123@192.168.1.41:28113/org.test.api.DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org.test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4.17&service.filter=bootMetrics&side=provider&status=server&threads=200×tamp=1583136298859&version=1.0.0");
|
||||
// super long text test
|
||||
testCases.add("dubbo://192.168.1.1/" + RandomString.make(10240));
|
||||
testCases.add("file:/path/to/file.txt");
|
||||
|
|
@ -60,8 +57,8 @@ class URLStrParserTest {
|
|||
errorEncodedCases.add("dubbo%3a192.168.1.1%3fabc%3dabc");
|
||||
errorEncodedCases.add("%3a%2f%2f192.168.1.1%3fabc%3dabc");
|
||||
errorEncodedCases.add("%3a%2f192.168.1.1%3fabc%3dabc");
|
||||
errorEncodedCases.add("dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86"
|
||||
+ "%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b");
|
||||
errorEncodedCases.add(
|
||||
"dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -96,17 +93,4 @@ class URLStrParserTest {
|
|||
assertThat(url2.getParameter("timeout"), equalTo("5678"));
|
||||
assertThat(url2.getParameter("default.timeout"), equalTo("5678"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testPond() {
|
||||
String str = "https://a#@b";
|
||||
|
||||
URL url1 = URL.valueOf(str);
|
||||
URL url2 = URLStrParser.parseDecodedStr(str);
|
||||
|
||||
Assertions.assertEquals("https", url1.getProtocol());
|
||||
Assertions.assertEquals("https", url2.getProtocol());
|
||||
Assertions.assertEquals("a", url1.getHost());
|
||||
Assertions.assertEquals("a", url2.getHost());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1132,22 +1132,4 @@ class URLTest {
|
|||
assertEquals(20881, url.getPort());
|
||||
assertEquals("apache", url.getParameter("name"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToServiceString() {
|
||||
URL url = URL.valueOf(
|
||||
"zookeeper://10.20.130.230:4444/org.apache.dubbo.metadata.report.MetadataReport?version=1.0.0&application=vic&group=aaa");
|
||||
assertEquals(
|
||||
"zookeeper://10.20.130.230:4444/aaa/org.apache.dubbo.metadata.report.MetadataReport:1.0.0",
|
||||
url.toServiceString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToServiceStringWithParameters() {
|
||||
URL url = URL.valueOf(
|
||||
"zookeeper://10.20.130.230:4444/org.apache.dubbo.metadata.report.MetadataReport?version=1.0.0&application=vic&group=aaa&namespace=test");
|
||||
assertEquals(
|
||||
"zookeeper://10.20.130.230:4444/aaa/org.apache.dubbo.metadata.report.MetadataReport:1.0.0?namespace=test",
|
||||
url.toServiceString("namespace"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import java.lang.reflect.Method;
|
|||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import javassist.ClassPool;
|
||||
|
||||
|
|
@ -57,8 +56,7 @@ class ClassGeneratorTest {
|
|||
ClassGenerator cg = ClassGenerator.newInstance();
|
||||
|
||||
// add className, interface, superClass
|
||||
String className = BaseClass.class.getPackage().getName() + ".TestClass"
|
||||
+ UUID.randomUUID().toString().replace("-", "");
|
||||
String className = BaseClass.class.getPackage().getName() + ".TestClass";
|
||||
cg.setClassName(className);
|
||||
cg.addInterface(BaseInterface.class);
|
||||
cg.setSuperClass(BaseClass.class);
|
||||
|
|
@ -186,7 +184,7 @@ class ClassGeneratorTest {
|
|||
fname.setAccessible(true);
|
||||
|
||||
ClassGenerator cg = ClassGenerator.newInstance();
|
||||
cg.setClassName(Bean.class.getName() + "$Builder" + UUID.randomUUID().toString());
|
||||
cg.setClassName(Bean.class.getName() + "$Builder");
|
||||
cg.addInterface(Builder.class);
|
||||
|
||||
cg.addField("public static java.lang.reflect.Field FNAME;");
|
||||
|
|
@ -213,7 +211,7 @@ class ClassGeneratorTest {
|
|||
fname.setAccessible(true);
|
||||
|
||||
ClassGenerator cg = ClassGenerator.newInstance();
|
||||
cg.setClassName(Bean.class.getName() + "$Builder2" + UUID.randomUUID().toString());
|
||||
cg.setClassName(Bean.class.getName() + "$Builder2");
|
||||
cg.addInterface(Builder.class);
|
||||
|
||||
cg.addField("FNAME", Modifier.PUBLIC | Modifier.STATIC, java.lang.reflect.Field.class);
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@
|
|||
package org.apache.dubbo.common.config;
|
||||
|
||||
import org.apache.dubbo.rpc.model.ApplicationModel;
|
||||
import org.apache.dubbo.rpc.model.FrameworkModel;
|
||||
import org.apache.dubbo.rpc.model.ModuleModel;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
@ -34,18 +32,4 @@ class OrderedPropertiesConfigurationTest {
|
|||
ApplicationModel.defaultModel().getDefaultModule());
|
||||
Assertions.assertEquals("999", configuration.getInternalProperty("testKey"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetPropertyFromOrderedPropertiesConfiguration() {
|
||||
FrameworkModel frameworkModel = new FrameworkModel();
|
||||
|
||||
ApplicationModel applicationModel = frameworkModel.newApplication();
|
||||
|
||||
ModuleModel moduleModel = applicationModel.newModule();
|
||||
ModuleEnvironment moduleEnvironment = moduleModel.modelEnvironment();
|
||||
|
||||
Configuration configuration = moduleEnvironment.getDynamicGlobalConfiguration();
|
||||
// MockOrderedPropertiesProvider2 initProperties
|
||||
Assertions.assertEquals("999", configuration.getString("testKey"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ class ExtensionDirectorTest {
|
|||
// 2. Child ExtensionDirector can get extension instance from parent
|
||||
// 3. Parent ExtensionDirector can't get extension instance from child
|
||||
|
||||
ExtensionDirector fwExtensionDirector = FrameworkModel.defaultModel().getExtensionDirector();
|
||||
ExtensionDirector fwExtensionDirector =
|
||||
new ExtensionDirector(null, ExtensionScope.FRAMEWORK, FrameworkModel.defaultModel());
|
||||
ExtensionDirector appExtensionDirector =
|
||||
new ExtensionDirector(fwExtensionDirector, ExtensionScope.APPLICATION, ApplicationModel.defaultModel());
|
||||
ExtensionDirector moduleExtensionDirector = new ExtensionDirector(
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue