id_mapping.sh 1.11 KB
Newer Older
WangJinfeng committed
1 2 3 4
#! /bin/bash

source ../dmp_env.sh

WangJinfeng committed
5 6 7 8 9
COUNTRY=$1

PLATFORM=$2

LOG_TIME=$(date +%Y%m%d -d "-1 day $ScheduleTime")
WangJinfeng committed
10 11 12 13 14 15 16

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

ADN_REQUEST_INPUT_PATH=${ID_MAPPING}/${date_path}/adn_request

DSP_INPUT_PATH=${ID_MAPPING}/${date_path}/dsp_req

WangJinfeng committed
17
# check_await "${ADN_REQUEST_INPUT_PATH}/$PLATFORM/_SUCCESS"
WangJinfeng committed
18

WangJinfeng committed
19
# check_await "${DSP_INPUT_PATH}/$PLATFORM/_SUCCESS"
WangJinfeng committed
20

WangJinfeng committed
21
OUTPUT_PATH=${ADS_DEVICE_ID_MAPPING}/${date_path}/${COUNTRY}/${PLATFORM}
WangJinfeng committed
22 23

spark-submit --class mobvista.dmp.datasource.id_mapping.IDMappingGraphx \
WangJinfeng committed
24
  --name "IDMappingGraphx.${LOG_TIME}.${COUNTRY}.${PLATFORM}" \
WangJinfeng committed
25 26
  --conf spark.yarn.executor.memoryOverhead=2048 \
  --conf spark.network.timeout=720s \
WangJinfeng committed
27 28
  --conf spark.sql.shuffle.partitions=10000 \
  --conf spark.default.parallelism=10000 \
WangJinfeng committed
29 30 31
  --master yarn --deploy-mode cluster --executor-memory 10g --driver-memory 6g --executor-cores 5 --num-executors 200 \
  ../${JAR} -date ${LOG_TIME} -country ${COUNTRY} -platform ${PLATFORM} \
  -output ${OUTPUT_PATH}/mid -fre_output ${OUTPUT_PATH}/frequency -result_output ${OUTPUT_PATH}/result -coalesce 1000
WangJinfeng committed
32 33 34

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