Skip to content

Commit 1385ed9

Browse files
committed
[fit] 修改格式错误
1 parent 3e3c375 commit 1385ed9

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

framework/fit/java/fit-api/src/main/java/modelengine/fitframework/conf/runtime/RegistryConnectMode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*---------------------------------------------------------------------------------------------
2-
* Copyright (c) 2024 Huawei Technologies Co., Ltd. All rights reserved.
2+
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
33
* This file is a part of the ModelEngine Project.
44
* Licensed under the MIT License. See License.txt in the project root for license information.
55
*--------------------------------------------------------------------------------------------*/
@@ -37,7 +37,7 @@ public enum RegistryConnectMode {
3737
/**
3838
* 构造函数,初始化连接模式标识符。
3939
*
40-
* @param mode 注册中心连接模式的标识符(不能为空)
40+
* @param mode 注册中心连接模式的标识符(不能为空)
4141
*/
4242
RegistryConnectMode(String mode) {
4343
this.mode = notBlank(mode, "The registry connect mode cannot be blank.");
@@ -46,8 +46,8 @@ public enum RegistryConnectMode {
4646
/**
4747
* 根据字符串标识获取对应的枚举值。
4848
*
49-
* @param mode 字符串标识(如 "DIRECT"、"PROXY")
50-
* @return 匹配的 {@link RegistryConnectMode} 枚举值;如果无匹配项则返回 {@code null}
49+
* @param mode 字符串标识(如 "DIRECT"、"PROXY")
50+
* @return 匹配的 {@link RegistryConnectMode} 枚举值;如果无匹配项则返回 {@code DIRECT},默认为直连模式。
5151
*/
5252
public static RegistryConnectMode fromMode(String mode) {
5353
return Arrays.stream(RegistryConnectMode.values())

framework/fit/java/fit-builtin/plugins/fit-service-coordination-locator/src/main/java/modelengine/fit/service/locator/AddressRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
package modelengine.fit.service.locator;
88

9+
import static modelengine.fitframework.conf.runtime.RegistryConnectMode.PROXY;
910
import static modelengine.fitframework.inspection.Validation.greaterThan;
1011
import static modelengine.fitframework.inspection.Validation.notNull;
1112

@@ -16,7 +17,6 @@
1617
import modelengine.fitframework.broker.Target;
1718
import modelengine.fitframework.conf.runtime.CommunicationProtocol;
1819
import modelengine.fitframework.conf.runtime.MatataConfig;
19-
import modelengine.fitframework.conf.runtime.RegistryConnectMode;
2020
import modelengine.fitframework.conf.runtime.WorkerConfig;
2121
import modelengine.fitframework.log.Logger;
2222
import modelengine.fitframework.util.ObjectUtils;
@@ -56,7 +56,7 @@ public AddressRepository(List<FitServer> servers, WorkerConfig worker, MatataCon
5656
CommunicationProtocol protocol = matata.registry().protocol();
5757
String host = matata.registry().host();
5858

59-
if (RegistryConnectMode.PROXY.equals(matata.registry().mode())) {
59+
if (PROXY == matata.registry().mode()) {
6060
log.debug("The registry mode is Nacos, using the local proxy registry center.");
6161
int size = fitServer.endpoints().size();
6262
greaterThan(size, 0, "The fit server must have at least one endpoint.");

framework/fit/java/fit-builtin/plugins/fit-service-coordination-nacos/src/main/java/modelengine/fit/service/server/NacosConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ public class NacosConfig {
4545
* Ephemeral instances will be automatically removed from the registry after service deregistration.
4646
*/
4747
private Boolean isEphemeral;
48+
4849
/**
4950
* Service weight.
5051
* Used for weight calculation during load balancing.
5152
*/
5253
private Float weight;
54+
5355
/**
5456
* Heartbeat interval time (unit: milliseconds).
5557
* Defines the time interval for services to send heartbeats.

framework/fit/java/fit-builtin/plugins/fit-service-coordination-nacos/src/main/java/modelengine/fit/service/server/NacosRegistryServer.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,6 @@ private void unregisterSingleFitable(FitableInfo fitable, String workerId) {
237237
}
238238
}
239239

240-
/**
241-
* Unregister all instances matching the specified worker node ID.
242-
*
243-
* @param instances The instance list
244-
* @param workerId The worker node ID
245-
* @param serviceName The service name
246-
* @param groupName The group name
247-
*/
248240
private void unregisterMatchingInstances(List<Instance> instances, String workerId, String serviceName,
249241
String groupName) {
250242
for (Instance instance : instances) {

framework/fit/java/fit-conf/fit-conf/src/main/java/modelengine/fitframework/conf/runtime/DefaultRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ public void setExtensions(Map<String, Object> extensions) {
108108
}
109109

110110
/**
111-
* 设置 registry center 连接模式
111+
* 设置注册中心连接模式
112112
*
113-
* @param mode 表示待设置的 mode 配置的 {@link RegistryConnectMode}。
113+
* @param mode 表示待设置的模式配置的 {@link String}。
114114
*/
115115
public void setMode(String mode) {
116116
this.mode = mode;

0 commit comments

Comments
 (0)