通过java代码对kylin进行cube build
转:http://www.cnblogs.com/hark0623/p/5580632.html
通常是用于增量
代码如下:
|
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
|
package com.dlht.kylinDemo;import java.io.BufferedReader;import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStreamReader;import java.io.PrintWriter;import java.net.HttpURLConnection;import java.net.MalformedURLException;import java.net.URL;import org.apache.commons.codec.binary.Base64;public class BuildTest { static String ACCOUNT = "ADMIN"; static String PWD = "KYLIN"; static String PATH = "http://192.168.22.102:7070/kylin/api/cubes/KPI_Base_DataCppaCrcCount_test_Cube/rebuild"; public static void main(String[] args) { System.out .println(Put( PATH, "{\"startTime\": 1451750400000,\"endTime\": 1451836800000,\"buildType\": \"BUILD\"}")); } public static String Put(String addr, String params) { String result = ""; try { URL url = new URL(addr); HttpURLConnection connection = (HttpURLConnection) url .openConnection(); connection.setRequestMethod("PUT"); connection.setDoOutput(true); String auth = ACCOUNT + ":" + PWD; String code = new String(new Base64().encode(auth.getBytes())); connection.setRequestProperty("Authorization", "Basic " + code); connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); PrintWriter out = new PrintWriter(connection.getOutputStream()); out.write(params); out.close(); BufferedReader in; try { in = new BufferedReader(new InputStreamReader( connection.getInputStream())); } catch (FileNotFoundException exception) { java.io.InputStream err = ((HttpURLConnection) connection) .getErrorStream(); if (err == null) throw exception; in = new BufferedReader(new InputStreamReader(err)); } StringBuffer response = new StringBuffer(); String line; while ((line = in.readLine()) != null) response.append(line + "\n"); in.close(); result = response.toString(); } catch (MalformedURLException e) { System.err.println(e.toString()); } catch (IOException e) { System.err.println(e.toString()); } return result; }} |
这是官方教程:http://kylin.apache.org/docs15/howto/howto_use_restapi.html#build-cube
默认帐号密码就是ADMIN KYLIN
在starttime和endtime填写时间,就是build的开始结束时间,注意starttime肯定要先于endtime,同时还要注意,starttime必须要晚于最后一次构建的结束时间
通过java代码对kylin进行cube build的更多相关文章
- 如何通过java代码对kylin进行cube build
通常是用于增量 代码如下: package com.dlht.kylinDemo; import java.io.BufferedReader; import java.io.FileNotFound ...
- Kylin的cube模型
1. 数据仓库的相关概念 OLAP 大部分数据库系统的主要任务是执行联机事务处理和查询处理,这种处理被称为OLTP(Online Transaction Processing, OLTP),面向的是顾 ...
- 【转】Kylin的cube模型
转自:http://www.cnblogs.com/en-heng/p/5239311.html 1. 数据仓库的相关概念 OLAP 大部分数据库系统的主要任务是执行联机事务处理和查询处理,这种处理被 ...
- Kylin Flink Cube 引擎的前世今生
Apache Kylin™ 是一个开源的.分布式的分析型数据仓库,提供 Hadoop/Spark 之上的 SQL 查询接口及多维分析(OLAP)能力以支持超大规模数据,它能在亚秒内查询巨大的表. Ky ...
- eclipse 4.5.2 源码修改 格式化Java代码
注:本文代码基于eclipse4.5.2 1. 需求:在换电脑之后,如何不用配置eclipse就可以很快进入开发呢,并保持原来的编码规范. 2. 方法:修改eclipse源码 分别修改了两个jar包2 ...
- 敏捷开发中高质量 Java 代码开发实践
Java 项目开发过程中,由于开发人员的经验.代码风格各不相同,以及缺乏统一的标准和管理流程,往往导致整个项目的代码质量较差,难于维护,需要较大的测试投入 和周期等问题. 这些问题在一个项目组初建.需 ...
- Android学习笔记02-Mac下编译java代码
在Mac OS上配置JDK 1.7. 一 下载 Mac版本的JDK1.7 从以下下载地址,下载Mac版本的JDk1.7 安装文件 jdk-7u79-macosx-x64.dmg. http://www ...
- kafka集群和zookeeper集群的部署,kafka的java代码示例
来自:http://doc.okbase.net/QING____/archive/19447.html 也可参考: http://blog.csdn.net/21aspnet/article/det ...
- Unity3D研究院之打开Activity与调用JAVA代码传递参数
原地址:http://www.xuanyusong.com/archives/667 Unity for Android 比较特殊,Unity for IOS 打包是将XCODE工程直接交给开发 ...
随机推荐
- css内边距 边框
/*1 元素的各边都有 10 像素的内边距 四个值上.右.下.左 两个上下,左右 三个值:上,左右,下*/ /*p {padding: 10%;}*/ h1 { padding-top: 10px; ...
- 【深入理解javascript】原型
1.一切都是对象 一切(引用类型)都是对象,对象是属性的集合 typeof函数输出的一共有几种类型,在此列出: function show(x) { console.log(typeof(x)); / ...
- [vue]vue-cli下载原理
正常vue-cli这样操作就ok了 vue-cli github $ npm install -g vue-cli $ vue init webpack my-project $ cd my-proj ...
- etcd 集群部署
etcd web管理 https://nikfoundas.github.io/etcd-viewer/ # git clone https://github.com/nikfoundas/etcd- ...
- np.repeat 与 np.tile
1.Numpy的 tile() 函数,就是将原矩阵横向.纵向地复制.tile 是瓷砖的意思,顾名思义,这个函数就是把数组像瓷砖一样铺展开来. 举个例子,原矩阵: import numpy as np ...
- Lintcode: Heapify && Summary: Heap
Given an integer array, heapify it into a min-heap array. For a heap array A, A[0] is the root of he ...
- 全局修改composer源地址
查看 composer 主目录:通过 composer config -l -g 命令可以列出 composer 的全局配置信息,在这些信息中查找 [home] 配置项就是 composer 的主目录 ...
- 认识GMT和UTC时间-附带地理知识
GMT-格林尼治标准时 GMT 的全名是格林威治标准时间或格林威治平时 (Greenwich Mean Time),这个时间系统的概念在 1884 年确立,由英国伦敦的格林威治皇家天文台计算并维护,并 ...
- yii2csrf攻击
第一种解决办法是关闭Csrf public function init(){ $this->enableCsrfValidation = false; } 第二种解决办法是在form表单中加入隐 ...
- tomcat 的最大连接数设置
前提说明为了确保服务不会被过多的http长连接压垮,我们需要对tomcat设定个最大连接数,超过这个连接数的请求会拒绝,让其负载到其它机器.达到保护自己的同时起到连接数负载均衡的作用. 动手去做一开始 ...