Skip to content

Commit

Permalink
Merge pull request #1328 from skilxnTL/master
Browse files Browse the repository at this point in the history
merge 2.11 to master
  • Loading branch information
Ye-Tian-Zero authored Jul 19, 2018
2 parents 6b4edaf + 39d9d01 commit 05d842e
Show file tree
Hide file tree
Showing 480 changed files with 50,589 additions and 11,501 deletions.
133 changes: 99 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ endif
ifndef CC
CC = gcc
endif
TEST_OPT = -g2 -Wall -Dprivate=public

INCPATH += -I./src -I./include -I./src/leveldb/include -I./src/leveldb \
INCPATH += -I./src -I./include -I./src/leveldb/include -I./src/leveldb -I./src/sdk \
-I./src/sdk/java/native-src $(DEPS_INCPATH)
LEVELDB_INCPATH = -I../
CFLAGS += $(OPT) $(INCPATH) -fPIC -fvisibility=hidden # hide internal symbol of tera
TEST_CFLAGS += $(TEST_OPT) $(INCPATH) -fPIC -fvisibility=hidden # hide internal symbol of tera
CXXFLAGS += -std=gnu++11 $(CFLAGS)
TEST_CXXFLAGS += -std=gnu++11 $(TEST_CFLAGS)
LDFLAGS += -rdynamic $(DEPS_LDPATH) $(DEPS_LDFLAGS) -lpthread -lrt -lz -ldl \
-lreadline -lncurses -fPIC
SO_LDFLAGS += -rdynamic $(DEPS_LDPATH) $(SO_DEPS_LDFLAGS) -lpthread -lrt -lz -ldl \
-shared -fPIC -Wl,--version-script,so-version-script # hide symbol of thirdparty libs
UTFLAGS += -Dprivate=public

PROTO_FILES := $(wildcard src/proto/*.proto)
PROTO_OUT_CC := $(PROTO_FILES:.proto=.pb.cc)
Expand All @@ -28,28 +31,42 @@ PROTO_OUT_H := $(PROTO_FILES:.proto=.pb.h)
MASTER_SRC := $(wildcard src/master/*.cc)
TABLETNODE_SRC := $(wildcard src/tabletnode/*.cc)
IO_SRC := $(wildcard src/io/*.cc)
SDK_SRC := $(wildcard src/sdk/*.cc)
SDK_SRC := $(wildcard src/sdk/*.cc) $(wildcard src/sdk/test/global_txn_testutils.cc) \
src/observer/rowlocknode/zk_rowlock_client_zk_adapter.cc src/observer/rowlocknode/ins_rowlock_client_zk_adapter.cc
HTTP_SRC := $(wildcard src/sdk/http/*.cc)
PROTO_SRC := $(filter-out %.pb.cc, $(wildcard src/proto/*.cc)) $(PROTO_OUT_CC)
JNI_TERA_SRC := $(wildcard src/sdk/java/native-src/*.cc)
VERSION_SRC := src/version.cc
OTHER_SRC := $(wildcard src/zk/*.cc) $(wildcard src/utils/*.cc) $(VERSION_SRC) \
src/tera_flags.cc
src/tera_flags.cc src/sdk/test/global_txn_testutils.cc
COMMON_SRC := $(wildcard src/common/base/*.cc) $(wildcard src/common/net/*.cc) \
$(wildcard src/common/file/*.cc) $(wildcard src/common/file/recordio/*.cc) \
$(wildcard src/common/console/*.cc)
$(wildcard src/common/console/*.cc) $(wildcard src/common/log/*.cc) \
$(wildcard src/common/metric/*.cc) $(wildcard src/common/*.cc)
SERVER_WRAPPER_SRC := src/tera_main_wrapper.cc
SERVER_SRC := src/tera_main.cc src/tera_entry.cc
CLIENT_SRC := src/teracli_main.cc
TERAUTIL_SRC := src/terautil.cc
GTXN_TEST_SRC := src/sdk/test/global_txn_test_tool.cc
TEST_CLIENT_SRC := src/tera_test_main.cc
TERA_C_SRC := src/tera_c.cc
MONITOR_SRC := src/monitor/teramo_main.cc
#MONITOR_SRC := src/monitor/teramo_main.cc
MARK_SRC := src/benchmark/mark.cc src/benchmark/mark_main.cc
COMMON_TEST_SRC := $(wildcard src/common/test/*.cc)
TEST_SRC := src/utils/test/prop_tree_test.cc src/utils/test/tprinter_test.cc \
src/io/test/tablet_io_test.cc src/io/test/tablet_scanner_test.cc \
src/io/test/load_test.cc src/master/test/master_test.cc \
src/master/test/master_impl_test.cc src/master/test/trackable_gc_test.cc \
src/common/test/thread_pool_test.cc
src/master/test/trackable_gc_test.cc \
src/observer/test/rowlock_test.cc src/observer/test/scanner_test.cc \
src/observer/test/observer_test.cc \
$(wildcard src/sdk/test/*_test.cc) $(COMMON_TEST_SRC)

TIMEORACLE_SRC := $(wildcard src/timeoracle/*.cc) src/tera_entry.cc
TIMEORACLE_BENCH_SRC := src/timeoracle/bench/timeoracle_bench.cc
ROWLOCK_SRC := $(wildcard src/observer/rowlocknode/*.cc) src/sdk/rowlock_client.cc
ROWLOCK_PROXY_SRC := $(wildcard src/observer/rowlockproxy/*.cc)
OBSERVER_SRC := src/observer/executor/scanner_impl.cc src/observer/executor/random_key_selector.cc src/observer/executor/notification_impl.cc
OBSERVER_DEMO_SRC := $(wildcard src/observer/observer_demo.cc)

TEST_OUTPUT := test_output
UNITTEST_OUTPUT := $(TEST_OUTPUT)/unittest
Expand All @@ -65,39 +82,53 @@ COMMON_OBJ := $(COMMON_SRC:.cc=.o)
SERVER_WRAPPER_OBJ := $(SERVER_WRAPPER_SRC:.cc=.o)
SERVER_OBJ := $(SERVER_SRC:.cc=.o)
CLIENT_OBJ := $(CLIENT_SRC:.cc=.o)
TERAUTIL_OBJ := $(TERAUTIL_SRC:.cc=.o)
GTXN_TEST_OBJ := $(GTXN_TEST_SRC:.cc=.o)
TEST_CLIENT_OBJ := $(TEST_CLIENT_SRC:.cc=.o)
TERA_C_OBJ := $(TERA_C_SRC:.cc=.o)
MONITOR_OBJ := $(MONITOR_SRC:.cc=.o)
MARK_OBJ := $(MARK_SRC:.cc=.o)
HTTP_OBJ := $(HTTP_SRC:.cc=.o)
COMMON_TEST_OBJ := $(COMMON_TEST_SRC:.cc=.o)
TEST_OBJ := $(TEST_SRC:.cc=.o)
TIMEORACLE_OBJ := $(TIMEORACLE_SRC:.cc=.o)
TIMEORACLE_BENCH_OBJ := $(TIMEORACLE_BENCH_SRC:.cc=.o)
ROWLOCK_OBJ := $(ROWLOCK_SRC:.cc=.o)
ROWLOCK_PROXY_OBJ := $(ROWLOCK_PROXY_SRC:.cc=.o)
OBSERVER_OBJ := $(OBSERVER_SRC:.cc=.o)
OBSERVER_DEMO_OBJ := $(OBSERVER_DEMO_SRC:.cc=.o)
ALL_OBJ := $(MASTER_OBJ) $(TABLETNODE_OBJ) $(IO_OBJ) $(SDK_OBJ) $(PROTO_OBJ) \
$(JNI_TERA_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(SERVER_OBJ) $(CLIENT_OBJ) \
$(JNI_TERA_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(SERVER_OBJ) $(CLIENT_OBJ) $(TERAUTIL_OBJ) \
$(TEST_CLIENT_OBJ) $(TERA_C_OBJ) $(MONITOR_OBJ) $(MARK_OBJ) \
$(SERVER_WRAPPER_OBJ)
$(SERVER_WRAPPER_OBJ) $(TIMEORACLE_OBJ) $(ROWLOCK_OBJ) $(ROWLOCK_PROXY_OBJ) $(OBSERVER_OBJ) $(OBSERVER_DEMO_OBJ)
LEVELDB_LIB := src/leveldb/libleveldb.a
LEVELDB_UTIL := src/leveldb/util/histogram.o src/leveldb/port/port_posix.o

PROGRAM = tera_main tera_master tabletserver teracli teramo tera_test
PROGRAM = tera_main tera_master tabletserver teracli terautil tera_test timeoracle timeoracle_bench rowlock observer_demo rowlock_proxy
TEST_PROGRAM=gtxn_test_tool

LIBRARY = libtera.a
SOLIBRARY = libtera.so
TERA_C_SO = libtera_c.so
JNILIBRARY = libjni_tera.so
OBSERVER_LIBRARY = libobserver.a
BENCHMARK = tera_bench tera_mark
TESTS = prop_tree_test tprinter_test string_util_test tablet_io_test \
tablet_scanner_test fragment_test progress_bar_test master_test load_test \
thread_pool_test
common_test sdk_test

.PHONY: all clean cleanall test

all: $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK)
all: $(PROGRAM) $(TEST_PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK) $(OBSERVER_LIBRARY)
mkdir -p build/include build/lib build/bin build/log build/benchmark
cp $(PROGRAM) build/bin
cp $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) build/lib
cp $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(OBSERVER_LIBRARY) build/lib
cp src/leveldb/tera_bench .
cp -r benchmark/*.sh benchmark/ycsb4tera/ $(BENCHMARK) build/benchmark
cp -r include build/
cp -r conf build
mkdir -p test/tools
cp $(TEST_PROGRAM) test/tools
echo 'Done'

test: $(TESTS)
Expand All @@ -115,11 +146,12 @@ check: test
clean:
rm -rf $(ALL_OBJ) $(TEST_OBJ) $(PROTO_OUT_CC) $(PROTO_OUT_H) $(TEST_OUTPUT)
$(MAKE) clean -C src/leveldb
rm -rf $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK) $(TESTS) terahttp
rm -rf $(PROGRAM) $(TEST_PROGRAM) $(LIBRARY) $(OBSERVER_LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(BENCHMARK) $(TESTS) terahttp

cleanall:
$(MAKE) clean
rm -rf build
rm -rf test/tools

tera_main: src/tera_main_wrapper.o src/version.o src/tera_flags.o
$(CXX) -o $@ $^ $(LDFLAGS)
Expand All @@ -135,37 +167,62 @@ tabletserver: $(SERVER_OBJ) $(TABLETNODE_OBJ) $(IO_OBJ) $(SDK_OBJ) \
libtera.a: $(SDK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_UTIL)
$(AR) -rs $@ $^

libtera.so: $(SDK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_UTIL)
observer_demo : $(OBSERVER_DEMO_OBJ) $(OBSERVER_LIBRARY) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

libobserver.a: $(OBSERVER_OBJ) $(SDK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_UTIL) \
$(IO_OBJ)
$(AR) -rs $@ $^

libtera.so: $(SDK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_UTIL) $(IO_OBJ)
$(CXX) -o $@ $^ $(SO_LDFLAGS)

libtera_c.so: $(TERA_C_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(SO_LDFLAGS)

teracli: $(CLIENT_OBJ) $(LIBRARY)
teracli: $(CLIENT_OBJ) $(IO_OBJ) $(LEVELDB_LIB) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

terautil: $(TERAUTIL_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

teramo: $(MONITOR_OBJ) $(LIBRARY)
gtxn_test_tool: $(GTXN_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

#teramo: $(MONITOR_OBJ) $(LIBRARY)
# $(CXX) -o $@ $^ $(LDFLAGS)

tera_mark: $(MARK_OBJ) $(LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)

tera_test: $(TEST_CLIENT_OBJ) $(LIBRARY)
$(CXX) -o $@ $(TEST_CLIENT_OBJ) $(LIBRARY) $(LDFLAGS)

timeoracle: $(TIMEORACLE_OBJ) $(PROTO_OBJ) $(COMMON_OBJ) $(OTHER_OBJ) $(SDK_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)

timeoracle_bench : $(TIMEORACLE_BENCH_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

rowlock : $(SERVER_OBJ) $(ROWLOCK_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(SDK_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)

rowlock_proxy : $(SERVER_OBJ) $(ROWLOCK_PROXY_OBJ) $(PROTO_OBJ) $(COMMON_OBJ) $(OBSERVER_LIBRARY) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)

terahttp: $(HTTP_OBJ) $(PROTO_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

libjni_tera.so: $(JNI_TERA_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(SO_LDFLAGS)

src/leveldb/libleveldb.a: FORCE
CC=$(CC) CXX=$(CXX) $(MAKE) -C src/leveldb
CXXFLAGS=$(LEVELDB_INCPATH) CC=$(CC) CXX=$(CXX) $(MAKE) -C src/leveldb

tera_bench:

# unit test
thread_pool_test: src/common/test/thread_pool_test.o $(LIBRARY)
common_test: $(COMMON_TEST_OBJ) $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

prop_tree_test: src/utils/test/prop_tree_test.o $(LIBRARY)
Expand All @@ -177,34 +234,42 @@ tprinter_test: src/utils/test/tprinter_test.o $(LIBRARY)
string_util_test: src/utils/test/string_util_test.o $(LIBRARY)
$(CXX) -o $@ $^ $(LDFLAGS)

tablet_io_test: src/sdk/tera.o src/io/test/tablet_io_test.o src/tabletnode/tabletnode_sysinfo.o \
$(IO_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
tablet_io_test: src/sdk/tera.o src/io/test/tablet_io_test.o src/tabletnode/tabletnode_sysinfo.o src/tera_entry.cc\
$(IO_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB) $(TABLETNODE_OBJ) $(SDK_OBJ)
$(CXX) $(TEST_CXXFLAGS) -o $@ $^ $(LDFLAGS)

load_test: src/sdk/tera.o src/io/test/load_test.o src/tabletnode/tabletnode_sysinfo.o \
$(IO_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
load_test: src/sdk/tera.o src/io/test/load_test.o src/tabletnode/tabletnode_sysinfo.o src/tera_entry.cc\
$(IO_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB) $(TABLETNODE_OBJ) $(SDK_OBJ)
$(CXX) $(TEST_CXXFLAGS) -o $@ $^ $(LDFLAGS)

fragment_test: src/utils/test/fragment_test.o src/utils/fragment.o
$(CXX) -o $@ $^ $(LDFLAGS)

progress_bar_test: src/common/console/progress_bar_test.o src/common/console/progress_bar.o
$(CXX) -o $@ $^ $(LDFLAGS)

tablet_scanner_test: src/sdk/tera.o src/io/test/tablet_scanner_test.o src/tabletnode/tabletnode_sysinfo.o \
$(IO_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)
tablet_scanner_test: src/sdk/tera.o src/io/test/tablet_scanner_test.o src/tabletnode/tabletnode_sysinfo.o src/tera_entry.cc\
$(IO_OBJ) $(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB) $(TABLETNODE_OBJ) $(SDK_OBJ)
$(CXX) $(TEST_CXXFLAGS) -o $@ $^ $(LDFLAGS)

master_test: src/master/test/master_test.o src/master/test/master_impl_test.o \
src/master/test/trackable_gc_test.o src/tera_entry.cc $(MASTER_OBJ) $(IO_OBJ) $(SDK_OBJ) \
master_test: src/master/test/master_test.o src/master/test/trackable_gc_test.o src/tera_entry.cc $(MASTER_OBJ) $(IO_OBJ) $(SDK_OBJ) \
$(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS) $(TEST_CXXFLAGS)

sdk_test: src/sdk/test/global_txn_internal_test.o src/sdk/test/global_txn_test.o \
src/sdk/test/filter_utils_test.o src/sdk/test/scan_impl_test.o \
src/sdk/test/sdk_timeout_manager_test.o src/sdk/test/sdk_test.o $(SDK_OBJ) \
$(PROTO_OBJ) $(OTHER_OBJ) $(COMMON_OBJ) $(LEVELDB_LIB)
$(CXX) -o $@ $^ $(LDFLAGS)

#observer_test: src/observer/test/rowlock_test.o src/observer/test/scanner_test.o src/observer/test/observer_test.o src/observer/observer_demo/demo_observer.o $(PROTO_OBJ) $(COMMON_OBJ) $(OTHER_OBJ) $(OBSERVER_OBJ) $(LIBRARY)
# $(CXX) -o $@ $^ $(LDFLAGS)

$(ALL_OBJ): %.o: %.cc $(PROTO_OUT_H)
$(CXX) $(CXXFLAGS) -c $< -o $@

$(TEST_OBJ): %.o: %.cc $(PROTO_OUT_H)
$(CXX) $(CXXFLAGS) $(UTFLAGS) -c $< -o $@
$(CXX) $(TEST_CXXFLAGS) -c $< -o $@

$(VERSION_SRC): FORCE
sh build_version.sh
Expand All @@ -222,8 +287,8 @@ proto: $(PROTO_OUT_CC) $(PROTO_OUT_H)

# install output into system directories
.PHONY: install
install: $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY)
install: $(PROGRAM) $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY)
mkdir -p $(INSTALL_PREFIX)/bin $(INSTALL_PREFIX)/include $(INSTALL_PREFIX)/lib
cp -rf $(PROGRAM) $(INSTALL_PREFIX)/bin
cp -rf include/* $(INSTALL_PREFIX)/include
cp -rf $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(INSTALL_PREFIX)/lib
cp -rf $(LIBRARY) $(SOLIBRARY) $(TERA_C_SO) $(JNILIBRARY) $(INSTALL_PREFIX)/lib
23 changes: 14 additions & 9 deletions benchmark/run_test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

if [[ $# != 7 || $6 -lt 0 || $6 -gt 100 ]]; then
echo "$0 DIST[zipfian, uniform, latest] ROW_NUM OP_NUM VALUE_SIZE COLUMN_NUM UPDATE_PROPORTION[0~100] TABLE_NAME"
exit 0
if [[ $# != 9 || $6 -lt 0 || $6 -gt 100 ]]; then
echo "$0 DIST[zipfian, uniform, latest] ROW_NUM OP_NUM VALUE_SIZE COLUMN_NUM UPDATE_PROPORTION[0~100] OP_SPEED THREAD_NUM TABLE_NAME"
exit 1
fi

DIST=$1
Expand All @@ -11,11 +11,12 @@ OP_NUM=$3
VALUE_SIZE=$4
COLUMN_NUM=$5
UPDATE_PROPORTION=$6
TABLE_NAME=$7
OP_SPEED=$7
THREAD_NUM=$8
TABLE_NAME=$9

UPDATE_PROPORTION=`printf "%02d" $6`
READ_PROPORTION=`expr 100 - $UPDATE_PROPORTION`
READ_PROPORTION=`printf "%02d" $READ_PROPORTION`
UPDATE_PROPORTION=`echo $6 | awk '{printf("%.2f",$1/100)}'`
READ_PROPORTION=`echo $6 | awk '{printf("%.2f",(100-$1)/100)}'`

echo "$UPDATE_PROPORTION"
echo "$READ_PROPORTION"
Expand All @@ -30,8 +31,12 @@ bin/ycsb run tera -p workload=com.yahoo.ycsb.workloads.CoreWorkload \
-p operationcount=$OP_NUM \
-p fieldlength=$VALUE_SIZE \
-p fieldcount=$COLUMN_NUM \
-p updateproportion=0.$UPDATE_PROPORTION \
-p readproportion=0.$READ_PROPORTION \
-p updateproportion=$UPDATE_PROPORTION \
-p readproportion=$READ_PROPORTION \
-p target=$OP_SPEED \
-p thread=$THREAD_NUM \
-p exportfile=ycsb.out \
| ./tera_mark --mode=m --tablename=$TABLE_NAME --type=async --verify=false

exit $?

7 changes: 7 additions & 0 deletions benchmark/ycsb4tera.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
更新(写入)占所有操作的比例
updateproportion: what proportion of operations should be updates (default: 0.05)
每秒总共操作的次数
target: target ops/sec all threads (default: unthrottled)
客户端线程数
thread: number of client threads (default: 1)
```
以下参数对于tera的测试意义不大,使用默认值即可:

Expand Down
28 changes: 9 additions & 19 deletions build.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ MIRROR=$1
BOOST_VERSION=1_58_0
PROTOBUF_VERSION=2.6.1
SNAPPY_VERSION=1.1.3
SOFA_PBRPC_VERSION=1.1.3
ZOOKEEPER_VERSION=3.4.9
SOFA_PBRPC_VERSION=1.1.4
ZOOKEEPER_VERSION=3.4.10
GFLAGS_VERSION=2.1.2
GLOG_VERSION=0.3.3
GTEST_VERSION=1.8.0
LIBUNWIND_VERSION=0.99
GPERFTOOLS_VERSION=2.5
INS_VERSION=0.17
NOSE_VERSION=1.3.7
MONGOOSE_VERSION=6.11

if [ $MIRROR == "china" ]; then
BOOST_URL=http://mirrors.tuna.tsinghua.edu.cn/macports/distfiles/boost/boost_${BOOST_VERSION}.tar.bz2
PROTOBUF_URL=http://mirrors.163.com/gentoo/distfiles/protobuf-${PROTOBUF_VERSION}.tar.bz2
PROTOBUF_URL=https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz
SNAPPY_URL=http://mirrors.163.com/gentoo/distfiles/snappy-${SNAPPY_VERSION}.tar.gz
SOFA_PBRPC_URL=https://github.com/baidu/sofa-pbrpc/archive/v${SOFA_PBRPC_VERSION}.tar.gz
ZOOKEEPER_URL=http://mirrors.163.com/gentoo/distfiles/zookeeper-${ZOOKEEPER_VERSION}.tar.gz
Expand All @@ -32,32 +33,21 @@ if [ $MIRROR == "china" ]; then
GPERFTOOLS_URL=https://github.com/00k/gperftools/raw/master/gperftools-${GPERFTOOLS_VERSION}.tar.gz
INS_URL=https://github.com/baidu/ins/archive/${INS_VERSION}.tar.gz
NOSE_URL=http://mirrors.163.com/gentoo/distfiles/nose-${NOSE_VERSION}.tar.gz
MONGOOSE_URL=https://github.com/cesanta/mongoose/archive/${MONGOOSE_VERSION}.tar.gz
elif [ $MIRROR == "origin" ]; then
BOOST_URL=http://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_${BOOST_VERSION}.tar.bz2
PROTOBUF_URL=https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.bz2
PROTOBUF_URL=https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-${PROTOBUF_VERSION}.tar.gz
SNAPPY_URL=https://github.com/google/snappy/releases/download/${SNAPPY_VERSION}/snappy-${SNAPPY_VERSION}.tar.gz
SOFA_PBRPC_URL=https://github.com/baidu/sofa-pbrpc/archive/v${SOFA_PBRPC_VERSION}.tar.gz
ZOOKEEPER_URL=http://www-us.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz
GFLAGS_URL=https://github.com/schuhschuh/gflags/archive/v${GFLAGS_VERSION}.tar.gz
GLOG_URL=https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz
GTEST_URL=https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz
LIBUNWIND_URL=http://download.savannah.gnu.org/releases/libunwind/libunwind-${LIBUNWIND_VERSION}.tar.gz
LIBUNWIND_URL=http://repository.timesys.com/buildsources/l/libunwind/libunwind-${LIBUNWIND_VERSION}/libunwind-${LIBUNWIND_VERSION}.tar.gz
GPERFTOOLS_URL=https://github.com/gperftools/gperftools/releases/download/gperftools-${GPERFTOOLS_VERSION}/gperftools-${GPERFTOOLS_VERSION}.tar.gz
INS_URL=https://github.com/baidu/ins/archive/${INS_VERSION}.tar.gz
NOSE_URL=https://pypi.python.org/packages/58/a5/0dc93c3ec33f4e281849523a5a913fa1eea9a3068acfa754d44d88107a44/nose-${NOSE_VERSION}.tar.gz
elif [ $MIRROR == "baidu" ]; then
BOOST_URL=http://gitlab.baidu.com/baidups/third/raw/master/boost_${BOOST_VERSION}.tar.bz2
PROTOBUF_URL=http://gitlab.baidu.com/baidups/third/raw/master/protobuf-${PROTOBUF_VERSION}.tar.bz2
SNAPPY_URL=http://gitlab.baidu.com/baidups/third/raw/master/snappy-${SNAPPY_VERSION}.tar.gz
SOFA_PBRPC_URL=http://gitlab.baidu.com/baidups/third/raw/master/sofa-pbrpc-${SOFA_PBRPC_VERSION}.tar.gz
ZOOKEEPER_URL=http://gitlab.baidu.com/baidups/third/raw/master/zookeeper-${ZOOKEEPER_VERSION}.tar.gz
GFLAGS_URL=http://gitlab.baidu.com/baidups/third/raw/master/gflags-${GFLAGS_VERSION}.tar.gz
GLOG_URL=http://gitlab.baidu.com/baidups/third/raw/master/glog-${GLOG_VERSION}.tar.gz
GTEST_URL=http://gitlab.baidu.com/baidups/third/raw/master/googletest-release-${GTEST_VERSION}.tar.gz
LIBUNWIND_URL=http://gitlab.baidu.com/baidups/third/raw/master/libunwind-${LIBUNWIND_VERSION}.tar.gz
GPERFTOOLS_URL=http://gitlab.baidu.com/baidups/third/raw/master/gperftools-${GPERFTOOLS_VERSION}.tar.gz
INS_URL=http://gitlab.baidu.com/baidups/third/raw/master/ins-${INS_VERSION}.tar.gz
NOSE_URL=http://gitlab.baidu.com/baidups/third/raw/master/nose-${NOSE_VERSION}.tar.gz
NOSE_URL=http://mirrors.163.com/gentoo/distfiles/nose-${NOSE_VERSION}.tar.gz
MONGOOSE_URL=https://github.com/cesanta/mongoose/archive/${MONGOOSE_VERSION}.tar.gz
else
return 1
fi
Expand Down
Loading

0 comments on commit 05d842e

Please sign in to comment.