Skip to content

Commit

Permalink
format chunkserver code
Browse files Browse the repository at this point in the history
Change-Id: Idb30860e27f8d7f205aab62e000e34c6342620fc
  • Loading branch information
wudemiao committed Oct 18, 2018
1 parent 56aef1c commit 751ca8d
Show file tree
Hide file tree
Showing 58 changed files with 1,576 additions and 3,442 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ bin
lib
build
*.temp
.clwb

# cscope
cscope.out
Expand All @@ -53,8 +54,8 @@ build.log


# protobuf
#*.pb.h
#*.pb.cc
*.pb.h
*.pb.cc

# bazel
bazel-bin
Expand Down
21 changes: 3 additions & 18 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ cc_test(
# hdrs = ["src/libcurve/interface/libcurve_fake.h"],
# deps = ["//proto:nameserver2_cc_proto"],
#)
#

COPTS = [
"-DGFLAGS=gflags",
"-DOS_LINUX",
Expand Down Expand Up @@ -561,31 +561,16 @@ CHUNKSERVER_DEPS = [
cc_binary(
name = "chunkserver-test",
srcs = glob([
"test/chunkserver/cli_test.cpp",
"test/chunkserver/chunk_service_test.cpp",
# "test/chunkserver/cli_test.cpp",
# "test/chunkserver/chunk_service_test.cpp",
"test/chunkserver/copyset_node_manager_test.cpp",
"test/chunkserver/op_request_test.cpp",
]),
copts = [
"-Iexternal/gtest/include",
"-g",
],
deps = CHUNKSERVER_DEPS,
)

cc_test(
name = "chunkserver-copyset-test",
srcs = glob([
"test/chunkserver/copyset_service_test.cpp",
]),
copts = [
"-Iexternal/gtest/include",
],
deps = CHUNKSERVER_DEPS,
)

# tools

cc_binary(
name = "curve-cli",
srcs = [
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ bind(

# glog deps
new_git_repository(
name = "com_github_glog_glog",
name = "com_github_google_glog",
build_file = "bazel/glog.BUILD",
remote = "https://github.com/google/glog.git",
tag = "v0.3.5",
)

bind(
name = "glog",
actual = "@com_github_glog_glog//:glog",
actual = "@com_github_google_glog//:glog",
)

git_repository(
Expand Down
6 changes: 3 additions & 3 deletions deploy/local/chunkserver/start_chunkservers_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ log=${home}/log
bin=bazel-bin
#bin=.

${bin}/chunkserver -bthread_concurrency=18 -crash_on_fatal_log=true -raft_max_segment_size=8388608 -raft_sync=true -minloglevel=0 -conf=${conf}/chunkserver.conf.0 > ${log}/chunkserver.log.0 2>&1 &
${bin}/chunkserver -bthread_concurrency=18 -crash_on_fatal_log=true -raft_max_segment_size=8388608 -raft_sync=true -minloglevel=0 -conf=${conf}/chunkserver.conf.1 > ${log}/chunkserver.log.1 2>&1 &
${bin}/chunkserver -bthread_concurrency=18 -crash_on_fatal_log=true -raft_max_segment_size=8388608 -raft_sync=true -minloglevel=0 -conf=${conf}/chunkserver.conf.2 > ${log}/chunkserver.log.2 2>&1 &
${bin}/chunkserver -bthread_concurrency=18 -raft_max_segment_size=8388608 -raft_sync=true -minloglevel=0 -conf=${conf}/chunkserver.conf.0 > ${log}/chunkserver.log.0 2>&1 &
${bin}/chunkserver -bthread_concurrency=18 -raft_max_segment_size=8388608 -raft_sync=true -minloglevel=0 -conf=${conf}/chunkserver.conf.1 > ${log}/chunkserver.log.1 2>&1 &
${bin}/chunkserver -bthread_concurrency=18 -raft_max_segment_size=8388608 -raft_sync=true -minloglevel=0 -conf=${conf}/chunkserver.conf.2 > ${log}/chunkserver.log.2 2>&1 &
8 changes: 4 additions & 4 deletions deploy/local/test/start_multicopyset_io_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

bin=bazel-bin
#bin=.
raftconf="172.17.0.2:8200:0,172.17.0.2:8201:0,172.17.0.2:8202:0"
io_count=100
raftconf="127.0.0.1:8200:0,127.0.0.1:8201:0,127.0.0.1:8202:0"
io_count=10
io_time=5
io_mode=async
iodepth=4
Expand All @@ -13,8 +13,8 @@ io_pattern=randwrite
#io_pattern=write
wait_mode=efficiency
thread_num=2
#verbose=-verbose
verbose=
verbose=-verbose
#verbose=

${bin}/multi-copyset-io-test --raftconf=${raftconf} -io_count ${io_count} -request_size ${request_size} -io_pattern ${io_pattern} -io_time ${io_time} -io_mode=${io_mode} -wait_mode=${wait_mode} -iodepth=${iodepth} -thread_num ${thread_num} ${verbose}
#${bin}/multi-copyset-io-test --raftconf=${raftconf} -io_count ${io_count} -io_time ${io_time} -thread_num ${thread_num} ${verbose}
4 changes: 2 additions & 2 deletions include/curve_compiler_specific.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// branch predict
#if defined(COMPILER_GCC)
# if defined(__cplusplus)
# define CURVE_LIKELY(expr) (__builtin_expect(static_cast<bool>(expr), true))
# define CURVE_UNLIKELY(expr) (__builtin_expect(static_cast<bool>(expr), false))
# define CURVE_LIKELY(expr) (__builtin_expect(static_cast<bool>(expr), true)) //NOLINT
# define CURVE_UNLIKELY(expr) (__builtin_expect(static_cast<bool>(expr), false)) //NOLINT
# else
# define CURVE_LIKELY(expr) (__builtin_expect(!!(expr), 1))
# define CURVE_UNLIKELY(expr) (__builtin_expect(!!(expr), 0))
Expand Down
Loading

0 comments on commit 751ca8d

Please sign in to comment.