dsp_req_pkg_total_v2.sh 1.4 KB
Newer Older
wang-jinfeng committed
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
#!/bin/bash

# # # # # # # # # # # # # # # # # # # # # #
# @author  :fengliang
# @revision:2017-09-01
# # # # # # # # # # # # # # # # # # # # # #

source ../dmp_env.sh

LOG_TIME=$(date +%Y%m%d -d "-1 day $ScheduleTime")
date_path=$(date +%Y/%m/%d -d "-1 day $ScheduleTime")


INPUT_PATH="${DM_INSTALL_LIST}/$date_path/dsp_req"
OUTPUT_PATH="${DM_INSTALL_LIST}_v2/$date_path/dsp_req"

check_await ${INPUT_PATH}/_SUCCESS

REDUCE_NUM=$(calculate_reduce_num ${INPUT_PATH})

hadoop fs -rm -r $OUTPUT_PATH


hadoop jar ../${JAR} mobvista.dmp.main.ParseInstallRCFile \
  -Dmapreduce.fileoutputcommitter.algorithm.version=2 \
  $INPUT_PATH $OUTPUT_PATH 6000

WangJinfeng committed
28 29 30 31
if [ $? -ne 0 ];then
  exit 255
fi

wang-jinfeng committed
32 33 34 35 36 37 38 39 40 41
: '
business="dsp_req"

spark-submit --class mobvista.dmp.datasource.dm.DmInstallListOrc \
     --name "mobvista.dmp.datasource.dm.DmInstallListOrc.${business}" \
     --conf spark.yarn.executor.memoryOverhead=2048 \
     --conf spark.default.parallelism=2000 \
     --conf spark.speculation=true \
     --conf spark.speculation.quantile=0.8 \
     --conf spark.speculation.multiplier=1.2 \
WangJinfeng committed
42
     --deploy-mode cluster --executor-memory 10g --driver-memory 4g  --executor-cores 4  --num-executors 180 \
wang-jinfeng committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56
     ../${JAR}
     -output ${OUTPUT_PATH} -input ${INPUT_PATH} -business ${business}
'

if [ $? -ne 0 ];then
  exit 255
fi



mount_partition "dm_install_list_v2" "dt='$LOG_TIME', business='dsp_req'" "$OUTPUT_PATH"
if [ $? -ne 0 ];then
  exit 255
fi