Skip to content

Commit

Permalink
Merge branch '3.3' into fix/aotUtil
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyHZM authored Feb 8, 2024
2 parents 404c5ed + e2ea004 commit 85356dc
Show file tree
Hide file tree
Showing 24 changed files with 648 additions and 965 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Apache Dubbo Project

[![Build and Test For PR](https://github.com/apache/dubbo/actions/workflows/build-and-test-pr.yml/badge.svg)](https://github.com/apache/dubbo/actions/workflows/build-and-test-pr.yml)
[![Codecov](https://codecov.io/gh/apache/dubbo/branch/3.2/graph/badge.svg)](https://codecov.io/gh/apache/dubbo)
[![Codecov](https://codecov.io/gh/apache/dubbo/branch/3.3/graph/badge.svg)](https://codecov.io/gh/apache/dubbo)
![Maven](https://img.shields.io/maven-central/v/org.apache.dubbo/dubbo.svg)
![License](https://img.shields.io/github/license/alibaba/dubbo.svg)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/apache/dubbo.svg)](http://isitmaintained.com/project/apache/dubbo "Average time to resolve an issue")
Expand Down Expand Up @@ -86,9 +86,9 @@ See [CONTRIBUTING](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md)
* 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.
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
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;
Expand Down Expand Up @@ -56,7 +55,6 @@
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;
import static org.apache.dubbo.config.Constants.DEFAULT_NATIVE_PROXY;

/**
Expand Down Expand Up @@ -284,23 +282,6 @@ public static void appendRuntimeParameters(Map<String, String> map) {
}
}

/**
* @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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ public class MetricsConfig extends AbstractConfig {
*/
private Integer collectorSyncPeriod;

/**
* Deprecated: This parameter should no longer be used and will be removed in the future.
*/
@Deprecated
private String port;

/**
* Configuration for Prometheus metrics collection.
*/
Expand Down Expand Up @@ -182,14 +176,6 @@ public void setEnableRegistry(Boolean enableRegistry) {
this.enableRegistry = enableRegistry;
}

public String getPort() {
return port;
}

public void setPort(String port) {
this.port = port;
}

public PrometheusConfig getPrometheus() {
return prometheus;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,18 @@
public final class DefaultTypeBuilder {

public static TypeDefinition build(Class<?> clazz, Map<String, TypeDefinition> typeCache) {
final String canonicalName = clazz.getCanonicalName();
String className = clazz.getCanonicalName();
if (className == null) {
className = clazz.getName();
}

// Try to get a cached definition
TypeDefinition td = typeCache.get(canonicalName);
TypeDefinition td = typeCache.get(className);
if (td != null) {
return td;
}
td = new TypeDefinition(canonicalName);
typeCache.put(canonicalName, td);
td = new TypeDefinition(className);
typeCache.put(className, td);

// Primitive type
if (!JaketConfigurationUtils.needAnalyzing(clazz)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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.metadata.definition;

import org.apache.dubbo.metadata.definition.builder.DefaultTypeBuilder;
import org.apache.dubbo.rpc.model.FrameworkModel;

import java.util.HashMap;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class DefaultTypeBuilderTest {
@Test
void testInnerClass() {
TypeDefinitionBuilder.initBuilders(FrameworkModel.defaultModel());

Assertions.assertEquals(
String.class.getName(),
DefaultTypeBuilder.build(String.class, new HashMap<>()).getType());

DefaultTypeBuilderTest innerObject = new DefaultTypeBuilderTest() {};
Assertions.assertEquals(
DefaultTypeBuilderTest.class.getName() + "$1",
DefaultTypeBuilder.build(innerObject.getClass(), new HashMap<>())
.getType());

TypeDefinitionBuilder.BUILDERS = null;
}
}
2 changes: 1 addition & 1 deletion dubbo-config/dubbo-config-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.19.3</version>
<version>1.19.4</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ private Map<String, String> appendConfig() {
AbstractConfig.appendParameters(map, getModule());
AbstractConfig.appendParameters(map, consumer);
AbstractConfig.appendParameters(map, this);
appendMetricsCompatible(map);

String hostToRegistry = ConfigUtils.getSystemProperty(DUBBO_IP_TO_REGISTRY);
if (StringUtils.isEmpty(hostToRegistry)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ private Map<String, String> buildAttributes(ProtocolConfig protocolConfig) {
AbstractConfig.appendParameters(map, provider);
AbstractConfig.appendParameters(map, protocolConfig);
AbstractConfig.appendParameters(map, this);
appendMetricsCompatible(map);

// append params with method configs,
if (CollectionUtils.isNotEmpty(getMethods())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1109,12 +1109,6 @@
</xsd:annotation>
</xsd:attribute>

<xsd:attribute name="port" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[ Deprecated. No longer use. ]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>

<xsd:attribute name="enable-rpc" type="xsd:boolean" default="true">
<xsd:annotation>
<xsd:documentation><![CDATA[ Enable record rpc metrics. ]]></xsd:documentation>
Expand Down
19 changes: 4 additions & 15 deletions dubbo-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<javassist_version>3.30.2-GA</javassist_version>
<byte-buddy_version>1.14.11</byte-buddy_version>
<netty_version>3.2.10.Final</netty_version>
<netty4_version>4.1.104.Final</netty4_version>
<netty4_version>4.1.106.Final</netty4_version>
<httpclient_version>4.5.14</httpclient_version>
<httpcore_version>4.4.16</httpcore_version>
<fastjson_version>1.2.83</fastjson_version>
Expand Down Expand Up @@ -166,9 +166,9 @@

<jaxb_version>2.2.7</jaxb_version>
<activation_version>1.2.0</activation_version>
<test_container_version>1.19.3</test_container_version>
<test_container_version>1.19.4</test_container_version>
<hessian_lite_version>3.2.13</hessian_lite_version>
<swagger_version>1.6.12</swagger_version>
<swagger_version>1.6.13</swagger_version>

<snappy_java_version>1.1.10.5</snappy_java_version>
<bouncycastle-bcprov_version>1.70</bouncycastle-bcprov_version>
Expand All @@ -180,7 +180,7 @@
<portlet_version>2.0</portlet_version>
<maven_flatten_version>1.6.0</maven_flatten_version>
<commons_compress_version>1.25.0</commons_compress_version>
<spotless-maven-plugin.version>2.42.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.43.0</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>
Expand Down Expand Up @@ -858,17 +858,6 @@
<artifactId>compiler</artifactId>
<version>${mustache_version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
<version>${fabric8_kubernetes_version}</version>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-server-mock</artifactId>
<version>${fabric8_kubernetes_version}</version>
<scope>test</scope>
</dependency>
<!-- tri compress support-->
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<slf4j_version>1.7.36</slf4j_version>
<curator5_version>5.1.0</curator5_version>
<zookeeper_version>3.8.3</zookeeper_version>
<spotless-maven-plugin.version>2.42.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.43.0</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>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<slf4j_version>1.7.36</slf4j_version>
<curator_version>4.3.0</curator_version>
<zookeeper_version>3.4.14</zookeeper_version>
<spotless-maven-plugin.version>2.42.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.43.0</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>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</modules>

<properties>
<spotless-maven-plugin.version>2.42.0</spotless-maven-plugin.version>
<spotless-maven-plugin.version>2.43.0</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>
Expand Down
28 changes: 14 additions & 14 deletions dubbo-distribution/dubbo-all-shaded/pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
Expand All @@ -14,8 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.dubbo</groupId>
Expand Down Expand Up @@ -474,10 +474,10 @@
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
<configuration>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
Expand Down Expand Up @@ -990,17 +990,6 @@
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven_javadoc_version}</version>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<doclint>none</doclint>
</configuration>
</execution>
</executions>
<configuration>
<includeDependencySources>true</includeDependencySources>
<dependencySourceIncludes>
Expand All @@ -1014,6 +1003,17 @@
<link>http://docs.oracle.com/javase/7/docs/api</link>
</links>
</configuration>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<doclint>none</doclint>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Loading

0 comments on commit 85356dc

Please sign in to comment.