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
#!/bin/sh
source ../dmp_env.sh
ScheduleTime=${ScheduleTime:-$1}
starttime=$(date -d "3 hours ago $ScheduleTime" "+%Y%m%d%H")
endtime=$(date -d "1 hours ago $ScheduleTime" "+%Y%m%d%H")
datapath=$(date -d "1 hours ago $ScheduleTime" "+%Y/%m/%d")
yearpath=$(date -d "1 hours ago $ScheduleTime" "+%Y")
mothpath=$(date -d "1 hours ago $ScheduleTime" "+%m")
daypath=$(date -d "1 hours ago $ScheduleTime" "+%d")
hhpath=$(date -d "1 hours ago $ScheduleTime" "+%H")
dsp_impression_org_hour="s3://mob-ad/adn/dsp/impression_org/impression/${datapath}/cn/${hhpath}"
dsp_request_orc_hour="s3://mob-ad/adn/dsp_orc/request/${datapath}/cn/${hhpath}"
check_await "${dsp_impression_org_hour}/_SUCCESS"
check_await "${dsp_request_orc_hour}/_SUCCESS"
OUTPUT_PATH=s3://mob-ad/adn/dsp/impression/${datapath}/cn/${hhpath}
hadoop fs -test -e ${OUTPUT_PATH}
if [ $? -ne 0 ];then
hadoop fs -mkdir -p ${OUTPUT_PATH}
fi
common_mount_partition "adn_dsp" "log_adn_dsp_impression_org_hour" "yr='${yearpath}', mt='${mothpath}',dt='${daypath}',rg='cn',hh='${hhpath}'" "${dsp_impression_org_hour}"
common_mount_partition "adn_dsp" "log_adn_dsp_request_orc_hour" "yr='${yearpath}', mt='${mothpath}',dt='${daypath}',rg='cn',hh='${hhpath}'" "${dsp_request_orc_hour}"
hadoop fs -rmr ${OUTPUT_PATH}
spark-submit --class mobvista.dmp.datasource.dsp.DspImpressionHourFull \
--conf spark.sql.shuffle.partitions=6 \
--conf spark.default.parallelism=6 \
--conf spark.serializer=org.apache.spark.serializer.KryoSerializer \
--conf spark.yarn.executor.memoryOverhead=1024 \
--master yarn \
--deploy-mode cluster \
--executor-memory 2G \
--driver-memory 1G \
--executor-cores 2 \
--num-executors 3 \
../${JAR} \
-starttime ${starttime} -endtime ${endtime} -output ${OUTPUT_PATH}
if [ $? -ne 0 ]; then
exit 255
fi
common_mount_partition "adn_dsp" "log_adn_dsp_impression_hour" "yr='${yearpath}', mt='${mothpath}',dt='${daypath}',rg='cn',hh='${hhpath}'" "${OUTPUT_PATH}"
hadoop fs -touchz ${OUTPUT_PATH}/_SUCCESS