记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
e772ce93
Commit
e772ce93
authored
Sep 07, 2021
by
anjiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改dragon消费相关日志输出
parent
0106091f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
0 deletions
+94
-0
TestRedisConnection.java
.../test/java/com/liquidnet/service/TestRedisConnection.java
+94
-0
No files found.
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/test/java/com/liquidnet/service/TestRedisConnection.java
0 → 100644
View file @
e772ce93
package
com
.
liquidnet
.
service
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: TODO
* @class: TestRedisConnection
* @Package com.liquidnet.service
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/8/31 11:17
*/
@Slf4j
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
TestRedisConnection
{
@Autowired
private
RedisUtil
redisUtil
;
@Test
public
void
getPayCodeList
(){
// List<Object> payCodeList = this.getPrefixKeyValue("dragon:pay:code:*");
// for(Object payCode:payCodeList){
// System.out.println("object=== "+ JsonUtils.toJson(payCode));
// }
//设置新的redis
// for(int i=0 ;i<1000;i++){
// System.out.println("第"+i+"个 "+redisUtil.get("dragon:pay:test:Pay"+i));
// }
String
ss
=
"[\n"
+
" \"com.liquidnet.service.dragon.dto.DragonOrdersDto\",\n"
+
" {\n"
+
" \"mid\": null,\n"
+
" \"orderId\": \"20210810193315226361725\",\n"
+
" \"status\": 0,\n"
+
" \"code\": \"PAY20210810193315191566757\",\n"
+
" \"type\": \"TICKET\",\n"
+
" \"price\": [\n"
+
" \"java.math.BigDecimal\",\n"
+
" 0.1\n"
+
" ],\n"
+
" \"name\": \"正在现场\",\n"
+
" \"detail\": \"正在现场\",\n"
+
" \"orderCode\": \"ORDER0001\",\n"
+
" \"clientIp\": \"127.0.0.1\",\n"
+
" \"notifyUrl\": \"devdragon.zhengzai.tv\",\n"
+
" \"notifyStatus\": 0,\n"
+
" \"paymentType\": \"WAPALIPAY\",\n"
+
" \"paymentId\": null,\n"
+
" \"paymentAt\": \"2021-08-10T19:33:15.226\",\n"
+
" \"finishedAt\": null,\n"
+
" \"createdAt\": \"2021-08-10T19:33:15.226\",\n"
+
" \"updatedAt\": null,\n"
+
" \"deletedAt\": null\n"
+
" }\n"
+
"]"
;
int
thredNum
=
2000
;
ExecutorService
exec
=
Executors
.
newFixedThreadPool
(
thredNum
);
for
(
int
i
=
0
;
i
<
thredNum
;
i
++)
{
final
int
k
=
i
;
log
.
info
(
"=================="
+
k
);
// System.out.println("第"+i+"个 "+redisUtil.get("dragon:pay:test:Pay"+i));
exec
.
execute
(()
->
{
for
(
int
j
=
0
;
j
<
1000
;
j
++){
System
.
out
.
println
(
"第"
+
j
+
"个 set"
);
redisUtil
.
set
(
"dragon:pay:test:Pay"
+
k
+
j
,
ss
);
}
});
try
{
Thread
.
sleep
(
100L
);
}
catch
(
InterruptedException
ignored
)
{}
}
exec
.
shutdown
();
// List<String> keys = getPrefixKeys("dragon:pay:code:*");
// log.info("总共迁移数据条数==="+keys.size());
// DragonOrdersDto dragonOrdersDto = DragonOrdersDto.getNew();
// for(String key:keys){
// Object obj = redisUtil.getRedisTemplateByDb(0).opsForValue().get(key);
// if(obj!=null){
// dragonOrdersDto = (DragonOrdersDto) obj;
// }
// redisUtil.set(key,dragonOrdersDto);
// }
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment