Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
indiff7643
Terarkdb
提交
fff5c7e8
T
Terarkdb
项目概览
indiff7643
/
Terarkdb
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Terarkdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fff5c7e8
编写于
1月 06, 2014
作者:
I
Igor Canadi
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into columnfamilies
上级
ef6ad170
c370f559
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
125 addition
and
38 deletion
+125
-38
.clang-format
.clang-format
+47
-0
.gitignore
.gitignore
+0
-1
build_tools/build_detect_version
build_tools/build_detect_version
+11
-31
build_tools/make_new_version.sh
build_tools/make_new_version.sh
+61
-0
db/table_cache.cc
db/table_cache.cc
+5
-5
util/autovector_test.cc
util/autovector_test.cc
+1
-1
未找到文件。
.clang-format
0 → 100644
浏览文件 @
fff5c7e8
# Complete list of style options can be found at:
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
BasedOnStyle: Google
AccessModifierOffset: -1
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakConstructorInitializersBeforeComma: false
BinPackParameters: false
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: true
ExperimentalAutoDetectBinPacking: true
IndentCaseLabels: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 10
PenaltyBreakComment: 60
PenaltyBreakString: 1000
PenaltyBreakFirstLessLess: 20
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerBindsToType: true
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
Standard: Cpp11
IndentWidth: 2
TabWidth: 8
UseTab: Never
BreakBeforeBraces: Attach
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
...
.gitignore
浏览文件 @
fff5c7e8
...
...
@@ -19,5 +19,4 @@ sst_dump
util/build_version.cc
build_tools/VALGRIND_LOGS/
coverage/COVERAGE_REPORT
util/build_version.cc.tmp
.gdbhistory
build_tools/build_detect_version
浏览文件 @
fff5c7e8
...
...
@@ -5,38 +5,18 @@
# is then built as a regular source file as part of the compilation process.
# One can run "strings executable_filename | grep _build_" to find the version of
# the source that we used to build the executable file.
#
# create git version file
VFILE
=
$PWD
/util/build_version.cc.tmp
trap
"rm
$VFILE
"
EXIT
# check to see if git is in the path
which git
>
/dev/null
OUTFILE
=
"
$PWD
/util/build_version.cc"
if
[
"
$?
"
=
0
]
;
then
env
-i
git rev-parse HEAD 2>&1 |
awk
'
BEGIN {
print "#include \"build_version.h\"\n"
}
{ print "const char* rocksdb_build_git_sha = \"rocksdb_build_git_sha:" $0"\";" }
'
>
${
VFILE
}
else
echo
"git not found"
|
awk
'
BEGIN {
print "#include \"build_version.h\""
}
{ print "const char* rocksdb_build_git_sha = \"rocksdb_build_git_sha:git not found\";" }
'
>
${
VFILE
}
GIT_SHA
=
""
if
command
-v
git
>
/dev/null 2>&1
;
then
GIT_SHA
=
$(
git rev-parse HEAD 2>/dev/null
)
fi
echo
"const char* rocksdb_build_git_datetime =
\"
rocksdb_build_git_datetime:
$(
date
)
\"
;"
>>
${
VFILE
}
echo
"const char* rocksdb_build_compile_date = __DATE__;"
>>
${
VFILE
}
echo
"const char* rocksdb_build_compile_time = __TIME__;"
>>
${
VFILE
}
OUTFILE
=
$PWD
/util/build_version.cc
if
[
!
-e
$OUTFILE
]
||
!
cmp
-s
$VFILE
$OUTFILE
;
then
cp
$VFILE
$OUTFILE
fi
cat
>
"
${
OUTFILE
}
"
<<
EOF
#include "build_version.h"
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:
${
GIT_SHA
}
";
const char* rocksdb_build_git_datetime = "rocksdb_build_git_datetime:
$(
date
)
";
const char* rocksdb_build_compile_date = __DATE__;
const char* rocksdb_build_compile_time = __TIME__;
EOF
build_tools/make_new_version.sh
0 → 100755
浏览文件 @
fff5c7e8
#!/bin/bash
# Copyright (c) 2013, Facebook, Inc. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
set
-e
# Print out the colored progress info so that it can be brainlessly
# distinguished by users.
function
title
()
{
echo
-e
"
\0
33[1;32m
$*
\0
33[0m"
}
usage
=
"Create new rocksdb version and prepare it for the release process
\n
"
usage+
=
"USAGE: ./make_new_version.sh <version>"
# -- Pre-check
if
[[
$#
< 1
]]
;
then
echo
-e
$usage
exit
1
fi
ROCKSDB_VERSION
=
$1
GIT_BRANCH
=
`
git rev-parse
--abbrev-ref
HEAD
`
if
[
$GIT_BRANCH
!=
"master"
]
;
then
echo
"Error: Current branch is '
$GIT_BRANCH
', Please switch to master branch."
fi
# --Step 1: cutting new tag
title
"Adding new tag for this release ..."
git tag
-a
"
$ROCKSDB_VERSION
.fb"
-m
"Rocksdb
$ROCKSDB_VERSION
"
# Setting up the proxy for remote repo access
export
http_proxy
=
http://172.31.255.99:8080
export
https_proxy
=
"
$http_proxy
"
;
title
"Pushing new tag to remote repo ..."
proxycmd.sh git push origin
--tags
# --Step 2: Update README.fb
title
"Updating the latest version info in README.fb ..."
sed
-i
"s/Latest release is [0-9]
\+
.[0-9]
\+
.fb/Latest release is
$ROCKSDB_VERSION
.fb/"
README.fb
git commit README.fb
-m
"update the latest version in README.fb to
$ROCKSDB_VERSION
"
proxycmd.sh git push
# --Step 3: Prepare this repo for 3rd release
title
"Cleaning up repo ..."
make clean
git clean
-fxd
title
"Generating the build info ..."
# Comment out the call of `build_detection_version` so that the SHA number and build date of this
# release will remain constant. Otherwise everytime we run "make" util/build_version.cc will be
# overridden.
sed
-i
's/^\$PWD\/build_tools\/build_detect_version$//'
build_tools/build_detect_platform
# Generate util/build_version.cc
build_tools/build_detect_version
title
"Done!"
db/table_cache.cc
浏览文件 @
fff5c7e8
...
...
@@ -29,9 +29,9 @@ static void UnrefEntry(void* arg1, void* arg2) {
cache
->
Release
(
h
);
}
static
Slice
GetSliceForFileNumber
(
uint64_t
file_number
)
{
return
Slice
(
reinterpret_cast
<
const
char
*>
(
&
file_number
),
sizeof
(
file_number
));
static
Slice
GetSliceForFileNumber
(
uint64_t
*
file_number
)
{
return
Slice
(
reinterpret_cast
<
const
char
*>
(
file_number
),
sizeof
(
*
file_number
));
}
TableCache
::
TableCache
(
const
std
::
string
&
dbname
,
...
...
@@ -55,7 +55,7 @@ Status TableCache::FindTable(const EnvOptions& toptions,
Cache
::
Handle
**
handle
,
bool
*
table_io
,
const
bool
no_io
)
{
Status
s
;
Slice
key
=
GetSliceForFileNumber
(
file_number
);
Slice
key
=
GetSliceForFileNumber
(
&
file_number
);
*
handle
=
cache_
->
Lookup
(
key
);
if
(
*
handle
==
nullptr
)
{
if
(
no_io
)
{
// Dont do IO and return a not-found status
...
...
@@ -168,7 +168,7 @@ bool TableCache::PrefixMayMatch(const ReadOptions& options,
}
void
TableCache
::
Evict
(
uint64_t
file_number
)
{
cache_
->
Erase
(
GetSliceForFileNumber
(
file_number
));
cache_
->
Erase
(
GetSliceForFileNumber
(
&
file_number
));
}
}
// namespace rocksdb
util/autovector_test.cc
浏览文件 @
fff5c7e8
...
...
@@ -17,7 +17,7 @@ using namespace std;
class
AutoVectorTest
{
};
const
size_t
kSize
=
8
;
const
unsigned
long
kSize
=
8
;
TEST
(
AutoVectorTest
,
PushBackAndPopBack
)
{
autovector
<
size_t
,
kSize
>
vec
;
ASSERT_TRUE
(
vec
.
empty
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录