-
Notifications
You must be signed in to change notification settings - Fork 3
feat: 增加对于会话数据源连接数的限制 关闭某个用户的数据源接口 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 增加对于会话数据源连接数的限制 关闭某个用户的数据源接口 #3
Conversation
| /** | ||
| * 记录 userId + dataSourceId 的会话数 Key格式: userId:dataSourceId | ||
| */ | ||
| private Map<String, AtomicInteger> userId2DataSourceId2SessionCountMap = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里记录的为什么是会话数,预期是连接数?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里暂时是会话层面的连接,再目前一个会话对应一个连接的情况下是正确的。
server/odc-service/src/main/java/com/oceanbase/odc/service/session/ConnectSessionService.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * Connection count manager for tracking database connections by url+username | ||
| * | ||
| * @author yh263208 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
| log.info("Incremented connection count, key={}", this.connectionKey); | ||
| Connection connection = newConnectionFromDriver(getUsername(), getPassword()); | ||
| // Generate connection key and check/increment connection count | ||
| this.connectionKey = ConnectionCountManager.generateKey(getUrl(), getUsername()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的url指的是啥,username是数据库连接用户名称吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url是数据库连接串,username是数据库连接用户名
|
actiontech/dms#542