通常是用于增量

代码如下:

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的更多相关文章

  1. 通过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 1 ...

  2. Kylin的cube模型

    1. 数据仓库的相关概念 OLAP 大部分数据库系统的主要任务是执行联机事务处理和查询处理,这种处理被称为OLTP(Online Transaction Processing, OLTP),面向的是顾 ...

  3. 【转】Kylin的cube模型

    转自:http://www.cnblogs.com/en-heng/p/5239311.html 1. 数据仓库的相关概念 OLAP 大部分数据库系统的主要任务是执行联机事务处理和查询处理,这种处理被 ...

  4. kylin构建cube优化

    前言 下面通过对kylin构建cube流程的分析来介绍cube优化思路. 创建hive中间表 kylin会在cube构建的第一步先构建一张hive的中间表,该表关联了所有的事实表和维度表,也就是一张宽 ...

  5. Kylin Flink Cube 引擎的前世今生

    Apache Kylin™ 是一个开源的.分布式的分析型数据仓库,提供 Hadoop/Spark 之上的 SQL 查询接口及多维分析(OLAP)能力以支持超大规模数据,它能在亚秒内查询巨大的表. Ky ...

  6. 对一致性Hash算法,Java代码实现的深入研究

    一致性Hash算法 关于一致性Hash算法,在我之前的博文中已经有多次提到了,MemCache超详细解读一文中"一致性Hash算法"部分,对于为什么要使用一致性Hash算法.一致性 ...

  7. 怎样编写高质量的java代码

    代码质量概述     怎样辨别一个项目代码写得好还是坏?优秀的代码和腐化的代码区别在哪里?怎么让自己写的代码既漂亮又有生命力?接下来将对代码质量的问题进行一些粗略的介绍.也请有过代码质量相关经验的朋友 ...

  8. 数据结构笔记--二叉查找树概述以及java代码实现

    一些概念: 二叉查找树的重要性质:对于树中的每一个节点X,它的左子树任一节点的值均小于X,右子树上任意节点的值均大于X. 二叉查找树是java的TreeSet和TreeMap类实现的基础. 由于树的递 ...

  9. java代码的初始化过程研究

        刚刚在ITeye上看到一篇关于java代码初始化的文章,看到代码我试着推理了下结果,虽然是大学时代学的知识了,没想到还能做对.(看来自己大学时掌握的基础还算不错,(*^__^*) 嘻嘻……)但 ...

随机推荐

  1. C#集合及特殊字符

    集合里面 打印  出来时 要把 集合内的格式转化为其他格式! 壹. 集合 在.add之前 为空   数组  同样  添加元素之前 为  空(下一章超市购物例题具体体现) 1.System Collec ...

  2. 【leetcode】Remove Duplicates from Sorted List II (middle)

    Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb ...

  3. 【leetcode】Validate Binary Search Tree(middle)

    Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as ...

  4. 加载ComboBox控件

    /// <summary> /// 加载公司 /// </summary> /// <param name="cbbCompany">Combo ...

  5. LeetCode 283 Move Zeros

    Problem: Given an array nums, write a function to move all 0's to the end of it while maintaining th ...

  6. HDU 5901 Count primes (1e11内的素数个数) -2016 ICPC沈阳赛区网络赛

    题目链接 题意:求[1,n]有多少个素数,1<=n<=10^11.时限为6000ms. 官方题解:一个模板题, 具体方法参考wiki或者Four Divisors. 题解:给出两种代码. ...

  7. IOS-Uikit框架介绍

    •UIKit可识别三种类型的输入事件: –触摸事件 –运动(加速计)事件 –远程控制事件 IKit框架将触击信息封装为一个UIEvent对象,并派发给恰当的视图(有关UIKit如何将事件递送给您的视图 ...

  8. Jquery网站下雪花的效果

    代码如下: <script type="text/javascript" src="jquery.min.js"></script> & ...

  9. 3dmax导出3ds具有过多要导出的面超过64k解决方法

    参考:http://blog.sina.com.cn/s/blog_7a71dd090100w3r0.html 修改器->网格编辑->ProOptimizer 选中对象, 原始模型 顶点数 ...

  10. Web前端开发工程师的就业前景

    Web前端开发工程师的就业前景 Web前端开发工程师是一个全新的职业,在IT行业真正受到重视的时间不超过5年.因此,大家越来越关心web前端工程师前景怎么样?web前端工程师就业如何?Web前端开发是 ...