Skip to content

Commit 4fa9055

Browse files
committed
merge upstream
2 parents fb4803a + 6c026b6 commit 4fa9055

24 files changed

+72
-2293
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015, Baidu.com, Inc.
1+
Copyright (c) 2015, Baidu, Inc.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@ modification, are permitted provided that the following conditions are met:
1111
this list of conditions and the following disclaimer in the documentation
1212
and/or other materials provided with the distribution.
1313

14-
* Neither the name of the Baidu.com, Inc. nor the names of it
14+
* Neither the name of the Baidu, Inc. nor the names of it
1515
contributors may be used to endorse or promote products derived from
1616
this software without specific prior written permission.
1717

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ INCPATH += -I./src -I./include -I./src/leveldb/include -I./src/leveldb $(DEPS_IN
1414
LDPATH += -L./src/leveldb $(DEPS_LDPATH)
1515
CFLAGS += $(OPT) $(INCPATH)
1616
CXXFLAGS += $(OPT) $(INCPATH)
17-
LDFLAGS += $(LDPATH) -rdynamic -lleveldb $(DEPS_LDFLAGS) -lpthread -lrt -lz -ldl
17+
LDFLAGS += -rdynamic $(LDPATH) -lleveldb $(DEPS_LDFLAGS) -lpthread -lrt -lz -ldl
1818

1919
PROTO_FILES := $(wildcard src/proto/*.proto)
2020
PROTO_OUT_CC := $(PROTO_FILES:.proto=.pb.cc)
@@ -51,10 +51,11 @@ LIBRARY = libtera.a
5151
.PHONY: all clean cleanall test
5252

5353
all: $(PROGRAM) $(LIBRARY)
54-
mkdir -p build/include build/lib build/bin
54+
mkdir -p build/include build/lib build/bin build/log
5555
cp $(PROGRAM) build/bin
5656
cp $(LIBRARY) build/lib
5757
cp src/sdk/tera.h build/include
58+
cp -r conf build
5859
echo 'Done'
5960

6061
test:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
====
33
[![Build Status](https://travis-ci.org/BaiduPS/tera.svg)](https://travis-ci.org/BaiduPS/tera)
44

5-
Copyright 2015, Baidu.com, Inc.
5+
Copyright 2015, Baidu, Inc.
66

77
#Overview
88
Tera是一个高性能、可伸缩的数据库系统,被设计用来管理搜索引擎万亿量级的超链与网页信息。为实现数据的实时分析与高效访问,我们使用按行键、列名和时间戳全局排序的三维数据模型组织数据,使用多级Cache系统,充分利用新一代服务器硬件大内存、SSD盘和万兆网卡的性能优势,做到模型灵活的同时,实现了高吞吐与水平扩展。

build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ make install
4747
cd -
4848

4949
# sofa-pbrpc
50-
git clone https://github.com/BaiduPS/sofa-pbrpc
51-
cd sofa-pbrpc
50+
wget --no-check-certificate -O sofa-pbrpc-1.0.0.tar.gz https://github.com/BaiduPS/sofa-pbrpc/archive/v1.0.0.tar.gz
51+
tar xvf sofa-pbrpc-1.0.0.tar.gz
52+
cd sofa-pbrpc-1.0.0
5253
sed -i '/BOOST_HEADER_DIR=/ d' depends.mk
5354
sed -i '/PROTOBUF_DIR=/ d' depends.mk
5455
sed -i '/SNAPPY_DIR=/ d' depends.mk

conf/tera.flag

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# common
2+
--log_dir=../log
3+
--v=6
4+
--logbufsecs=0
5+
6+
# master
7+
--tera_master_port=1100
8+
--tera_master_split_tablet_size=2048
9+
10+
# tablet node
11+
--tera_tabletnode_port=2200
12+
--tera_tabletnode_path_prefix=${dfs_prefix}
13+
--tera_tabletnode_cache_paths=${local_path}
14+
15+
# zk
16+
--tera_zk_addr_list=${zk_addr}
17+
--tera_zk_root_path=${zk_root}
18+
--tera_zk_timeout=10000

depends.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ DEPS_LDPATH = -L$(SOFA_PBRPC_LIBDIR) -L$(PROTOBUF_LIBDIR) \
4545
-L$(GFLAGS_LIBDIR) -L$(GLOG_LIBDIR) \
4646
-L$(GPERFTOOLS_LIBDIR)
4747
DEPS_LDFLAGS = -lsofa-pbrpc -lprotobuf -lsnappy -lzookeeper_mt \
48-
-lgflags -lglog -ltcmalloc -lunwind
48+
-lgflags -lglog -ltcmalloc

doc/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,16 @@
1818
[命令行工具使用手册](https://github.com/BaiduPS/tera/blob/master/doc/teracli.md)
1919

2020
[tera实现之master、ts、client的交互](https://github.com/BaiduPS/tera/blob/master/doc/master-ts-client-interactive.md)
21+
22+
## TodoList
23+
1. Master的设计与实现(职责、功能、每个功能怎么实现的、为什么这么实现、还有哪些遗留问题)
24+
2. Tabletserver设计与实现
25+
3. SDK的结构化文档(可折叠,可搜索,类是windows的帮助)
26+
4. 性能数据,不同场景下的测试数,瓶颈分析
27+
5. 性能方面设计折衷(怎样实现的高性能随机读写)
28+
6. 数据模型的详细介绍
29+
* cf的使用建议
30+
* 各种删除的语义
31+
* 多版本保留机制
32+
7. 监控系统的安装和使用
33+
8. 快速、低成本Split&Merge的实现原理
Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
1-
# 通信
2-
3-
## 通信协议
4-
1+
# 通信协议
52
使用protobuf定义通信协议,参见`src/proto/`.
63

7-
# meta表
8-
9-
## meta表的加载
4+
# meta表
5+
meta表的加载:
106
master找到meta表(meta表持久化存储的位置是约定好的,大家都知道的),
117
选择某个ts加载meta表,然后将载有meta表的ts位置[ip:port]记录在zk下约定好的文件中。
128

13-
## client如何获取meta表?
9+
client如何获取meta表?
1410
参考[meta表的加载],从zk读取某个特定文件就可以知道哪个ts加载了meta表,进而访问meta表。
1511

1612
# 系统启动(和三者交互有关的部分)
13+
**ts的启动**
14+
* 在zk上注册特定文件
15+
* 在该文件中写入自身[ip:port]
1716

18-
## ts的启动
19-
1. 在zk上注册特定文件
20-
1. 在该文件中写入自身[ip:port]
21-
22-
## master的启动
23-
1. 通过zk获取master锁
24-
1. 扫描特定目录发现活跃状态的ts
25-
1. 与每个ts通信获取已经被载入的tablet列表
26-
1. 如果meta表未载入,则master命令某个ts载入meta表
27-
1. 读取meta表,获知所有tablet的信息以及未被载入的tablet集合
17+
**master的启动**
18+
* 通过zk获取master锁
19+
* 扫描特定目录发现活跃状态的ts
20+
* 与每个ts通信获取已经被载入的tablet列表
21+
* 如果meta表未载入,则master命令某个ts载入meta表
22+
* 读取meta表,获知所有tablet的信息以及未被载入的tablet集合
2823

2924
# 寻址
30-
31-
## client如何获知某个tablet在哪个ts上?
25+
**client如何获知某个tablet在哪个ts上?**
3226
先访问meta表,然后根据meta表的内容知道某个tablet在哪个ts上。
3327

34-
## client如何获知master位置?
28+
**client如何获知master位置?**
3529
master启动时会在zk上的master锁中记下自己的位置[ip:port].
3630

37-
## master如何获知ts的信息?
31+
**master如何获知ts的信息?**
3832
参考master的启动,可以获知master初始化时各个ts的状态(例如位置[ip:port]),
3933

4034
通过zk获知ts的加入或退出。

src/common/compression/snappy/config.h

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)