Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UDSF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UDSF
Commits
874c10c8
Commit
874c10c8
authored
Mar 10, 2022
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB
parent
4583f5fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
etc/udsf_docker.conf
etc/udsf_docker.conf
+3
-3
src/connection_pool/ConnectionPool.h
src/connection_pool/ConnectionPool.h
+18
-5
No files found.
etc/udsf_docker.conf
View file @
874c10c8
...
@@ -10,7 +10,7 @@ UDSF =
...
@@ -10,7 +10,7 @@ UDSF =
# UDSF binded interface for Nudsf interface
# UDSF binded interface for Nudsf interface
SBI
:
SBI
:
{
{
INTERFACE_NAME
=
"e
ns33
"
;
# YOUR NETWORK CONFIG HERE
INTERFACE_NAME
=
"e
th0
"
;
# YOUR NETWORK CONFIG HERE
IPV4_ADDRESS
=
"read"
;
IPV4_ADDRESS
=
"read"
;
PORT
=
7123
;
# YOUR NETWORK CONFIG HERE
PORT
=
7123
;
# YOUR NETWORK CONFIG HERE
};
};
...
@@ -19,9 +19,9 @@ UDSF =
...
@@ -19,9 +19,9 @@ UDSF =
MYSQL
:
MYSQL
:
{
{
## MySQL mandatory options
## MySQL mandatory options
MYSQL_SERVER
=
"1
92.168.83.129
"
;
# MySQL Server address
MYSQL_SERVER
=
"1
0.244.1.3
"
;
# MySQL Server address
MYSQL_USER
=
"root"
;
# Database server login
MYSQL_USER
=
"root"
;
# Database server login
MYSQL_PASS
=
"1234"
;
# Database server password
MYSQL_PASS
=
"1234
56
"
;
# Database server password
MYSQL_DB
=
"amfdata"
;
# Your database name
MYSQL_DB
=
"amfdata"
;
# Your database name
# MYSQL_PORT = 3306 # MySQL Server port
# MYSQL_PORT = 3306 # MySQL Server port
};
};
...
...
src/connection_pool/ConnectionPool.h
View file @
874c10c8
...
@@ -14,7 +14,13 @@
...
@@ -14,7 +14,13 @@
实现连接池功能模块
实现连接池功能模块
*/
*/
#include "udsf_config.hpp"
using
namespace
std
;
using
namespace
std
;
using
namespace
config
;
extern
udsf_config
udsf_cfg
;
class
ConnectionPool
class
ConnectionPool
{
{
public:
public:
...
@@ -35,11 +41,18 @@ private:
...
@@ -35,11 +41,18 @@ private:
//单独运行一个线程,用于删除扫描队列中超过maxidletime连接
//单独运行一个线程,用于删除扫描队列中超过maxidletime连接
void
sannerConnectionTask
();
void
sannerConnectionTask
();
string
_ip
=
"192.168.83.129"
;
//mysql登录ip地址
//string _ip = "10.244.1.7"; //mysql登录ip地址
unsigned
short
_port
=
3306
;
// mysql端口号3306
//unsigned short _port = 3306; // mysql端口号3306
string
_username
=
"root"
;
// mysql登录用户名
//string _username = "root"; // mysql登录用户名
string
_password
=
"1234"
;
// mysql登录密码
//string _password = "123456"; // mysql登录密码
string
_dbname
=
"amfdata"
;
// 连接的数据库名称
//string _dbname = "amfdata"; // 连接的数据库名称
string
_ip
=
udsf_cfg
.
mysql
.
mysql_server
.
c_str
();
string
_username
=
udsf_cfg
.
mysql
.
mysql_user
.
c_str
();
string
_password
=
udsf_cfg
.
mysql
.
mysql_pass
.
c_str
();
string
_dbname
=
udsf_cfg
.
mysql
.
mysql_db
.
c_str
();
unsigned
short
_port
=
udsf_cfg
.
mysql
.
mysql_port
;
int
_initSize
=
10
;
//连接池连接初始量
int
_initSize
=
10
;
//连接池连接初始量
int
_maxSize
=
1024
;
//连接池最大连接量
int
_maxSize
=
1024
;
//连接池最大连接量
int
_maxIdleTime
=
60
;
//连接池最大空闲时间
int
_maxIdleTime
=
60
;
//连接池最大空闲时间
...
...
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