Clone Code
Clone Cassandra Code 切换到 3.11 branch
git clone https://github.com/apache/cassandra.git
git fetch origin cassandra-3.11
git checkout cassandra-3.11
生成 .idea 文件
Cassandra 使用 ant 管理 project. build.xml 内定义了生成 idea 和 eclipse 的命令.
ant generate-idea-files
idea 的原始文件在 ./ide/idea 中.
如果要使用eclipse
ant generate-eclipse-files
open source folder by IntelliJ IDEA
File-->Open select cassandra folder
cj@ubuntu:~/pp/cassandra/cassandra$ tree -L 1 -a
.
├── bin
├── build
├── build.properties.default
├── build.xml
├── cassandra.iml
├── CHANGES.txt
├── circle.yml
├── conf
├── CONTRIBUTING.md
├── debian
├── doc
├── eclipse_compiler.properties
├── examples
├── .git
├── .gitignore
├── ide
├── .idea
├── interface
├── lib
├── LICENSE.txt
├── NEWS.txt
├── NOTICE.txt
├── pylib
├── .rat-excludes
├── README.asc
├── redhat
├── src
├── test
└── tools
Run Cassandra
入口在 org.apache.cassandra.service.CassandraDaemon
idea 下右键 CassandraDaemon.java --> Run Cassandra | Debug Cassandra
默认使用 configuration ./conf/cassandra.yaml