![]() |
Storage Engine API
|
#include "mongo/platform/basic.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <memory>
#include <random>
#include <typeinfo>
#include <vector>
#include "mongo/base/owned_pointer_vector.h"
#include "mongo/base/simple_string_data_comparator.h"
#include "mongo/bson/bsonobj_comparator.h"
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/config.h"
#include "mongo/db/storage/key_string.h"
#include "mongo/platform/decimal128.h"
#include "mongo/stdx/functional.h"
#include "mongo/stdx/future.h"
#include "mongo/stdx/memory.h"
#include "mongo/unittest/death_test.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/hex.h"
#include "mongo/util/log.h"
#include "mongo/util/timer.h"
Classes | |
class | KeyStringTest |
Macros | |
#define | MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage |
Copyright (C) 2014 MongoDB Inc. More... | |
#define | ROUNDTRIP_ORDER(version, x, order) |
#define | ROUNDTRIP(version, x) |
#define | COMPARES_SAME(_v, _x, _y) |
#define | COMPARE_HELPER(LHS, RHS) (((LHS) < (RHS)) ? -1 : (((LHS) == (RHS)) ? 0 : 1)) |
Functions | |
BSONObj | toBson (const KeyString &ks, Ordering ord) |
BSONObj | toBsonAndCheckKeySize (const KeyString &ks, Ordering ord) |
TEST_F (KeyStringTest, Simple1) | |
TEST_F (KeyStringTest, ActualBytesDouble) | |
TEST_F (KeyStringTest, AllTypesSimple) | |
TEST_F (KeyStringTest, Array1) | |
TEST_F (KeyStringTest, SubDoc1) | |
TEST_F (KeyStringTest, SubDoc2) | |
TEST_F (KeyStringTest, Compound1) | |
TEST_F (KeyStringTest, Undef1) | |
TEST_F (KeyStringTest, NumberLong0) | |
TEST_F (KeyStringTest, NumbersNearInt32Max) | |
TEST_F (KeyStringTest, DecimalNumbers) | |
TEST_F (KeyStringTest, LotsOfNumbers1) | |
TEST_F (KeyStringTest, LotsOfNumbers2) | |
TEST_F (KeyStringTest, LotsOfNumbers3) | |
TEST_F (KeyStringTest, RecordIdOrder1) | |
TEST_F (KeyStringTest, RecordIdOrder2) | |
TEST_F (KeyStringTest, RecordIdOrder2Double) | |
TEST_F (KeyStringTest, Timestamp) | |
TEST_F (KeyStringTest, AllTypesRoundtrip) | |
const std::vector< BSONObj > & | getInterestingElements (KeyString::Version version) |
void | testPermutation (KeyString::Version version, const std::vector< BSONObj > &elementsOrig, const std::vector< BSONObj > &orderings, bool debug) |
TEST_F (KeyStringTest, AllPermCompare) | |
TEST_F (KeyStringTest, AllPerm2Compare) | |
int | compareLongToDouble (long long lhs, double rhs) |
int | compareNumbers (const BSONElement &lhs, const BSONElement &rhs) |
TEST_F (KeyStringTest, NaNs) | |
TEST_F (KeyStringTest, NumberOrderLots) | |
TEST_F (KeyStringTest, RecordIds) | |
TEST_F (KeyStringTest, KeyWithTooManyTypeBitsCausesUassert) | |
TEST_F (KeyStringTest, ToBsonSafeShouldNotTerminate) | |
TEST_F (KeyStringTest, InvalidDecimalExponent) | |
TEST_F (KeyStringTest, InvalidDecimalZero) | |
TEST_F (KeyStringTest, InvalidDecimalContinuation) | |
TEST_F (KeyStringTest, RandomizedInputsForToBsonSafe) | |
TEST_F (KeyStringTest, CommonIntPerf) | |
TEST_F (KeyStringTest, UniformInt64Perf) | |
TEST_F (KeyStringTest, CommonDoublePerf) | |
TEST_F (KeyStringTest, UniformDoublePerf) | |
TEST_F (KeyStringTest, CommonDecimalPerf) | |
TEST_F (KeyStringTest, UniformDecimalPerf) | |
TEST_F (KeyStringTest, DecimalFromUniformDoublePerf) | |
DEATH_TEST (KeyStringTest, ToBsonPromotesAssertionsToTerminate, "terminate() called") | |
Variables | |
Ordering | ALL_ASCENDING = Ordering::make(BSONObj()) |
Ordering | ONE_ASCENDING = Ordering::make(BSON("a" << 1)) |
Ordering | ONE_DESCENDING = Ordering::make(BSON("a" << -1)) |
#define COMPARE_HELPER | ( | LHS, | |
RHS | |||
) | (((LHS) < (RHS)) ? -1 : (((LHS) == (RHS)) ? 0 : 1)) |
#define COMPARES_SAME | ( | _v, | |
_x, | |||
_y | |||
) |
#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kStorage |
Copyright (C) 2014 MongoDB Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.
As a special exception, the copyright holders give permission to link the code of portions of this program with the OpenSSL library under certain conditions as described in each individual source file and distribute linked combinations including the program with the OpenSSL library. You must comply with the GNU Affero General Public License in all respects for all of the code used other than as permitted herein. If you modify file(s) with this exception, you may extend this exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. If you delete this exception statement from all source files in the program, then also delete it in the license file.
#define ROUNDTRIP | ( | version, | |
x | |||
) |
#define ROUNDTRIP_ORDER | ( | version, | |
x, | |||
order | |||
) |
int compareLongToDouble | ( | long long | lhs, |
double | rhs | ||
) |
int compareNumbers | ( | const BSONElement & | lhs, |
const BSONElement & | rhs | ||
) |
DEATH_TEST | ( | KeyStringTest | , |
ToBsonPromotesAssertionsToTerminate | , | ||
"terminate() called" | |||
) |
const std::vector<BSONObj>& getInterestingElements | ( | KeyString::Version | version | ) |
TEST_F | ( | KeyStringTest | , |
Simple1 | |||
) |
TEST_F | ( | KeyStringTest | , |
ActualBytesDouble | |||
) |
TEST_F | ( | KeyStringTest | , |
AllTypesSimple | |||
) |
TEST_F | ( | KeyStringTest | , |
Array1 | |||
) |
TEST_F | ( | KeyStringTest | , |
SubDoc1 | |||
) |
TEST_F | ( | KeyStringTest | , |
SubDoc2 | |||
) |
TEST_F | ( | KeyStringTest | , |
Compound1 | |||
) |
TEST_F | ( | KeyStringTest | , |
Undef1 | |||
) |
TEST_F | ( | KeyStringTest | , |
NumberLong0 | |||
) |
TEST_F | ( | KeyStringTest | , |
NumbersNearInt32Max | |||
) |
TEST_F | ( | KeyStringTest | , |
DecimalNumbers | |||
) |
TEST_F | ( | KeyStringTest | , |
LotsOfNumbers1 | |||
) |
TEST_F | ( | KeyStringTest | , |
LotsOfNumbers2 | |||
) |
TEST_F | ( | KeyStringTest | , |
LotsOfNumbers3 | |||
) |
TEST_F | ( | KeyStringTest | , |
RecordIdOrder1 | |||
) |
TEST_F | ( | KeyStringTest | , |
RecordIdOrder2 | |||
) |
TEST_F | ( | KeyStringTest | , |
RecordIdOrder2Double | |||
) |
TEST_F | ( | KeyStringTest | , |
Timestamp | |||
) |
TEST_F | ( | KeyStringTest | , |
AllTypesRoundtrip | |||
) |
TEST_F | ( | KeyStringTest | , |
AllPermCompare | |||
) |
TEST_F | ( | KeyStringTest | , |
AllPerm2Compare | |||
) |
TEST_F | ( | KeyStringTest | , |
NaNs | |||
) |
TEST_F | ( | KeyStringTest | , |
NumberOrderLots | |||
) |
TEST_F | ( | KeyStringTest | , |
RecordIds | |||
) |
TEST_F | ( | KeyStringTest | , |
KeyWithTooManyTypeBitsCausesUassert | |||
) |
TEST_F | ( | KeyStringTest | , |
ToBsonSafeShouldNotTerminate | |||
) |
TEST_F | ( | KeyStringTest | , |
InvalidDecimalExponent | |||
) |
TEST_F | ( | KeyStringTest | , |
InvalidDecimalZero | |||
) |
TEST_F | ( | KeyStringTest | , |
InvalidDecimalContinuation | |||
) |
TEST_F | ( | KeyStringTest | , |
RandomizedInputsForToBsonSafe | |||
) |
TEST_F | ( | KeyStringTest | , |
CommonIntPerf | |||
) |
TEST_F | ( | KeyStringTest | , |
UniformInt64Perf | |||
) |
TEST_F | ( | KeyStringTest | , |
CommonDoublePerf | |||
) |
TEST_F | ( | KeyStringTest | , |
UniformDoublePerf | |||
) |
TEST_F | ( | KeyStringTest | , |
CommonDecimalPerf | |||
) |
TEST_F | ( | KeyStringTest | , |
UniformDecimalPerf | |||
) |
TEST_F | ( | KeyStringTest | , |
DecimalFromUniformDoublePerf | |||
) |
void testPermutation | ( | KeyString::Version | version, |
const std::vector< BSONObj > & | elementsOrig, | ||
const std::vector< BSONObj > & | orderings, | ||
bool | debug | ||
) |
BSONObj toBson | ( | const KeyString & | ks, |
Ordering | ord | ||
) |
BSONObj toBsonAndCheckKeySize | ( | const KeyString & | ks, |
Ordering | ord | ||
) |
Ordering ALL_ASCENDING = Ordering::make(BSONObj()) |
Ordering ONE_ASCENDING = Ordering::make(BSON("a" << 1)) |
Ordering ONE_DESCENDING = Ordering::make(BSON("a" << -1)) |