-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce intermediate node to avoid ABA problem
- Loading branch information
1 parent
8d90fcf
commit e8e293f
Showing
6 changed files
with
99 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...trol/src/main/java/com/alibaba/csp/sentinel/slots/block/flow/param/TokenUpdateStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.alibaba.csp.sentinel.slots.block.flow.param; | ||
|
||
class TokenUpdateStatus { | ||
|
||
private final long lastAddTokenTime; | ||
|
||
private final long restQps; | ||
|
||
public TokenUpdateStatus(long lastAddTokenTime, long restQps) { | ||
this.lastAddTokenTime = lastAddTokenTime; | ||
this.restQps = restQps; | ||
} | ||
|
||
public long getLastAddTokenTime() { | ||
return lastAddTokenTime; | ||
} | ||
|
||
public long getRestQps() { | ||
return restQps; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "TokenUpdateStatus{" + | ||
"hash=" + System.identityHashCode(this) + | ||
", lastAddTokenTime=" + lastAddTokenTime + | ||
", requestCount=" + restQps + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters