8000 issue 493.1: update iresearch to changeset 15f561dee5865ead83663ef056… · mnemosdev/arangodb@9b36a94 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b36a94

Browse files
vasiliy-arangodbAndrey Abramov
authored and
Andrey Abramov
committed
issue 493.1: update iresearch to changeset 15f561dee5865ead83663ef056d7bbcc38636fb2 (arangodb#6947)
1 parent 4184144 commit 9b36a94

34 files changed

+1916
-1586
lines changed

3rdParty/iresearch/appveyor.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build:
1111

1212
environment:
1313
BOOST_VERSION: default
14-
CMAKE_OPTIONS: -DUSE_TESTS=On -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DMSVC_BUILD_THREADS=16 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 # _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING required for GTEST/MSVC2017
14+
CMAKE_OPTIONS: -DUSE_TESTS=On -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DMSVC_BUILD_THREADS=16
1515
CMAKE_BUILD_OPTIONS: --config %CONFIGURATION%
1616
matrix:
1717
############################################################################
@@ -180,12 +180,6 @@ install:
180180
- cd %GTEST_DIR%
181181
- appveyor-retry git fetch --tags
182182
- appveyor-retry git checkout tags/release-1.8.0
183-
- cd googletest
184-
# - mkdir build && cd build
185-
# - cmake -g %APPVEYOR_BUILD_WORKER_IMAGE% -Ax64 -Dgtest_force_shared_crt=ON -DINSTALL_GTEST=ON -DBUILD_GMOCK=OFF -DCMAKE_DEBUG_POSTFIX="" ..
186-
# - cmake --build . %CMAKE_BUILD_OPTIONS%
187-
# - mkdir %GTEST_DIR%\googletest\lib
188-
# - move /Y %CONFIGURATION%\* %GTEST_DIR%\googletest\lib || true
189183
- set GTEST_ROOT=%GTEST_DIR%\googletest
190184

191185
############################################################################

3rdParty/iresearch/cmake/FindGTestLocal.cmake

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,20 @@ if (GTEST_INCLUDE_DIR AND GTEST_SRC_DIR_GTEST AND GTEST_SRC_DIR_CMAKE)
8484
EXCLUDE_FROM_ALL # do not build unused targets
8585
)
8686

87-
if (MSVC)
88-
target_compile_options(gtest
89-
PRIVATE "$<$<CONFIG:Debug>:/MDd>$<$<NOT:$<CONFIG:Debug>>:/MD>"
90-
)
91-
92-
target_compile_options(gtest_main
93-
PRIVATE "$<$<CONFIG:Debug>:/MDd>$<$<NOT:$<CONFIG:Debug>>:/MD>"
94-
)
95-
endif()
87+
if (MSVC)
88+
# when compiling or linking against GTEST on MSVC2017 the following
89+
# definition is required: /D _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
90+
91+
target_compile_options(gtest
92+
PRIVATE "$<$<CONFIG:Debug>:/MDd>$<$<NOT:$<CONFIG:Debug>>:/MD>"
93+
PRIVATE "/D _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
94+
)
95+
96+
target_compile_options(gtest_main
97+
PRIVATE "$<$<CONFIG:Debug>:/MDd>$<$<NOT:$<CONFIG:Debug>>:/MD>"
98+
PRIVATE "/D _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
99+
)
100+
endif()
96101

97102
set(GTEST_LIBRARIES gtest)
98103
set(GTEST_MAIN_LIBRARIES gtest_main)

3rdParty/iresearch/core/analysis/token_streams.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ bool string_token_stream::next() {
128128
bytes_ref numeric_token_stream::numeric_term::value(
129129
bstring& buf,
130130
NumericType type,
131-
decltype(numeric_token_stream::numeric_term::val_) val,
132-
uint32_t shift) {
131+
value_t val,
132+
uint32_t shift
133+
) {
133134
switch (type) {
134135
case NT_LONG: {
135136
typedef numeric_utils::numeric_traits<int64_t> traits_t;
@@ -276,4 +277,4 @@ bool null_token_stream::next() {
276277
return value;
277278
}
278279

279-
NS_END
280+
NS_END

3rdParty/iresearch/core/analysis/token_streams.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,14 @@ class IRESEARCH_API numeric_token_stream final
244244

245245
private:
246246
enum NumericType { NT_LONG = 0, NT_DBL, NT_INT, NT_FLOAT };
247+
union value_t {
248+
uint64_t i64;
249+
uint32_t i32;
250+
};
247251

248252
IRESEARCH_API_PRIVATE_VARIABLES_BEGIN
249253
bstring data_;
250-
union {
251-
uint64_t i64;
252-
uint32_t i32;
253-
} val_;
254+
value_t val_;
254255
NumericType type_;
255256
uint32_t step_;
256257
uint32_t shift_;
@@ -259,7 +260,7 @@ class IRESEARCH_API numeric_token_stream final
259260
static irs::bytes_ref value(
260261
bstring& buf,
261262
NumericType type,
262-
decltype(val_) val,
263+
value_t val,
263264
uint32_t shift
264265
);
265266
}; // numeric_term

3rdParty/iresearch/core/formats/formats_10.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,7 +2591,7 @@ bool meta_reader::read(column_meta& column) {
25912591
// |Bloom filter offset| <- not implemented yet
25922592
// |Footer|
25932593

2594-
const size_t INDEX_BLOCK_SIZE = 1024;
2594+
const uint32_t INDEX_BLOCK_SIZE = 1024;
25952595
const size_t MAX_DATA_BLOCK_SIZE = 8192;
25962596

25972597
// By default we treat columns as a variable length sparse columns
@@ -3175,7 +3175,7 @@ class sparse_block : util::noncopyable {
31753175
}; // iterator
31763176

31773177
bool load(index_input& in, decompressor& decomp, bstring& buf) {
3178-
const size_t size = in.read_vint(); // total number of entries in a block
3178+
const uint32_t size = in.read_vint(); // total number of entries in a block
31793179
assert(size);
31803180

31813181
auto begin = std::begin(index_);
@@ -3360,7 +3360,7 @@ class dense_block : util::noncopyable {
33603360
}; // iterator
33613361

33623362
bool load(index_input& in, decompressor& decomp, bstring& buf) {
3363-
const size_t size = in.read_vint(); // total number of entries in a block
3363+
const uint32_t size = in.read_vint(); // total number of entries in a block
33643364
assert(size);
33653365

33663366
// dense block must be encoded with RL encoding, avg must be equal to 1
@@ -4063,7 +4063,7 @@ class sparse_column final : public column {
40634063
if (!column::read(in, buf)) {
40644064
return false;
40654065
}
4066-
size_t blocks_count = in.read_vint(); // total number of column index blocks
4066+
uint32_t blocks_count = in.read_vint(); // total number of column index blocks
40674067

40684068
std::vector<block_ref> refs(blocks_count + 1); // +1 for upper bound
40694069

@@ -4460,7 +4460,7 @@ class dense_fixed_length_column<dense_mask_block> final : public column {
44604460
return false;
44614461
}
44624462

4463-
size_t blocks_count = in.read_vint(); // total number of column index blocks
4463+
uint32_t blocks_count = in.read_vint(); // total number of column index blocks
44644464

44654465
while (blocks_count >= INDEX_BLOCK_SIZE) {
44664466
if (!encode::avg::check_block_rl32(in, this->avg_block_count())) {
@@ -5034,4 +5034,4 @@ NS_END // root
50345034

50355035
// -----------------------------------------------------------------------------
50365036
// --SECTION-- END-OF-FILE
5037-
// -----------------------------------------------------------------------------
5037+
// -----------------------------------------------------------------------------

3rdParty/iresearch/core/index/field_data.hpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,18 @@ class IRESEARCH_API fields_data: util::noncopyable {
125125
field_data& get(const hashed_string_ref& name);
126126

127127
//////////////////////////////////////////////////////////////////////////////
128-
/// @return approximate amount of memory size occupied by this instance
128+
/// @return approximate amount of memory actively in-use by this instance
129129
//////////////////////////////////////////////////////////////////////////////
130-
size_t memory() const NOEXCEPT {
130+
size_t memory_active() const NOEXCEPT {
131+
return byte_writer_.pool_offset()
132+
+ int_writer_.pool_offset() * sizeof(int_block_pool::value_type)
133+
+ fields_.size() * sizeof(fields_map::value_type);
134+
}
135+
136+
//////////////////////////////////////////////////////////////////////////////
137+
/// @return approximate amount of memory reserved by this instance
138+
//////////////////////////////////////////////////////////////////////////////
139+
size_t memory_reserved() const NOEXCEPT {
131140
return sizeof(fields_data) + byte_pool_.size() + int_pool_.size();
132141
}
133142

@@ -153,4 +162,4 @@ class IRESEARCH_API fields_data: util::noncopyable {
153162

154163
NS_END
155164

156-
#endif
165+
#endif

0 commit comments

Comments
 (0)
0