Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kvdb
rocksdb
提交
39c3e94f
R
rocksdb
项目概览
kvdb
/
rocksdb
11 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rocksdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
39c3e94f
编写于
1月 19, 2016
作者:
S
Siying Dong
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #954 from davidbernard/solaris_build
Solaris Build
上级
34704d5c
df7c2f3b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
41 addition
and
16 deletion
+41
-16
Makefile
Makefile
+15
-3
db/db_compaction_test.cc
db/db_compaction_test.cc
+1
-1
db/db_impl.cc
db/db_impl.cc
+3
-0
db/db_test.cc
db/db_test.cc
+3
-0
java/src/main/java/org/rocksdb/util/Environment.java
java/src/main/java/org/rocksdb/util/Environment.java
+8
-2
util/options_builder.cc
util/options_builder.cc
+3
-3
utilities/geodb/geodb_impl.cc
utilities/geodb/geodb_impl.cc
+8
-7
未找到文件。
Makefile
浏览文件 @
39c3e94f
...
...
@@ -143,6 +143,9 @@ else
OPT
+=
-DNDEBUG
endif
ifeq
($(PLATFORM), OS_SOLARIS)
PLATFORM_CXXFLAGS
+=
-D
_GLIBCXX_USE_C99
endif
ifneq
($(filter -DROCKSDB_LITE,$(OPT)),)
# found
CFLAGS
+=
-fno-exceptions
...
...
@@ -1036,7 +1039,11 @@ install: install-static
# ---------------------------------------------------------------------------
JAVA_INCLUDE
=
-I
$(JAVA_HOME)
/include/
-I
$(JAVA_HOME)
/include/linux
ARCH
:=
$(
shell
getconf LONG_BIT
)
ifeq
($(PLATFORM), OS_SOLARIS)
ARCH
:=
$(
shell
isainfo
-b
)
else
ARCH
:=
$(
shell
getconf LONG_BIT
)
endif
ROCKSDBJNILIB
=
librocksdbjni-linux
$(ARCH)
.so
ROCKSDB_JAR
=
rocksdbjni-
$(ROCKSDB_MAJOR)
.
$(ROCKSDB_MINOR)
.
$(ROCKSDB_PATCH)
-linux
$(ARCH)
.jar
ROCKSDB_JAR_ALL
=
rocksdbjni-
$(ROCKSDB_MAJOR)
.
$(ROCKSDB_MINOR)
.
$(ROCKSDB_PATCH)
.jar
...
...
@@ -1044,14 +1051,19 @@ ROCKSDB_JAVADOCS_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PA
ROCKSDB_SOURCES_JAR
=
rocksdbjni-
$(ROCKSDB_MAJOR)
.
$(ROCKSDB_MINOR)
.
$(ROCKSDB_PATCH)
-sources
.jar
ifeq
($(PLATFORM), OS_MACOSX)
ROCKSDBJNILIB
=
librocksdbjni-osx.jnilib
ROCKSDB_JAR
=
rocksdbjni-
$(ROCKSDB_MAJOR)
.
$(ROCKSDB_MINOR)
.
$(ROCKSDB_PATCH)
-osx
.jar
ROCKSDBJNILIB
=
librocksdbjni-osx.jnilib
ROCKSDB_JAR
=
rocksdbjni-
$(ROCKSDB_MAJOR)
.
$(ROCKSDB_MINOR)
.
$(ROCKSDB_PATCH)
-osx
.jar
ifneq
("$(wildcard $(JAVA_HOME)/include/darwin)","")
JAVA_INCLUDE
=
-I
$(JAVA_HOME)
/include
-I
$(JAVA_HOME)
/include/darwin
else
JAVA_INCLUDE
=
-I
/System/Library/Frameworks/JavaVM.framework/Headers/
endif
endif
ifeq
($(PLATFORM), OS_SOLARIS)
ROCKSDBJNILIB
=
librocksdbjni-solaris
$(ARCH)
.so
ROCKSDB_JAR
=
rocksdbjni-
$(ROCKSDB_MAJOR)
.
$(ROCKSDB_MINOR)
.
$(ROCKSDB_PATCH)
-solaris
$(ARCH)
.jar
JAVA_INCLUDE
=
-I
$(JAVA_HOME)
/include/
-I
$(JAVA_HOME)
/include/solaris
endif
libz.a
:
-
rm
-rf
zlib-1.2.8
...
...
db/db_compaction_test.cc
浏览文件 @
39c3e94f
...
...
@@ -1898,7 +1898,7 @@ TEST_P(DBCompactionTestWithParam, DISABLED_CompactFilesOnLevelCompaction) {
std
::
set
<
std
::
string
>
overlapping_file_names
;
std
::
vector
<
std
::
string
>
compaction_input_file_names
;
for
(
int
f
=
0
;
f
<
file_picked
;
++
f
)
{
int
level
;
int
level
=
0
;
auto
file_meta
=
PickFileRandomly
(
cf_meta
,
&
rnd
,
&
level
);
compaction_input_file_names
.
push_back
(
file_meta
->
name
);
GetOverlappingFileNumbersForLevelCompaction
(
...
...
db/db_impl.cc
浏览文件 @
39c3e94f
...
...
@@ -15,6 +15,9 @@
#include <inttypes.h>
#include <stdint.h>
#ifdef OS_SOLARIS
#include <alloca.h>
#endif
#include <algorithm>
#include <climits>
...
...
db/db_test.cc
浏览文件 @
39c3e94f
...
...
@@ -20,6 +20,9 @@
#ifndef OS_WIN
#include <unistd.h>
#endif
#ifdef OS_SOLARIS
#include <alloca.h>
#endif
#include "db/filename.h"
#include "db/dbformat.h"
...
...
java/src/main/java/org/rocksdb/util/Environment.java
浏览文件 @
39c3e94f
...
...
@@ -18,6 +18,10 @@ public class Environment {
OS
.
contains
(
"aix"
));
}
public
static
boolean
isSolaris
()
{
return
OS
.
contains
(
"sunos"
);
}
public
static
boolean
is64Bit
()
{
return
(
ARCH
.
indexOf
(
"64"
)
>
0
);
}
...
...
@@ -36,7 +40,9 @@ public class Environment {
return
String
.
format
(
"%sjni-linux%s"
,
name
,
arch
);
}
else
if
(
isMac
())
{
return
String
.
format
(
"%sjni-osx"
,
name
);
}
}
else
if
(
isSolaris
())
{
return
String
.
format
(
"%sjni-solaris%d"
,
name
,
is64Bit
()
?
64
:
32
);
}
throw
new
UnsupportedOperationException
();
}
...
...
@@ -45,7 +51,7 @@ public class Environment {
}
private
static
String
appendLibOsSuffix
(
final
String
libraryFileName
,
final
boolean
shared
)
{
if
(
isUnix
())
{
if
(
isUnix
()
||
isSolaris
()
)
{
return
libraryFileName
+
".so"
;
}
else
if
(
isMac
())
{
return
libraryFileName
+
(
shared
?
".dylib"
:
".jnilib"
);
...
...
util/options_builder.cc
浏览文件 @
39c3e94f
...
...
@@ -26,7 +26,7 @@ CompactionStyle PickCompactionStyle(size_t write_buffer_size,
// Otherwise, calculate a score based on threshold and expected value of
// two styles, weighing reads 4X important than writes.
int
expected_levels
=
static_cast
<
int
>
(
ceil
(
::
log
(
target_db_size
/
write_buffer_size
)
/
::
log
(
kBytesForLevelMultiplier
)));
std
::
log
(
target_db_size
/
write_buffer_size
)
/
std
::
log
(
kBytesForLevelMultiplier
)));
int
expected_max_files_universal
=
static_cast
<
int
>
(
ceil
(
log2
(
target_db_size
/
write_buffer_size
)));
...
...
@@ -117,8 +117,8 @@ void OptimizeForLevel(int read_amplification_threshold,
int
write_amplification_threshold
,
uint64_t
target_db_size
,
Options
*
options
)
{
int
expected_levels_one_level0_file
=
static_cast
<
int
>
(
ceil
(
::
log
(
target_db_size
/
options
->
write_buffer_size
)
/
::
log
(
kBytesForLevelMultiplier
)));
static_cast
<
int
>
(
ceil
(
std
::
log
(
target_db_size
/
options
->
write_buffer_size
)
/
std
::
log
(
kBytesForLevelMultiplier
)));
int
level0_stop_writes_trigger
=
read_amplification_threshold
-
expected_levels_one_level0_file
;
...
...
utilities/geodb/geodb_impl.cc
浏览文件 @
39c3e94f
...
...
@@ -19,6 +19,7 @@
#include "util/coding.h"
#include "util/string_util.h"
//
// There are two types of keys. The first type of key-values
// maps a geo location to the set of object ids and their values.
...
...
@@ -352,8 +353,8 @@ Status GeoDBImpl::searchQuadIds(const GeoPosition& position,
Pixel
bottomRight
=
PositionToPixel
(
bottomRightPos
,
Detail
);
// how many level of details to look for
int
numberOfTilesAtMaxDepth
=
static_cast
<
int
>
(
floor
((
bottomRight
.
x
-
topLeft
.
x
)
/
256
));
int
zoomLevelsToRise
=
static_cast
<
int
>
(
floor
(
::
log
(
numberOfTilesAtMaxDepth
)
/
::
log
(
2
)));
int
numberOfTilesAtMaxDepth
=
static_cast
<
int
>
(
std
::
floor
((
bottomRight
.
x
-
topLeft
.
x
)
/
256
));
int
zoomLevelsToRise
=
static_cast
<
int
>
(
std
::
floor
(
std
::
log
(
numberOfTilesAtMaxDepth
)
/
std
::
log
(
2
)));
zoomLevelsToRise
++
;
int
levels
=
std
::
max
(
0
,
Detail
-
zoomLevelsToRise
);
...
...
@@ -390,10 +391,10 @@ GeoDBImpl::Pixel GeoDBImpl::PositionToPixel(const GeoPosition& pos,
double
latitude
=
clip
(
pos
.
latitude
,
MinLatitude
,
MaxLatitude
);
double
x
=
(
pos
.
longitude
+
180
)
/
360
;
double
sinLatitude
=
sin
(
latitude
*
PI
/
180
);
double
y
=
0.5
-
::
log
((
1
+
sinLatitude
)
/
(
1
-
sinLatitude
))
/
(
4
*
PI
);
double
y
=
0.5
-
std
::
log
((
1
+
sinLatitude
)
/
(
1
-
sinLatitude
))
/
(
4
*
PI
);
double
mapSize
=
MapSize
(
levelOfDetail
);
double
X
=
floor
(
clip
(
x
*
mapSize
+
0.5
,
0
,
mapSize
-
1
));
double
Y
=
floor
(
clip
(
y
*
mapSize
+
0.5
,
0
,
mapSize
-
1
));
double
X
=
std
::
floor
(
clip
(
x
*
mapSize
+
0.5
,
0
,
mapSize
-
1
));
double
Y
=
std
::
floor
(
clip
(
y
*
mapSize
+
0.5
,
0
,
mapSize
-
1
));
return
Pixel
((
unsigned
int
)
X
,
(
unsigned
int
)
Y
);
}
...
...
@@ -408,8 +409,8 @@ GeoPosition GeoDBImpl::PixelToPosition(const Pixel& pixel, int levelOfDetail) {
// Converts a Pixel to a Tile
GeoDBImpl
::
Tile
GeoDBImpl
::
PixelToTile
(
const
Pixel
&
pixel
)
{
unsigned
int
tileX
=
static_cast
<
unsigned
int
>
(
floor
(
pixel
.
x
/
256
));
unsigned
int
tileY
=
static_cast
<
unsigned
int
>
(
floor
(
pixel
.
y
/
256
));
unsigned
int
tileX
=
static_cast
<
unsigned
int
>
(
std
::
floor
(
pixel
.
x
/
256
));
unsigned
int
tileY
=
static_cast
<
unsigned
int
>
(
std
::
floor
(
pixel
.
y
/
256
));
return
Tile
(
tileX
,
tileY
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录