forked from cloudymoma/raycom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·89 lines (80 loc) · 2.34 KB
/
run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# Author: Bin Wu <[email protected]>
PWD=`pwd`
JAVA=`which java`
#VER=$(<ver)
IPADDR=$(hostname -I | cut -d ' ' -f 1)
__usage() {
echo "Usage: run {lc|df|clean}"
}
__local() {
mvn compile exec:java \
-Dexec.mainClass=bindiego.BindiegoStreaming \
-Dexec.args="--output=./output/"
}
__dataflow() {
mvn -Pdataflow-runner compile exec:java \
-Dexec.mainClass=bindiego.BindiegoStreaming \
-Dexec.cleanupDaemonThreads=false \
-Dexec.args="--project=chris-demo-258505 \
--streaming=true \
--autoscalingAlgorithm=THROUGHPUT_BASED \
--maxNumWorkers=20 \
--workerMachineType=n1-standard-2 \
--diskSizeGb=64 \
--numWorkers=3 \
--tempLocation=gs://chris-demo/tmp/ \
--gcpTempLocation=gs://chris-demo/tmp/gcp/ \
--gcsTempLocation=gs://chris-demo/tmp/gcs/ \
--stagingLocation=gs://chris-demo/staging/ \
--runner=DataflowRunner \
--topic=projects/chris-demo-258505/topics/dingoactions \
--subscription=projects/chris-demo-258505/subscriptions/dingoactions-sub-2 \
--numShards=1 \
--windowSize=6s \
--allowedLateness=8s \
--earlyFiringPeriod=2s \
--lateFiringCount=1 \
--filenamePrefix=raycom. \
--outputDir=gs://chris-demo/raycom/out/ \
--errOutputDir=gs://chris-demo/raycom/out/err/ \
--bqSchema=gs://chris-demo/raycom/schemas/dingoactions.json \
--bqOutputTable=google.com:chris-demo-258505:raycom.dingoactions \
--avroSchema=gs://chris-demo/raycom/schemas/dingoactions.avsc \
--btInstanceId=bigbase \
--btTableId=streaming \
--jdbcClass=com.mysql.cj.jdbc.Driver \
--jdbcConn=jdbc:mysql://10.140.0.3:3306/gcp \
--jdbcUsername=gcp \
--jdbcPassword=gcp2020 \
--defaultWorkerLogLevel=INFO \
--jobName=raycom-streaming \
--region=asia-east1"
# --update \
}
__clean() {
mvn clean; rm -f output-*
}
__main() {
if [ $# -eq 0 ]
then
__usage
else
case $1 in
lc)
__local
;;
df)
__dataflow
;;
clean)
__clean
;;
*)
__usage
;;
esac
fi
}
__main $@
exit 0