Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 466717e

Browse files
committed
feat: rename master branch
1 parent 8ccaf3a commit 466717e

17 files changed

+56
-31
lines changed

‎.github/workflows/gradle.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v1
11+
- uses: actions/checkout@v2
1212
- name: Set up JDK 1.8
1313
uses: actions/setup-java@v1
1414
with:

‎.github/workflows/pytest.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
python-version: [3.6, 3.7]
1919
steps:
20-
- uses: actions/checkout@v1
20+
- uses: actions/checkout@v2
2121
- name: Set up Python ${{ matrix.python-version }}
2222
uses: actions/setup-python@v1
2323
with:

‎README.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Redis 底层原理分析与多语言应用实践<sup>[©](https://github.com/yanglbme)</sup>
2-
[![pytest](https://github.com/yanglbme/redis-multi-programming-language-practice/workflows/pytest/badge.svg)](https://github.com/yanglbme/redis-multi-programming-language-practice/actions)
2+
33
[![java-ci](https://github.com/yanglbme/redis-multi-programming-language-practice/workflows/Java%20CI/badge.svg)](https://github.com/yanglbme/redis-multi-programming-language-practice/actions)
44
[![prs-welcome](https://badgen.net/badge/PRs/welcome/green)](http://makeapullrequest.com)
55
[![doocs-open-source-organization](https://badgen.net/badge/organization/join%20us/cyan)](https://doocs.github.io/#/?id=how-to-join)
@@ -17,21 +17,26 @@
1717
## Redis 数据结构与应用
1818

1919
### [String 字符串](/docs/redis-string-introduction.md)
20+
2021
- [说说如何基于 Redis 实现分布式锁?](/docs/redis-distributed-lock.md)
2122

2223
### [List 列表](/docs/redis-list-introduction.md)
24+
2325
- 如何利用 Redis List 实现异步消息队列?
2426
- [用 Redis 如何实现页面数据分页的效果?](/docs/redis-list-paginate.md)
2527

2628
### [Set 集合](/docs/redis-set-introduction.md)
29+
2730
- [如何用 Redis 实现论坛帖子的点赞点踩功能?](/docs/redis-set-like-and-dislike.md)
2831

2932
### [Sorted Sets 有序集合](/docs/redis-sorted-set-introduction.md)
33+
3034
- [社交网站通常会有粉丝关注的功能,用 Redis 怎么实现?](/docs/redis-sorted-set-sns-follow.md)
3135
- [每日、每周、每月积分排行榜功能该怎么实现?](/docs/redis-sorted-set-ranking-or-trending-list.md)
3236
- [关键词搜索,如何用 Redis 实现自动补全?](/docs/redis-sorted-set-auto-complete.md)
3337

3438
### [Hash 哈希](/docs/redis-hash-introduction.md)
39+
3540
- [登录会话,用 Redis 该怎么做?](/docs/redis-hash-session-token.md)
3641
- [如何使用 Redis 实现短网址服务?](/docs/redis-hash-shorten-url.md)
3742

@@ -40,5 +45,6 @@
4045
### [Bitmap 位图](/docs/redis-bitmap-introduction.md)
4146

4247
## 参考资料
48+
4349
- Redis 深度历险[2018]
44-
- Redis 使用手册[2019]
50+
- Redis 使用手册[2019]

‎docs/redis-distributed-lock.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# 使用 Redis String 实现分布式锁
22

3-
43
## 代码实现
4+
55
| [Python](#Python-版本) | [Java](#Java-版本) |
6-
|---|---|
6+
|---------------------- |------------------ |
77

88
### Python 版本
99

@@ -91,7 +91,7 @@ public class DistributedLock {
9191
SetParams params = new SetParams().ex(timeout).nx();
9292
return client.set(key, generateRandomValue(), params) != null;
9393
}
94-
94+
9595
public boolean acquire() {
9696
int timeout = 10;
9797
return acquire(timeout);
@@ -120,4 +120,4 @@ public class DistributedLock {
120120
System.out.println(lock.acquire()); // true
121121
}
122122
}
123-
```
123+
```

‎docs/redis-hash-introduction.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Redis Hash 结构底层原理剖析
1+
# Redis Hash 结构底层原理剖析

‎docs/redis-hash-session-token.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# 利用 Redis 哈希实现登录会话
22

3-
43
## 代码实现
4+
55
| [Python](#Python-版本) | [Java](#Java-版本) |
6-
|---|---|
6+
|---------------------- |------------------ |
77

88
### Python 版本
99

@@ -217,4 +217,4 @@ public class LoginSession {
217217
System.out.println(res);
218218
}
219219
}
220-
```
220+
```

‎docs/redis-hash-shorten-url.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# 利用 Redis 哈希实现短网址
22

33
## 代码实现
4+
45
| [Python](#Python-版本) | [Java](#Java-版本) |
5-
|---|---|
6+
|---------------------- |------------------ |
67

78
### Python 版本
9+
810
```python
911
from redis import Redis
1012

@@ -56,6 +58,7 @@ if __name__ == '__main__':
5658
```
5759

5860
### Java 版本
61+
5962
```java
6063
import redis.clients.jedis.Jedis;
6164

@@ -125,4 +128,4 @@ public class URLShorten {
125128

126129
}
127130
}
128-
```
131+
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Redis HyperLogLog 结构底层原理剖析
1+
# Redis HyperLogLog 结构底层原理剖析

‎docs/redis-interview.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Redis 面试场景
22

33
## 1. 考察 Redis 基本数据结构
4+
45
- **面试官**:Redis 都有哪些数据结构?
56

67
- **候选人**:(小 case,很自信地回答)Redis 有 5 种数据结构,分别是 `String``List``Hash``Set``Sorted Set`,其中 `Sorted Set` 是有序集合。
@@ -12,6 +13,7 @@
1213
**分析**:这其实是一个很基础的问题,相信绝大部分同学都能回答出以上 5 种数据结构,但是,如果你对 Redis 有更加深入的了解,那么你应该回答 Redis 还有 `HyperLogLog``Bitmap``Geo``Pub/Sub` 等数据结构,甚至还可以回答你玩儿过 `Redis Module`,像 `BloomFilter``RedisSearch``Redis-ML`,想必面试官会眼前一亮,嗯,这小伙子还不错嘛,知道这么多。
1314

1415
## 2. 考察 Redis 分布式锁
16+
1517
- **面试官**:那你有没有用过 Redis 分布式锁?
1618

1719
- **候选人**:用过的。
@@ -34,4 +36,4 @@
3436

3537
- **面试官**:(我还能说什么呢)...
3638

37-
**分析**:Redis 2.8 版本之后,`setnx``expire` 可以合并成一条指令执行,锁得不到释放的问题也随着迎刃而解。而超时问题,可以使用"随机值+ Lua 脚本"的方式来处理。以上的一些问题,你都应该考虑到,而不是简单的用用 Redis。而关于 RedLock 算法,也应该去好好了解它的原理和实现方式。
39+
**分析**:Redis 2.8 版本之后,`setnx``expire` 可以合并成一条指令执行,锁得不到释放的问题也随着迎刃而解。而超时问题,可以使用"随机值+ Lua 脚本"的方式来处理。以上的一些问题,你都应该考虑到,而不是简单的用用 Redis。而关于 RedLock 算法,也应该去好好了解它的原理和实现方式。

‎docs/redis-list-paginate.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# 利用 Redis 列表实现页面数据分页
22

33
## 代码实现
4+
45
| [Python](#Python-版本) | [Java](#Java-版本) |
5-
|---|---|
6+
|---------------------- |------------------ |
67

78
### Python 版本
9+
810
```python
911
from redis import Redis
1012

@@ -51,6 +53,7 @@ if __name__ == '__main__':
5153
```
5254

5355
### Java 版本
56+
5457
```java
5558
import redis.clients.jedis.Jedis;
5659

@@ -117,4 +120,4 @@ public class Paginate {
117120
System.out.println(topics.getPage(5, 5)); // [3, 2, 1, 0]
118121
}
119122
}
120-
```
123+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /