Skip to content

Commit

Permalink
Optimize and update some code
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliguov5 committed Feb 9, 2021
1 parent c354121 commit c1dc32b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public String system() {
@Timed
@Path("backend")
@Produces(APPLICATION_JSON_WITH_CHARSET)
// @RolesAllowed({"admin", "$owner= $action=metrics_read"})
// @RolesAllowed({"admin", "$owner= $action=metrics_read"})
public String backend(@Context GraphManager manager) {
Map<String, Map<String, Object>> results = InsertionOrderUtil.newMap();
for (String graph : manager.graphs()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ public static synchronized ServerOptions instance() {
"auth.remote_url",
"If the address is empty, it provide auth service, " +
"otherwise it is auth client and also provide auth service " +
"through rpc forwarding. The remote url can set multiple " +
"addresses, which are linked by ','.",
"through rpc forwarding. The remote url can be set to " +
"multiple addresses, which are linked by ','.",
null,
""
);
Expand Down Expand Up @@ -280,7 +280,7 @@ public static synchronized ServerOptions instance() {
new ConfigOption<>(
"rpc.client_load_balancer",
"The rpc client uses a load-balancing algorithm to " +
"configure the addresses of multiple rpc servers. Default " +
"access multiple rpc servers in one cluster. Default " +
"value is 'consistentHash', means forwording by request " +
"parameters.",
allowValues("random", "localPref", "roundRobin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ private RpcServerProvider startRpcServer(HugeConfig conf) {
}

private void destoryRpcServer() {
this.rpcServerProvider.destroy();
if (this.rpcServerProvider != null) {
this.rpcServerProvider.destroy();
}
}

private HugeAuthenticator authenticator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public SofaRpcServer(HugeConfig conf, RpcProviderConfig providerConfig) {

public void exportAll() {
if (MapUtils.isEmpty(this.providerConfigs)) {
throw new RpcException("The server provider config map can't be " +
"empty");
throw new RpcException(
"The server provider config map can't be empty");
}
for (ProviderConfig providerConfig : this.providerConfigs.values()) {
providerConfig.setServer(this.serverConfig);
Expand Down

0 comments on commit c1dc32b

Please sign in to comment.