GeezerVison is showing github.com — docs: update articles · JavaBigFamily/advanced-java@5bf0239
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: docs/distributed-system/distributed-lock-redis-vs-zookeeper.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -272,7 +272,7 @@ public class ZooKeeperDistributedLock implements Watcher { | 272 | 272 | // 如果不是最小的节点,找到比自己小1的节点 | 273 | 273 | int previousLockIndex = -1; | 274 | 274 | for (int i = 0; i < locks.size(); i++) { | 275 | | - if (lockNode.equals(locksRoot + “ /”+locks.get(i))){ | | 275 | + if (lockNode.equals(locksRoot + "/" +locks.get(i))){ | 276 | 276 | previousLockIndex = i - 1; | 277 | 277 | break; | 278 | 278 | } | |
Collapse file Copy file name to clipboardExpand all lines: docs/high-availability/hystrix-fallback.md -1Lines changed: 0 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -32,7 +32,6 @@ Hystrix 出现以下四种情况,都会去调用 fallback 降级机制: | 32 | 32 | * 品牌名称本地缓存 | 33 | 33 | * | 34 | 34 | */ | 35 | | - | 36 | 35 | public class BrandCache { | 37 | 36 |
| 38 | 37 | private static Map<Long, String> brandMap = new HashMap<>(); | |
Collapse file Copy file name to clipboardExpand all lines: docs/high-availability/hystrix-introduction.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -46,6 +46,6 @@ Hystrix 可以对其进行资源隔离,比如限制服务 B 只有 40 个线 | 46 | 46 | - 避免请求排队和积压,采用限流和 `fail fast` 来控制故障。 | 47 | 47 | - 提供 fallback 降级机制来应对故障。 | 48 | 48 | - 使用资源隔离技术,比如 `bulkhead`(舱壁隔离技术)、`swimlane`(泳道技术)、`circuit breaker`(断路技术)来限制任何一个依赖服务的故障的影响。 | 49 | | -- 通过近实时的统计/监控/报警功能,来提高故障发现的速度。 | | 49 | +- 通过近实时的统计、监控、报警功能,来提高故障发现的速度。 | 50 | 50 | - 通过近实时的属性和配置**热修改**功能,来提高故障处理和恢复的速度。 | 51 | 51 | - 保护依赖服务调用的所有故障情况,而不仅仅只是网络故障情况。 |
Collapse file Copy file name to clipboardExpand all lines: docs/high-availability/hystrix-thread-pool-current-limiting.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -165,5 +165,5 @@ ProductInfo(id=null, name=降级商品, price=null, pictureList=null, specificat | 165 | 165 | ProductInfo(id=null, name=降级商品, price=null, pictureList=null, specification=null, service=null, color=null, size=null, shopId=null, modifiedTime=null, cityId=null, cityName=null, brandId=null, brandName=null) | 166 | 166 | {"id": -2, "name": "iphone7手机", "price": 5599, "pictureList":"a.jpg,b.jpg", "specification": "iphone7的规格", "service": "iphone7的售后服务", "color": "红色,白色,黑色", "size": "5.5", "shopId": 1, "modifiedTime": "2017-01-01 12:00:00", "cityId": 1, "brandId": 1} | 167 | 167 | // 后面都是一些正常的商品信息,就不贴出来了 | 168 | | -//... | | 168 | +// ... | 169 | 169 | ``` |
Collapse file Copy file name to clipboardExpand all lines: docs/high-concurrency/how-to-limit-current.md +41-41Lines changed: 41 additions & 41 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -288,25 +288,25 @@ public class TokenBucket { | 288 | 288 |
| 289 | 289 | ```yaml | 290 | 290 | spring: | 291 | | - cloud: | 292 | | - gateway: | 293 | | - routes: | 294 | | - - id: requestratelimiter_route | 295 | | - | 296 | | - uri: lb://pigx-upms | 297 | | - order: 10000 | 298 | | - predicates: | 299 | | - - Path=/admin/** | 300 | | - | 301 | | - filters: | 302 | | - - name: RequestRateLimiter | 303 | | - | 304 | | - args: | 305 | | - redis-rate-limiter.replenishRate: 1 # 令牌桶的容积 | 306 | | - redis-rate-limiter.burstCapacity: 3 # 流速 每秒 | 307 | | - key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean | 308 | | - | 309 | | - - StripPrefix=1 | | 291 | + cloud: | | 292 | + gateway: | | 293 | + routes: | | 294 | + - id: requestratelimiter_route | | 295 | + | | 296 | + uri: lb://pigx-upms | | 297 | + order: 10000 | | 298 | + predicates: | | 299 | + - Path=/admin/** | | 300 | + | | 301 | + filters: | | 302 | + - name: RequestRateLimiter | | 303 | + | | 304 | + args: | | 305 | + redis-rate-limiter.replenishRate: 1 # 令牌桶的容积 | | 306 | + redis-rate-limiter.burstCapacity: 3 # 流速 每秒 | | 307 | + key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean | | 308 | + | | 309 | + - StripPrefix=1 | 310 | 310 | ``` | 311 | 311 |
| 312 | 312 | ```java | @@ -329,35 +329,35 @@ KeyResolver remoteAddrKeyResolver() { | 329 | 329 |
| 330 | 330 | ```yaml | 331 | 331 | spring: | 332 | | - cloud: | 333 | | - nacos: | 334 | | - discovery: | 335 | | - server-addr: localhost:8848 | 336 | | - sentinel: | 337 | | - transport: | 338 | | - dashboard: localhost:8080 | 339 | | - port: 8720 | 340 | | - datasource: | 341 | | - ds: | 342 | | - nacos: | 343 | | - server-addr: localhost:8848 | 344 | | - dataId: spring-cloud-sentinel-nacos | 345 | | - groupId: DEFAULT_GROUP | 346 | | - rule-type: flow | 347 | | - namespace: xxxxxxxx | | 332 | + cloud: | | 333 | + nacos: | | 334 | + discovery: | | 335 | + server-addr: localhost:8848 | | 336 | + sentinel: | | 337 | + transport: | | 338 | + dashboard: localhost:8080 | | 339 | + port: 8720 | | 340 | + datasource: | | 341 | + ds: | | 342 | + nacos: | | 343 | + server-addr: localhost:8848 | | 344 | + dataId: spring-cloud-sentinel-nacos | | 345 | + groupId: DEFAULT_GROUP | | 346 | + rule-type: flow | | 347 | + namespace: xxxxxxxx | 348 | 348 | ``` | 349 | 349 |
| 350 | 350 | - 配置内容在 nacos 上进行编辑 | 351 | 351 |
| 352 | 352 | ```json | 353 | 353 | [ | 354 | 354 | { | 355 | | - "resource": "/hello", | 356 | | - "limitApp": "default", | 357 | | - "grade": 1, | 358 | | - "count": 1, | 359 | | - "strategy": 0, | 360 | | - "controlBehavior": 0, | | 355 | + "resource": "/hello", | | 356 | + "limitApp": "default", | | 357 | + "grade": 1, | | 358 | + "count": 1, | | 359 | + "strategy": 0, | | 360 | + "controlBehavior": 0, | 361 | 361 | "clusterMode": false | 362 | 362 | } | 363 | 363 | ] | |
|