提交 2544463c 编写于 作者: H HuangWei 提交者: Wu Tao

idl: fix recompile_thrift.sh & script: add format_files.sh (#205)

上级 be693f95
#!/bin/bash
pwd="$( cd "$( dirname "$0" )" && pwd )"
root_dir="$( cd $pwd/.. && pwd )"
cd $root_dir
linenoise=./src/shell/linenoise
sds=./src/shell/sds
if [ $# -eq 0 ]; then
echo "formating all .h/.cpp files in $root_dir ..."
find . -type f -not \( -wholename "$linenoise/*" -o -wholename "$sds/*" -o -wholename "./rocksdb/*" \) -regextype posix-egrep -regex ".*\.(cpp|h)" | xargs clang-format -i -style=file
elif [ $1 = "-h" ]; then
echo "USAGE: ./format-files.sh [<relative_path>] -- format .h/.cpp files in $root_dir/relative_path"
echo " ./format-files.sh means format all .h/.cpp files in $root_dir"
else
echo "formating all .h/.cpp files in $root_dir/$1 ..."
find ./$1 -type f -not \( -wholename "$linenoise/*" -o -wholename "$sds/*" -o -wholename "./rocksdb/*" \) -regextype posix-egrep -regex ".*\.(cpp|h)" | xargs clang-format -i -style=file
fi
#!/bin/bash
# recommand thrift-0.9.3
cd `dirname $0`
DSN_ROOT=../../rdsn
if [ ! -d "$DSN_ROOT" ]; then
echo "ERROR: DSN_ROOT not set"
exit 1
......@@ -10,11 +13,8 @@ TMP_DIR=./tmp
rm -rf $TMP_DIR
mkdir -p $TMP_DIR
sh $DSN_ROOT/bin/dsn.cg.sh rrdb.thrift cpp $TMP_DIR
cp -v $TMP_DIR/rrdb.types.h ../include/rrdb/
#cp -v $TMP_DIR/rrdb.code.definition.h ../include/rrdb/
#cp -v $TMP_DIR/rrdb.client.h ../include/rrdb/
#sed 's/# include "rrdb.code.definition.h"/# include <rrdb\/rrdb.code.definition.h>/' $TMP_DIR/rrdb.server.h > ../include/rrdb/rrdb.server.h
$DSN_ROOT/bin/Linux/thrift --gen cpp:moveable_types -out $TMP_DIR rrdb.thrift
sed 's/#include "dsn_types.h"/#include <dsn\/service_api_cpp.h>/' $TMP_DIR/rrdb_types.h > ../include/rrdb/rrdb_types.h
sed 's/#include "rrdb_types.h"/#include <rrdb\/rrdb_types.h>/' $TMP_DIR/rrdb_types.cpp > ../base/rrdb_types.cpp
......
......@@ -51,9 +51,7 @@ public:
for (int i = put_rpc_cnt; i < total_rpc_cnt; i++) {
writes[i] = pegasus::create_remove_request(key);
}
auto cleanup = dsn::defer([=]() {
delete[] writes;
});
auto cleanup = dsn::defer([=]() { delete[] writes; });
int err =
_server_write->on_batched_write_requests(writes, total_rpc_cnt, decree, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册