nothing in kylin.log except " 2016-12-15 16:47:29,623 INFO  [pool-8-thread-1] 
threadpool.DefaultScheduler:118 : Job Fetcher: 0 should running, 0 actual 
running, 0 ready, 30 already succeed, 7 error, 9 discarded, 0 others "

here is my codes :
 
String date = cirm.getDate();
String type = cirm.getType();
int period = cirm.getPeriod();
String appId = cirm.getAppId();
//用一个变量记住总数
int total = 0;

Driver driver = null;
Connection conn = null;
PreparedStatement state = null;
ResultSet rs = null;
try {
    driver = (Driver) 
Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
    Properties info = new Properties();
    info.put("user", "ADMIN");
    info.put("password", "KYLIN");
    conn = driver.connect("jdbc:kylin://10.1.1.158:7070/YOOSHU_WAREHOUSE", 
info);
    state = conn.prepareStatement("SELECT APPID,PROVINCE,COUNT(1) AS UV from 
YOOSHU_ASO_AREA_INFOS WHERE DATEID = DATE ? AND DATETYPE = ? AND PERIOD = ? AND 
APPID =? group by DATEID,DATETYPE,PERIOD,APPID,PROVINCE ORDER BY UV DESC");

    state.setString( 1, date);
    state.setString( 2, type);
    state.setInt( 3, period);
    state.setString( 4, appId);

    rs = state.executeQuery();



    while (rs.next()) {
        RegionBean regionBean = new RegionBean();
        regionBean.setAppId(rs.getString("APPID"));
        regionBean.setProvince(rs.getString("PROVINCE"));
        regionBean.setCount(rs.getInt("UV"));
        regions.add(regionBean);
    }

} catch (Exception e) {
    e.printStackTrace();
}

try {
    if (rs != null)
        rs.close();
} catch(Exception e) {}
try {
    if (state != null)
        state.close();
} catch (Exception e){}
try {
    if (conn != null)
        conn.close();
} catch (Exception e){}

my pom.xml is:

<!-- http://mvnrepository.com/artifact/org.apache.kylin/kylin-jdbc -->
<dependency>
    <groupId>org.apache.kylin</groupId>
    <artifactId>kylin-jdbc</artifactId>
    <version>1.6.0</version>
</dependency>



gaolv123...@163.com
 
发件人: ShaoFeng Shi
发送时间: 2016-12-15 12:08
收件人: dev
主题: Re: KYLIN JDBC卡主不动
is there any message in kylin.log?
 
在 2016年12月15日 上午11:03,gaolv123...@163.com <gaolv123...@163.com>写道:
 
> 你好:
>     我在用JDBC 读取数据的时候,卡主不动,日志如下:
>  [DEBUG] 2016-12-15 10:06:31,093 Get connection for route {}->h
> ttp://10.1.1.158:7070
> [DEBUG] 2016-12-15 10:06:31,103 Connecting to 10.1.1.158:7070
> [DEBUG] 2016-12-15 10:06:32,499 Connection 0.0.0.0:45116<->10.1.1.158:7070
>  shut down
> [DEBUG] 2016-12-15 10:06:37,409 Releasing connection org.
> apache.kylin.jdbc.shaded.org.apache.http.impl.conn.
> ManagedClientConnectionImpl@4eef38f8
>
> 卡在这里不动,CPU变得很高,这是怎么回事啊。
>
>
>
> ------------------------------
> gaolv123...@163.com
>
 
 
 
-- 
Best regards,
 
Shaofeng Shi 史少锋

Reply via email to