码迷,mamicode.com
首页 > Windows程序 > 详细

kylin通过API增量build

时间:2018-03-22 17:32:01      阅读:347      评论:0      收藏:0      [点我收藏+]

标签:KYLIN   HADOOP   OLAP   多维分析   增量build   

官方文档参考:http://kylin.apache.org/cn/docs21/howto/howto_build_cube_with_restapi.html (写的不详细)

账户:我们使用的默认账户:ADMIN/KYLIN的basic认证码为:QURNSU46S1lMSU4=

格式如下:
curl -X PUT -H "Authorization: Basic QURNSU46S1lMSU4=" -H ‘Content-Type: application/json‘ -d ‘{"endTime":‘$endTime‘, "buildType":"BUILD"}‘ http:/$host:7070/kylin/api/cubes/$(cube_name)/rebuild

我的脚本:
···
‘’#!/bin/bash

kylinMinusTime=$((8 60 60 1000)) #8小时对应的毫秒时间,这里是utc时间,需要+8小时
today=date -d now +%Y-%m-%d
todayTimeStamp=date -d "$today 00:00:00" +%s
todayTimeStampMs=$(($todayTimeStamp
1000 + date "+%N"/1000000)) #将current转换为时间戳,精确到毫秒
endTime=$(($todayTimeStampMs+$kylinMinusTime))

curl -X PUT -H "Authorization: Basic QURNSU46S1lMSU4=" -H ‘Content-Type: application/json‘ -d ‘{"endTime":‘$endTime‘, "buildType":"BUILD"}‘ http://stream5:7070/kylin/api/cubes/campaignCube/rebuild
curl -X PUT -H "Authorization: Basic QURNSU46S1lMSU4=" -H ‘Content-Type: application/json‘ -d ‘{"endTime":‘$endTime‘, "buildType":"BUILD"}‘ http://stream5:7070/kylin/api/cubes/salesCube/rebuild
curl -X PUT -H "Authorization: Basic QURNSU46S1lMSU4=" -H ‘Content-Type: application/json‘ -d ‘{"endTime":‘$endTime‘, "buildType":"BUILD"}‘ http://stream5:7070/kylin/api/cubes/marketingCube/rebuild
···

kylin通过API增量build

标签:KYLIN   HADOOP   OLAP   多维分析   增量build   

原文地址:http://blog.51cto.com/xiaolanlan/2089877

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!