Skip to content

Commit

Permalink
[DOCS] Add link to modified version of Livy in Restful Docs Qihoo360#30
Browse files Browse the repository at this point in the history
**What changes were proposed in this pull request?**
This is an official resolution of Qihoo360#6
  • Loading branch information
WeiWenda authored and zhangbinzaifendou committed Sep 17, 2019
1 parent e0d30bf commit 01ef35f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sql/xsql/docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
| <img src="images/hadoop.png" width="120" height="40" /> | 2.7.3 | | | This is the recommended version |
| <img src="images/hive.png" width="80" height="60" /> | 1.2 | PRODUCTION | [Hive Doc](datasources/hive.md) | |
| <img src="images/mysql.png" width="100" height="67" /> | 5.6.19 | PRODUCTION | [Mysql Doc](datasources/mysql.md) | POWER BY mysql-jdbc |
| <img src="images/druid.png" width="120" height="40" /> | 0.82 | PRODUCTION | [Druid Doc](datasources/druid.md) | |
| <img src="images/druid.png" width="120" height="40" /> | 0.10.0 | PRODUCTION | [Druid Doc](datasources/druid.md) | |
| <img src="images/elasticsearch.png" width="120" height="60" /> | 5.2 | PRODUCTION | [ElasticSearch Doc](datasources/elasticsearch.md) | |
| <img src="images/mongo.png" width="120" height="35" /> | 2.3.0 | PRODUCTION | [MongoDB Doc](datasources/mongo.md) | |
| <img src="images/hbase.png" width="100" height="35" /> | 2.0 | PRODUCTION WITH LIMITATIONS | [HBase Doc](datasources/hbase.md) | POWER BY SHC Connector |
Expand Down
12 changes: 7 additions & 5 deletions sql/xsql/docs/docs/tutorial/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,14 @@ public class Test {
}
}
```

## HTTP REST

## HTTP REST [未开源]

​ XSQL使用 [Apache Livy](http://livy.incubator.apache.org/) 实现Restful服务,这里内置了 [Livy REST API](./rest-api.md),这里是帮助您快速开始的 [Livy接口使用Demo(JAVA、PHP)](https://www.notion.so/Livy-Demo-5c50bbbec1414e23acad4b2c7856192a) 。XSQL对Livy的结果缓存机制进行了优化,优化后的Livy查询状态图如下:

![](../images/livy-statement.png)

XSQL目前只开源了将Livy适配到XSQL的必要修改,详情见[GitHub链接](https://github.com/WeiWenda/incubator-livy/tree/XSQL),以下内容仅适用于内部用户。

这里列举了使用XSQL Restful服务之前,务必知晓的配置项:

| Property Name | Default | Meaning |
Expand All @@ -235,8 +236,9 @@ public class Test {

**为了帮助您合理利用集群资源,我们为每个Session维持了SessionState。**

- idle: 当已提交的查询数小于livy.rsc.sql.interpreter.threadPool.size时,SessionState为idle,此时提交的查询可以立即获得执行线程,查询状态表现为Running。
- busy: 当已提交的查询数大于livy.rsc.sql.interpreter.threadPool.size,小于livy.rsc.retained-statements时,SessionState为busy,此时提交查询进行FIFO等待,查询状态表现为Waiting。
- idle: 当已提交的查询数为0时,SessionState为idle,此时提交的查询可以立即获得执行线程,查询状态表现为Running。
- busy: 当已提交的查询数大于0,小于livy.rsc.sql.interpreter.threadPool.size时,SessionState为busy,此时提交查询可即时进行计算,但无法获得SparkSession的全部资源,查询效率有所下降,查询状态表现为Running。
- queued: 当已提交的查询数大于livy.rsc.sql.interpreter.threadPool.size,小于livy.rsc.retained-statements时,SessionState为Queued,此时提交查询进行FIFO等待,查询状态表现为Waiting。
- exhaust: 当已提交的查询数等于livy.rsc.retained-statements时,SessionState为exhaust,此时提交的查询将被拒绝服务,查询状态表现为Rejected。用户可以选择外部程序轮询等待,也可以选择申请创建新的Sesssion。

**推荐的使用方式:**建议总是保持一个或多个长驻的Sesssion,当并发数不足时,利用livy.rsc.server.session.timeout创建可自动销毁的Session,从而最大程度的实现即时查询同时节省队列资源。
Expand Down

1 comment on commit 01ef35f

@zhangbinzaifendou
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please sign in to comment.