1 Star 0 Fork 26

wanghao/BaikalDB

forked from 百度开源/BaikalDB 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BUILD 16.13 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
licenses(["notice"]) # Apache v2
exports_files(["LICENSE"])
load(":bazel/baikaldb.bzl", "baikaldb_proto_library")
genrule(
name = "gen_parser",
srcs = [
"include/sqlparser/sql_lex.l",
"include/sqlparser/sql_parse.y",
],
outs = [
"include/sqlparser/sql_lex.flex.h",
"include/sqlparser/sql_lex.flex.cc",
"include/sqlparser/sql_parse.yacc.hh",
"include/sqlparser/sql_parse.yacc.cc",
],
cmd = "\n".join([
"flex $(location include/sqlparser/sql_lex.l)",
"cat sql_lex.flex.h > $(location include/sqlparser/sql_lex.flex.h)",
"cat sql_lex.flex.cc > $(location include/sqlparser/sql_lex.flex.cc)",
"bison $(location include/sqlparser/sql_parse.y)",
"cat sql_parse.yacc.hh > $(location include/sqlparser/sql_parse.yacc.hh)",
"cat sql_parse.yacc.cc > $(location include/sqlparser/sql_parse.yacc.cc)",
]),
)
COPTS = [
"-Iproto",
"-Iinclude/sqlparser",
"-Iinclude/physical_plan",
"-Iinclude/protocol",
"-Iinclude/common",
"-Iinclude/engine",
"-Iinclude/reverse",
"-Iinclude/reverse/boolean_engine",
"-Iinclude/exec",
"-Iinclude/expr",
"-Iinclude/meta_server",
"-Iinclude/logical_plan",
"-Iinclude/raft",
"-Iinclude/raft_store",
"-Iinclude/raft_meta",
"-Iinclude/runtime",
"-Iinclude/store",
"-Iinclude/session",
"-Iinclude/mem_row",
"-mpclmul",
"-ggdb",
"-pipe",
"-W",
"-fPIC",
"-std=c++11",
"-O2",
"-g",
"-fno-omit-frame-pointer",
"-Wno-strict-aliasing",
"-Wno-unused-parameter",
"-Wno-parentheses",
"-Wno-deprecated-declarations",
"-UNDEBUG",
]
cc_library(
name = "common",
srcs = glob(["src/common/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/common/",
],
deps = [
"@boost//:lexical_cast",
"@boost//:algorithm",
"//external:rapidjson",
"//external:rocksdb",
"//external:brpc",
"//external:butil",
"//external:bthread",
"//external:json2pb",
"//external:braft",
":cc_baikaldb_internal_proto",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "engine",
srcs = glob(["src/engine/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/engine",
],
deps = [
"@boost//:lexical_cast",
"@boost//:algorithm",
"//external:rapidjson",
"//external:rocksdb",
"//external:brpc",
"//external:butil",
"//external:bthread",
"//external:json2pb",
"//external:braft",
"//external:arrow",
":cc_baikaldb_internal_proto",
":common",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "engine2",
srcs = glob(["src/engine/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/engine",
],
deps = [
"@boost//:lexical_cast",
"@boost//:algorithm",
"//external:rapidjson",
"//external:rocksdb",
"//external:brpc",
"//external:butil",
"//external:bthread",
"//external:json2pb",
"//external:braft",
"//external:arrow",
":cc_baikaldb_internal_proto",
":common",
":reverse",
":raft_dummy",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "mem_row",
srcs = glob(["src/mem_row/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/mem_row",
],
deps = [
":cc_baikaldb_internal_proto",
"//external:bthread",
"//external:brpc",
"@boost//:lexical_cast",
":common",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "store",
srcs = glob(["src/store/*.cpp"],
exclude = [
"src/store/main.cpp",
]
),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/store",
],
deps = [
"//external:rapidjson",
"//external:rocksdb",
"//external:brpc",
"//external:butil",
"//external:arrow",
"@boost//:lexical_cast",
"@boost//:filesystem",
"@boost//:algorithm",
"//external:braft",
":cc_baikaldb_internal_proto",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "expr",
srcs = glob(["src/expr/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/expr",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:regex",
"@boost//:date_time",
"@boost//:lexical_cast",
"//external:brpc",
"//external:bthread",
"//external:rocksdb",
"//external:re2",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "exec",
srcs = glob(["src/exec/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/exec",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"@boost//:unordered",
"@boost//:thread",
"@boost//:asio",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:rapidjson",
"//external:arrow",
":expr",
":session",
":protocol",
":runtime",
":engine",
":physical_plan",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "exec2",
srcs = glob(["src/exec/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/exec",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"@boost//:unordered",
"@boost//:thread",
"@boost//:asio",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:rapidjson",
"//external:arrow",
":expr",
":session",
":engine",
":runtime",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "logical_plan",
srcs = glob(["src/logical_plan/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/logical_plan/",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:unordered",
"@boost//:thread",
"@boost//:asio",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:rapidjson",
"//external:arrow",
"//external:re2",
":common",
":reverse",
":sqlparser",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "physical_plan",
srcs = glob(["src/physical_plan/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/physical_plan/",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:unordered",
"@boost//:thread",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:arrow",
"//external:re2",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "physical_plan2",
srcs = glob(["src/physical_plan/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/physical_plan/",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:unordered",
"@boost//:thread",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:arrow",
":exec2",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "raft",
srcs = glob(["src/raft/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/raft/",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"//external:braft",
"//external:rocksdb",
"//external:rapidjson",
"//external:arrow",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "raft_store",
srcs = glob(["src/raft_store/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/raft_store",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"//external:braft",
"//external:brpc",
"//external:rocksdb",
"//external:rapidjson",
"//external:arrow",
":common",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "raft_meta",
srcs = glob(["src/raft_meta/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/raft_meta",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"//external:braft",
"//external:rocksdb",
"//external:rapidjson",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "raft_dummy",
srcs = glob(["src/raft_dummy/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/raft_dummy",
],
deps = [],
visibility = ["//visibility:public"],
)
cc_library(
name = "sqlparser",
srcs = glob(["include/sqlparser/*.cc"]) + [
":gen_parser",
],
hdrs = glob([
"include/**/*.h",
"include/**/*.hh",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/sqlparser",
],
deps = [
"//external:butil",
"//external:brpc",
":cc_baikaldb_internal_proto",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "meta_server",
srcs = glob(["src/meta_server/*.cpp"],
exclude = [
"src/meta_server/main.cpp",
],
),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/meta_server",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"@boost//:algorithm",
"//external:braft",
"//external:butil",
"//external:rocksdb",
"//external:rapidjson",
":engine",
":common",
],
visibility = ["//visibility:public"],
)
cc_binary(
name = "baikalMeta",
srcs = ["src/meta_server/main.cpp"],
includes = [
"include/meta_server",
"include/engine",
"include/common",
],
copts = [
"-DBAIDU_RPC_ENABLE_CPU_PROFILER",
"-DBAIDU_RPC_ENABLE_HEAP_PROFILER",
],
deps = [
":meta_server",
":cc_baikaldb_internal_proto",
":common",
":engine",
":raft",
":raft_meta",
"@boost//:filesystem",
"//external:tcmalloc_and_profiler",
],
linkstatic = True,
)
cc_binary(
name = "baikalStore",
srcs = ["src/store/main.cpp"],
includes = [
"include/store",
],
copts = [
"-DBAIDU_RPC_ENABLE_CPU_PROFILER",
"-DBAIDU_RPC_ENABLE_HEAP_PROFILER",
],
deps = [
":store",
":session",
":common",
":engine",
":raft",
":protocol",
":raft_store",
":sqlparser",
":reverse",
":expr",
":exec",
":runtime",
":physical_plan",
":logical_plan",
":mem_row",
"//external:tcmalloc_and_profiler",
],
linkstatic = True,
)
cc_library(
name = "protocol",
srcs = glob(["src/protocol/*.cpp"],
exclude = [
"src/protocol/main.cpp",
],
),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/protocol",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:unordered",
"@boost//:thread",
"@boost//:asio",
"//external:bvar",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:rapidjson",
"//external:re2",
":common",
":session",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "protocol2",
srcs = glob(["src/protocol/*.cpp"],
exclude = [
"src/protocol/main.cpp",
],
),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/protocol",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:unordered",
"@boost//:thread",
"@boost//:asio",
"//external:bvar",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:rapidjson",
":common",
":session",
":exec2",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "session",
srcs = glob(["src/session/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
deps = [
":cc_baikaldb_internal_proto",
"@boost//:unordered",
"@boost//:thread",
"@boost//:asio",
"//external:bthread",
"//external:rocksdb",
"//external:arrow",
":common",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_binary(
name = "baikaldb",
srcs = ["src/protocol/main.cpp"],
copts = COPTS + [
"-DBAIDU_RPC_ENABLE_CPU_PROFILER",
"-DBAIDU_RPC_ENABLE_HEAP_PROFILER",
],
deps = [
":protocol2",
":common",
":session",
":engine2",
":store",
":sqlparser",
":reverse",
":expr",
":exec2",
":raft_dummy",
":runtime",
":physical_plan2",
":logical_plan",
":mem_row",
"//external:tcmalloc_and_profiler",
],
linkstatic = True,
)
cc_library(
name = "runtime",
srcs = glob(["src/runtime/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/runtime",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"//external:bthread",
"//external:brpc",
"//external:rocksdb",
"//external:arrow",
":reverse",
],
visibility = ["//visibility:public"],
)
cc_library(
name = "reverse",
srcs = glob(["src/reverse/*.cpp"]),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
]),
copts = COPTS,
includes = [
"include/reverse",
"include/reverse/boolean_engine",
],
deps = [
":cc_baikaldb_internal_proto",
"@boost//:lexical_cast",
"//external:brpc",
"//external:bthread",
"//external:rocksdb",
"//external:arrow",
"//external:rapidjson",
":common",
],
visibility = ["//visibility:public"],
)
baikaldb_proto_library(
name = "cc_baikaldb_internal_proto",
srcs = glob([
"proto/*.proto",
]),
include = "proto",
visibility = ["//visibility:public"],
)
cc_binary(
name = "test_date_time",
srcs = ["test/test_date_time.cpp"],
copts = ["-Iexternal/gtest/include"],
deps = [
":common",
],
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/wanghao1816/BaikalDB.git
git@gitee.com:wanghao1816/BaikalDB.git
wanghao1816
BaikalDB
BaikalDB
master

搜索帮助