Skip to content

Commit

Permalink
Merge pull request #5533 from alibaba/feature_support_grpc_core
Browse files Browse the repository at this point in the history
Upgrade to 2.0.1
  • Loading branch information
KomachiSion authored Apr 29, 2021
2 parents cef3607 + 4d4b337 commit d1a8180
Show file tree
Hide file tree
Showing 261 changed files with 13,159 additions and 2,621 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ script:
- mvn clean -Premove-test-data
- mvn -Prelease-nacos -Dmaven.test.skip=true clean install -U
- mvn clean -Premove-test-data
- mvn clean install -Pcit-test
- mvn clean package -Pcit-test
- mvn clean -Premove-test-data
- mvn clean package -Pit-test
- mvn clean package -Pnit-test
- mvn clean -Premove-test-data
after_success:
- mvn clean package -Pit-test
Expand Down
28 changes: 28 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,31 @@ under the License.
Also, please refer to each LICENSE.<component>.txt file, which is located in
the 'license' directory of the distribution file, for the license terms of the
components that this product depends on.

------
This product has a bundle Protocol Buffers��
Protocol Buffers
=======================
Protocol Buffers for Go with Gadgets

Copyright (c) 2013, The GoGo Authors. All rights reserved.
http://github.com/gogo/protobuf

------
This product has a bundle Istio��
Istio
=======================

Copyright 2018 Istio Authors

Licensed 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.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sh startup.sh -m standalone

On the **Windows** platform, run the following command to start server with standalone mode. Alternatively, you can also double-click the `startup.cmd` to run NacosServer.
```
cmd startup.cmd -m standalone
startup.cmd -m standalone
```

For more details, see [quick-start.](https://nacos.io/en-us/docs/quick-start.html)
Expand Down
6 changes: 4 additions & 2 deletions api/src/main/java/com/alibaba/nacos/api/PropertyKeyConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ public class PropertyKeyConst {
public static final String NAMING_CLIENT_BEAT_THREAD_COUNT = "namingClientBeatThreadCount";

public static final String NAMING_POLLING_THREAD_COUNT = "namingPollingThreadCount";

public static final String NAMING_REQUEST_DOMAIN_RETRY_COUNT = "namingRequestDomainMaxRetryCount";

public static final String NAMING_PUSH_EMPTY_PROTECTION = "namingPushEmptyProtection";


public static final String PUSH_RECEIVER_UDP_PORT = "push.receiver.udp.port";

/**
* Get the key value of some variable value from the system property.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public class Constants {

public static final String CONFIG_TYPE = "Config-Type";

public static final String ENCRYPTED_DATA_KEY = "Encrypted-Data-Key";

public static final String IF_MODIFIED_SINCE = "If-Modified-Since";

public static final String SPACING_INTERVAL = "client-spacing-interval";
Expand Down Expand Up @@ -158,7 +160,7 @@ public class Constants {

public static final int NAMING_INSTANCE_ID_SEG_COUNT = 4;

public static final String NAMING_HTTP_HEADER_SPILIER = "\\|";
public static final String NAMING_HTTP_HEADER_SPLITTER = "\\|";

public static final String DEFAULT_CLUSTER_NAME = "DEFAULT";

Expand Down
20 changes: 13 additions & 7 deletions api/src/main/java/com/alibaba/nacos/api/config/ConfigType.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import com.alibaba.nacos.api.utils.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
* Config data type.
*
Expand Down Expand Up @@ -60,7 +63,15 @@ public enum ConfigType {
*/
UNSET("unset");

String type;
private final String type;

private static final Map<String, ConfigType> LOCAL_MAP = new HashMap<String, ConfigType>();

static {
for (ConfigType configType : values()) {
LOCAL_MAP.put(configType.getType(), configType);
}
}

ConfigType(String type) {
this.type = type;
Expand All @@ -84,11 +95,6 @@ public static Boolean isValidType(String type) {
if (StringUtils.isBlank(type)) {
return false;
}
for (ConfigType value : values()) {
if (value.type.equals(type)) {
return true;
}
}
return false;
return null != LOCAL_MAP.get(type) ? true : false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface NacosConfigConverter<T> {
boolean canConvert(Class<T> targetType);

/**
* convert the Naocs's config of type S to target type T.
* Convert the Nacos' config of type S to target type T.
*
* @param config the Naocs's config to convert, which must be an instance of S (never {@code null})
* @return the converted object, which must be an instance of T (potentially {@code null})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@
* limitations under the License.
*/

package com.alibaba.nacos.test.naming;

import org.springframework.test.context.TestPropertySource;
package com.alibaba.nacos.api.config.filter;

/**
* Test context path is '/'.
* Config Filter Interface default implementation.
*
* @see <a href="https://github.com/alibaba/nacos/issues/4181">#4171</a>
* @author luyanbo(RobberPhex)
*/
@TestPropertySource(properties = {"server.servlet.context-path=/"})
public class RegisterInstance_With_RootContextPath_ITCase extends RegisterInstance_ITCase {

public abstract class AbstractConfigFilter implements IConfigFilter {

/**
* init.
*
* @param filterConfig Filter Config
*/
@Override
public void init(IFilterConfig filterConfig) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@

import com.alibaba.nacos.api.exception.NacosException;

import java.util.Properties;

/**
* Config Filter Interface.
*
* <p>DO NOT implement this interface directly, you should extend <code>AbstractConfigFilter</code>.
*
* @author Nacos
* @see AbstractConfigFilter
*/
public interface IConfigFilter {

Expand All @@ -30,8 +35,16 @@ public interface IConfigFilter {
*
* @param filterConfig Filter Config
*/
@Deprecated
void init(IFilterConfig filterConfig);

/**
* Init.
*
* @param properties Filter Config
*/
void init(Properties properties);

/**
* do filter.
*
Expand All @@ -43,11 +56,6 @@ public interface IConfigFilter {
void doFilter(IConfigRequest request, IConfigResponse response, IConfigFilterChain filterChain)
throws NacosException;

/**
* deploy.
*/
void deploy();

/**
* Get order.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
*/
public interface IConfigRequest {

/**
* put param.
*
* @param key key
* @param value value
*/
void putParameter(String key, Object value);

/**
* get param.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ public interface IConfigResponse {
*/
Object getParameter(String key);

/**
* put param.
*
* @param key key
* @param value value
*/
void putParameter(String key, Object value);

/**
* Get config context.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*
* @author Nacos
*/
@Deprecated
public interface IFilterConfig {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class ConfigQueryResponse extends Response {

String content;

String encryptedDataKey;

String contentType;

String md5;
Expand Down Expand Up @@ -120,6 +122,14 @@ public void setContent(String content) {
this.content = content;
}

public void setEncryptedDataKey(String encryptedDataKey) {
this.encryptedDataKey = encryptedDataKey;
}

public String getEncryptedDataKey() {
return encryptedDataKey;
}

/**
* Getter method for property <tt>contentType</tt>.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,35 @@
*/
public class ServerNamingAbility implements Serializable {

private boolean exampleAbility;
private static final long serialVersionUID = 8308895444341445512L;

public boolean isExampleAbility() {
return exampleAbility;
/**
* Nacos server can use SOFA-Jraft to handle persist service and metadata.
*/
private boolean supportJraft;

public boolean isSupportJraft() {
return supportJraft;
}

public void setExampleAbility(boolean exampleAbility) {
this.exampleAbility = exampleAbility;
public void setSupportJraft(boolean supportJraft) {
this.supportJraft = supportJraft;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof ServerNamingAbility)) {
return false;
}
ServerNamingAbility that = (ServerNamingAbility) o;
return exampleAbility == that.exampleAbility;
return supportJraft == that.supportJraft;
}

@Override
public int hashCode() {
return Objects.hash(exampleAbility);
return Objects.hash(supportJraft);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Map<String, String> getCustomHeaders() {
return Collections.emptyMap();
}
final Map<String, String> headerMap = new HashMap<String, String>(16);
for (final String s : headers.split(Constants.NAMING_HTTP_HEADER_SPILIER)) {
for (final String s : headers.split(Constants.NAMING_HTTP_HEADER_SPLITTER)) {
final String[] splits = s.split(":");
if (splits.length != 2) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public static String getGroupedName(final String serviceName, final String group
if (StringUtils.isBlank(serviceName)) {
throw new IllegalArgumentException("Param 'serviceName' is illegal, serviceName is blank");
}
if (StringUtils.isBlank(groupName)) {
throw new IllegalArgumentException("Param 'groupName' is illegal, groupName is blank");
}
final String resultGroupedName = groupName + Constants.SERVICE_INFO_SPLITER + serviceName;
return resultGroupedName.intern();
}
Expand Down Expand Up @@ -75,7 +78,7 @@ public static String getGroupName(final String serviceNameWithGroup) {
* <pre>
* serviceName = "@@"; the length = 0; illegal
* serviceName = "group@@"; the length = 1; illegal
* serviceName = "@@serviceName"; the length = 2; legal
* serviceName = "@@serviceName"; the length = 2; illegal
* serviceName = "group@@serviceName"; the length = 2; legal
* </pre>
*
Expand All @@ -87,6 +90,9 @@ public static void checkServiceNameFormat(String combineServiceName) {
throw new IllegalArgumentException(
"Param 'serviceName' is illegal, it should be format as 'groupName@@serviceName'");
}
if (split[0].isEmpty()) {
throw new IllegalArgumentException("Param 'serviceName' is illegal, groupName can't be empty");
}
}

/**
Expand Down
Loading

0 comments on commit d1a8180

Please sign in to comment.