Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pig_冷冷
Pig
提交
b7e6a670
Pig
项目概览
pig_冷冷
/
Pig
上一次同步 11 个月
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Pig
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b7e6a670
编写于
3月 07, 2023
作者:
徐晓伟
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🐛
HashMap初始大小应该是2的指数,如:2、4、8、16 ...,默认达到75%时进行扩容,删除无用代码
上级
3485586c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
16 deletion
+11
-16
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java
.../pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java
+1
-1
pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/client/SentinelApiClient.java
...baba/csp/sentinel/dashboard/client/SentinelApiClient.java
+10
-15
未找到文件。
pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDeptServiceImpl.java
浏览文件 @
b7e6a670
...
...
@@ -162,7 +162,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
treeNode
.
setName
(
dept
.
getName
());
treeNode
.
setWeight
(
dept
.
getSortOrder
());
// 扩展属性
Map
<
String
,
Object
>
extra
=
new
HashMap
<>(
4
);
Map
<
String
,
Object
>
extra
=
new
HashMap
<>(
2
);
extra
.
put
(
"createTime"
,
dept
.
getCreateTime
());
treeNode
.
setExtra
(
extra
);
return
treeNode
;
...
...
pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/client/SentinelApiClient.java
浏览文件 @
b7e6a670
...
...
@@ -371,7 +371,7 @@ public class SentinelApiClient {
AssertUtil
.
isTrue
(
port
>
0
,
"Bad machine port"
);
Map
<
String
,
String
>
params
=
null
;
if
(
StringUtil
.
isNotEmpty
(
type
))
{
params
=
new
HashMap
<>(
1
);
params
=
new
HashMap
<>(
2
);
params
.
put
(
"type"
,
type
);
}
return
executeCommand
(
ip
,
port
,
api
,
params
,
false
).
thenApply
(
json
->
JSON
.
parseArray
(
json
,
ruleType
));
...
...
@@ -382,11 +382,6 @@ public class SentinelApiClient {
try
{
AssertUtil
.
notEmpty
(
ip
,
"Bad machine IP"
);
AssertUtil
.
isTrue
(
port
>
0
,
"Bad machine port"
);
Map
<
String
,
String
>
params
=
null
;
if
(
StringUtil
.
isNotEmpty
(
type
))
{
params
=
new
HashMap
<>(
1
);
params
.
put
(
"type"
,
type
);
}
return
fetchItemsAsync
(
ip
,
port
,
api
,
type
,
ruleType
).
get
();
}
catch
(
InterruptedException
|
ExecutionException
e
)
{
...
...
@@ -412,7 +407,7 @@ public class SentinelApiClient {
AssertUtil
.
notEmpty
(
ip
,
"Bad machine IP"
);
AssertUtil
.
isTrue
(
port
>
0
,
"Bad machine port"
);
String
data
=
JSON
.
toJSONString
(
entities
.
stream
().
map
(
r
->
r
.
toRule
()).
collect
(
Collectors
.
toList
()));
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
4
);
params
.
put
(
"type"
,
type
);
params
.
put
(
"data"
,
data
);
String
result
=
executeCommand
(
app
,
ip
,
port
,
SET_RULES_PATH
,
params
,
true
).
get
();
...
...
@@ -441,7 +436,7 @@ public class SentinelApiClient {
AssertUtil
.
notEmpty
(
ip
,
"Bad machine IP"
);
AssertUtil
.
isTrue
(
port
>
0
,
"Bad machine port"
);
String
data
=
JSON
.
toJSONString
(
entities
.
stream
().
map
(
r
->
r
.
toRule
()).
collect
(
Collectors
.
toList
()));
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
4
);
params
.
put
(
"type"
,
type
);
params
.
put
(
"data"
,
data
);
return
executeCommand
(
app
,
ip
,
port
,
SET_RULES_PATH
,
params
,
true
).
thenCompose
(
r
->
{
...
...
@@ -548,7 +543,7 @@ public class SentinelApiClient {
AssertUtil
.
notEmpty
(
app
,
"Bad app name"
);
AssertUtil
.
notEmpty
(
ip
,
"Bad machine IP"
);
AssertUtil
.
isTrue
(
port
>
0
,
"Bad machine port"
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
1
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
params
.
put
(
"type"
,
AUTHORITY_TYPE
);
List
<
AuthorityRule
>
rules
=
fetchRules
(
ip
,
port
,
AUTHORITY_TYPE
,
AuthorityRule
.
class
);
return
Optional
.
ofNullable
(
rules
)
...
...
@@ -617,7 +612,7 @@ public class SentinelApiClient {
try
{
String
data
=
JSON
.
toJSONString
(
rules
.
stream
().
map
(
ParamFlowRuleEntity:
:
getRule
).
collect
(
Collectors
.
toList
()));
Map
<
String
,
String
>
params
=
new
HashMap
<>(
1
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
params
.
put
(
"data"
,
data
);
return
executeCommand
(
app
,
ip
,
port
,
SET_PARAM_RULE_PATH
,
params
,
true
).
thenCompose
(
e
->
{
if
(
CommandConstants
.
MSG_SUCCESS
.
equals
(
e
))
{
...
...
@@ -656,7 +651,7 @@ public class SentinelApiClient {
return
AsyncUtils
.
newFailedFuture
(
new
IllegalArgumentException
(
"Invalid parameter"
));
}
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<>(
1
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
params
.
put
(
"mode"
,
String
.
valueOf
(
mode
));
return
executeCommand
(
ip
,
port
,
MODIFY_CLUSTER_MODE_PATH
,
params
,
false
).
thenCompose
(
e
->
{
if
(
CommandConstants
.
MSG_SUCCESS
.
equals
(
e
))
{
...
...
@@ -694,7 +689,7 @@ public class SentinelApiClient {
return
AsyncUtils
.
newFailedFuture
(
new
IllegalArgumentException
(
"Invalid parameter"
));
}
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<>(
1
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
params
.
put
(
"data"
,
JSON
.
toJSONString
(
config
));
return
executeCommand
(
app
,
ip
,
port
,
MODIFY_CLUSTER_CLIENT_CONFIG_PATH
,
params
,
true
).
thenCompose
(
e
->
{
if
(
CommandConstants
.
MSG_SUCCESS
.
equals
(
e
))
{
...
...
@@ -718,7 +713,7 @@ public class SentinelApiClient {
return
AsyncUtils
.
newFailedFuture
(
new
IllegalArgumentException
(
"Invalid parameter"
));
}
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<>(
1
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
params
.
put
(
"data"
,
JSON
.
toJSONString
(
config
));
return
executeCommand
(
app
,
ip
,
port
,
MODIFY_CLUSTER_SERVER_FLOW_CONFIG_PATH
,
params
,
true
)
.
thenCompose
(
e
->
{
...
...
@@ -743,7 +738,7 @@ public class SentinelApiClient {
return
AsyncUtils
.
newFailedFuture
(
new
IllegalArgumentException
(
"Invalid parameter"
));
}
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
4
);
params
.
put
(
"port"
,
config
.
getPort
().
toString
());
params
.
put
(
"idleSeconds"
,
config
.
getIdleSeconds
().
toString
());
return
executeCommand
(
app
,
ip
,
port
,
MODIFY_CLUSTER_SERVER_TRANSPORT_CONFIG_PATH
,
params
,
false
)
...
...
@@ -768,7 +763,7 @@ public class SentinelApiClient {
return
AsyncUtils
.
newFailedFuture
(
new
IllegalArgumentException
(
"Invalid parameter"
));
}
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<>(
1
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
2
);
params
.
put
(
"data"
,
JSON
.
toJSONString
(
set
));
return
executeCommand
(
app
,
ip
,
port
,
MODIFY_CLUSTER_SERVER_NAMESPACE_SET_PATH
,
params
,
true
)
.
thenCompose
(
e
->
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录