ContributeGuide.md 6.1 KB
Newer Older
J
Jialin Qiao 已提交
1 2 3 4 5 6 7 8 9
<!--

    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
S
Sail 已提交
10
    
J
Jialin Qiao 已提交
11
        http://www.apache.org/licenses/LICENSE-2.0
S
Sail 已提交
12
    
J
Jialin Qiao 已提交
13 14 15 16 17 18 19 20 21
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->

22 23 24 25 26 27
# 一、工作流程

## 主要链接

IoTDB 官网:https://iotdb.apache.org/

28
代码库:https://github.com/apache/iotdb/tree/master
29

Q
qiaojialin 已提交
30
快速上手:http://iotdb.apache.org/UserGuide/master/Get%20Started/QuickStart.html
31

S
Sail 已提交
32
Jira 任务管理:https://issues.apache.org/jira/projects/IOTDB/issues
J
Jialin Qiao 已提交
33 34 35

Wiki 文档管理:https://cwiki.apache.org/confluence/display/IOTDB/Home

36 37
## 订阅邮件列表

X
xiangdong huang 已提交
38
邮件列表是 Apache 项目进行技术讨论和用户沟通的地方,订阅邮件列表就可以收到邮件了。
39 40 41

邮件列表地址:dev@iotdb.apache.org

X
xiangdong huang 已提交
42 43 44 45 46 47 48
订阅方法:用想接收邮件的邮箱向 dev-subscribe@iotdb.apache.org 发一封邮件,主题内容不限,收到回复后,再次向确认地址发一封确认邮件(确认地址比较长,推荐qq邮箱)。

其他邮件列表:
* notifications@iotdb.apache.org (用于接收JIRA通知.)
  * 如果你只想接收个别感兴趣的JIRA通知,你不需要订阅这个列表。你只需要在JIRA issue页面上点击"开始关注这个issue" 或者在这个issue上做评论就行了。
* commits@iotdb.apache.org (任何代码改动都会通知到此处。该邮件列表邮件数量十分多,请注意。)
* reviews@iotdb.apache.org (任何代码审阅意见都会通知到此处。该邮件列表邮件数量十分多,请注意。)
49

J
Jialin Qiao 已提交
50
## 新功能、Bug 反馈、改进等
51

J
Jialin Qiao 已提交
52
所有希望 IoTDB 做的功能或修的 bug,都可以在 Jira 上提 issue
53

J
Jialin Qiao 已提交
54
可以选择 issue 类型:bug、improvement、new feature等。新建的 issue 会自动向邮件列表中同步邮件,之后的讨论可在 jira 上留言,也可以在邮件列表进行。当问题解决后请关闭 issue。
55 56 57

## 邮件讨论内容(英文)

Q
qiaojialin 已提交
58
* 第一次参与邮件列表可以简单介绍一下自己。(Hi, I'm xxx ...)
59

J
Jialin Qiao 已提交
60
* 开发功能前可以发邮件声明一下自己想做的任务。(Hi,I'm working on issue IOTDB-XXX,My plan is ...)
61

Q
qiaojialin 已提交
62 63 64 65
## 贡献文档

IoTDB 所有官网上的内容都在项目根目录的 docs 中:

66 67 68 69 70 71 72 73
* docs/SystemDesign: 系统设计文档-英文版
* docs/zh/SystemDesign: 系统设计文档-中文版
* docs/UserGuide: 用户手册-英文版
* docs/zh/UserGuide: 用户手册-中文版
* docs/Community: 社区-英文版
* docs/zh/Community: 社区-中文版
* docs/Development: 开发指南-英文版
* docs/zh/Development: 开发指南-中文版
Q
qiaojialin 已提交
74 75 76 77 78 79

官网上的版本和分支的对应关系:

* In progress -> master
* major_version.x -> rel/major_version (如 0.9.x -> rel/0.9)

Q
qiaojialin 已提交
80 81 82
注意事项:

* Markdown 中的图片可上传至 https://github.com/thulab/iotdb/issues/543 获得 url
Q
qiaojialin 已提交
83

84 85
## 贡献代码

J
Jialin Qiao 已提交
86
可以到 jira 上领取现有 issue 或者自己创建 issue 再领取,评论说我要做这个 issue 就可以。
87 88

* 克隆仓库到自己的本地的仓库,clone到本地,关联apache仓库为上游 upstream 仓库。
J
Jialin Qiao 已提交
89
* 从 master 切出新的分支,分支名根据这个分支的功能决定,一般叫 f_new_feature(如f_storage_engine) 或者 fix_bug(如fix_query_cache_bug)
90 91 92 93
* 在 idea 中添加code style为 根目录的 java-google-style.xml
* 修改代码,增加测试用例(单元测试、集成测试)
	* 集成测试参考: server/src/test/java/org/apache/iotdb/db/integration/IoTDBTimeZoneIT
* 提交 PR, 以 [IOTDB-jira号] 开头
J
Jialin Qiao 已提交
94
* 发邮件到 dev 邮件列表:(I've submitted a PR for issue IOTDB-xxx [link])
95 96 97
* 根据其他人的审阅意见进行修改,继续更新,直到合并
* 关闭 jira issue

J
Jialin Qiao 已提交
98 99 100 101 102
# 二、IoTDB 调试方式

## 导入代码

### Intellij idea
103

104 105 106
推荐使用 Intellij idea。```mvn clean package -DskipTests``` 

之后把 ```antlr/target/generated-sources/antlr4``````thrift/target/generated-sources/thrift``` 标记为 ```Source Root```
J
Jialin Qiao 已提交
107

J
Jialin Qiao 已提交
108 109 110 111 112 113 114 115 116 117 118 119
### Eclipse

如果是 eclipse 2019 之前的版本,需要现在 IoTDB 根目录执行 `mvn eclipse:eclipse -DskipTests`

import -> General -> Existing Projects into Workspace -> 选择 IoTDB 根目录

如果 eclipse 2019 之后的版本

import -> Maven -> Existing Maven Projects

## 调试代码

J
Jialin Qiao 已提交
120
* 服务器主函数:```server/src/main/java/org/apache/iotdb/db/service/IoTDB```,可以debug模式启动
121
* 命令行界面:```cli/src/main/java/org/apache/iotdb/cli/```,linux 用 Cli,windows 用 WinCli,可以直接启动。启动时需要参数"-h 127.0.0.1 -p 6667 -u root -pw root"
J
Jialin Qiao 已提交
122
* 服务器的 rpc 实现(主要用来客户端和服务器通信,一般在这里开始打断点):```server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl```
123
	* jdbc所有语句:executeStatement(TSExecuteStatementReq req)
J
Jialin Qiao 已提交
124
	* jdbc查询语句:executeQueryStatement(TSExecuteStatementReq req)	
125
	* native写入接口:insertRecord(TSInsertRecordReq req)
126

J
Jialin Qiao 已提交
127
* 存储引擎 org.apache.iotdb.db.engine.StorageEngine
J
Jialin Qiao 已提交
128
* 查询引擎 org.apache.iotdb.db.qp.Planner
129

130 131 132 133 134 135 136 137 138 139 140 141 142 143 144


## 常见编译错误

1. 无法下载 thrift-* 等文件, 例如 `Could not get content
org.apache.maven.wagon.TransferFailedException: Transfer failed for https://github.com/jt2594838/mvn-thrift-compiler/raw/master/thrift_0.12.0_0.13.0_linux.exe`

这一般是网络问题,这时候需要手动下载上述文件:

* 根据以下网址手动下载上述文件;
  * https://github.com/jt2594838/mvn-thrift-compiler/blob/master/thrift_0.12.0_0.13.0_mac.exe
  * https://github.com/jt2594838/mvn-thrift-compiler/raw/master/thrift_0.12.0_0.13.0_mac.exe
* 将该文件拷贝到thrift/target/tools/目录下
* 重新执行maven的编译命令