Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-dsc-flink
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shezaixing
dsk-dsc-flink
Commits
1b7bd055
Commit
1b7bd055
authored
Jan 02, 2025
by
liaowenwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加并行度
parent
7dbb7b90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
MysqlDataTransferSink.java
.../com/dsk/flink/dsc/common/sink/MysqlDataTransferSink.java
+2
-3
SyncCustomerDataSource.java
...n/java/com/dsk/flink/dsc/sync/SyncCustomerDataSource.java
+2
-2
No files found.
src/main/java/com/dsk/flink/dsc/common/sink/MysqlDataTransferSink.java
View file @
1b7bd055
...
...
@@ -31,8 +31,7 @@ public class MysqlDataTransferSink extends RichSinkFunction<String> {
@Override
public
void
open
(
Configuration
parameters
)
throws
Exception
{
executorService
=
new
ThreadPoolExecutor
(
10
,
10
,
20
,
TimeUnit
.
MINUTES
,
new
LinkedBlockingDeque
<>());
executorService
=
new
ThreadPoolExecutor
(
6
,
6
,
20
,
TimeUnit
.
MINUTES
,
new
LinkedBlockingDeque
<>());
//初始化获取配置
String
configTidbUrl
=
String
.
format
(
envProps
.
getDb_url
(),
envProps
.
getDb_host
(),
envProps
.
getDb_port
(),
envProps
.
getDb_database
());
//System.out.println(configTidbUrl);
...
...
@@ -42,7 +41,7 @@ public class MysqlDataTransferSink extends RichSinkFunction<String> {
dataSource
.
setPassword
(
envProps
.
getDb_password
());
dataSource
.
setUrl
(
configTidbUrl
);
dataSource
.
setMaxActive
(
30
);
dataSource
.
setInitialSize
(
1
0
);
dataSource
.
setInitialSize
(
2
0
);
dataSource
.
setTestWhileIdle
(
true
);
dataSource
.
setMaxWait
(
20000
);
dataSource
.
setValidationQuery
(
"select 1"
);
...
...
src/main/java/com/dsk/flink/dsc/sync/SyncCustomerDataSource.java
View file @
1b7bd055
...
...
@@ -48,7 +48,7 @@ public class SyncCustomerDataSource {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
StreamExecutionEnvironment
env
=
StreamExecutionEnvironment
.
getExecutionEnvironment
();
//env.setParallelism(
1
);
//env.setParallelism(
3
);
env
.
setRestartStrategy
(
RestartStrategies
.
fixedDelayRestart
(
50
,
30000
));
env
.
enableCheckpointing
(
300000
);
env
.
getCheckpointConfig
().
setCheckpointingMode
(
CheckpointingMode
.
EXACTLY_ONCE
);
...
...
@@ -78,7 +78,7 @@ public class SyncCustomerDataSource {
}
SingleOutputStreamOperator
<
String
>
kafkaSource
=
env
.
addSource
(
kafkaConsumer
)
.
setParallelism
(
1
)
//
.setParallelism(1)
.
name
(
"kafka-source"
)
.
uid
(
"kafka-source"
);
...
...
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