Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
spring-boot-starter-dsp
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
shenjiaqing
spring-boot-starter-dsp
Commits
483205e1
Commit
483205e1
authored
Mar 31, 2022
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
createFiltersWithExpireAt 方法
parent
e88c0e5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
RedisBloomHandler.java
...duiba/spring/boot/starter/dsp/util/RedisBloomHandler.java
+13
-0
No files found.
spring-boot-starter-dsp-util/src/main/java/cn/com/duiba/spring/boot/starter/dsp/util/RedisBloomHandler.java
View file @
483205e1
...
@@ -264,6 +264,19 @@ public class RedisBloomHandler<K, V> {
...
@@ -264,6 +264,19 @@ public class RedisBloomHandler<K, V> {
},
true
);
},
true
);
}
}
public
void
createFiltersWithExpireAt
(
RedisTemplate
redisTemplate
,
List
<
K
>
keys
,
double
errorRate
,
long
initCapacity
,
long
expireAt
)
{
byte
[]
rawErrorRate
=
rawString
(
String
.
valueOf
(
errorRate
));
byte
[]
rawInitCapacity
=
rawString
(
String
.
valueOf
(
initCapacity
));
Object
execute
=
redisTemplate
.
execute
(
connection
->
{
keys
.
forEach
(
key
->
{
byte
[]
rawKey
=
rawKey
(
key
);
connection
.
execute
(
RESERVE
,
rawKey
,
rawErrorRate
,
rawInitCapacity
);
connection
.
expireAt
(
rawKey
,
expireAt
);
});
return
null
;
},
true
);
}
/**
/**
* 根据key判断redis key是否设置过期时间
* 根据key判断redis key是否设置过期时间
*
*
...
...
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