summaryrefslogtreecommitdiff
path: root/src/mongo/db/sorter
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-05-28 17:55:12 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-05-28 17:55:12 -0400
commit6dcdd23dd37ef12c87e71cf59ef01cd82432efe0 (patch)
treec8cfb5acb62c80f375bc37e7d4350382deea6a37 /src/mongo/db/sorter
parentd4ac5673ea3f6cef4ce9dbcec90e31813997a528 (diff)
downloadmongo-6dcdd23dd37ef12c87e71cf59ef01cd82432efe0.tar.gz
SERVER-23971 Clang-Format code
Diffstat (limited to 'src/mongo/db/sorter')
-rw-r--r--src/mongo/db/sorter/sorter.cpp34
-rw-r--r--src/mongo/db/sorter/sorter.h6
-rw-r--r--src/mongo/db/sorter/sorter_test.cpp6
3 files changed, 26 insertions, 20 deletions
diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp
index fda8ee146ed..7f6e8866562 100644
--- a/src/mongo/db/sorter/sorter.cpp
+++ b/src/mongo/db/sorter/sorter.cpp
@@ -146,8 +146,7 @@ public:
/// Any number of values
template <typename Container>
- InMemIterator(const Container& input)
- : _data(input.begin(), input.end()) {}
+ InMemIterator(const Container& input) : _data(input.begin(), input.end()) {}
bool more() {
return !_data.empty();
@@ -167,7 +166,8 @@ template <typename Key, typename Value>
class FileIterator : public SortIteratorInterface<Key, Value> {
public:
typedef std::pair<typename Key::SorterDeserializeSettings,
- typename Value::SorterDeserializeSettings> Settings;
+ typename Value::SorterDeserializeSettings>
+ Settings;
typedef std::pair<Key, Value> Data;
FileIterator(const std::string& fileName,
@@ -179,8 +179,8 @@ public:
_fileDeleter(fileDeleter),
_file(_fileName.c_str(), std::ios::in | std::ios::binary) {
massert(16814,
- str::stream() << "error opening file \"" << _fileName
- << "\": " << myErrnoWithDescription(),
+ str::stream() << "error opening file \"" << _fileName << "\": "
+ << myErrnoWithDescription(),
_file.good());
massert(16815,
@@ -274,8 +274,8 @@ private:
}
msgasserted(16817,
- str::stream() << "error reading file \"" << _fileName
- << "\": " << myErrnoWithDescription());
+ str::stream() << "error reading file \"" << _fileName << "\": "
+ << myErrnoWithDescription());
}
verify(_file.gcount() == static_cast<std::streamsize>(size));
}
@@ -419,7 +419,8 @@ public:
typedef std::pair<Key, Value> Data;
typedef SortIteratorInterface<Key, Value> Iterator;
typedef std::pair<typename Key::SorterDeserializeSettings,
- typename Value::SorterDeserializeSettings> Settings;
+ typename Value::SorterDeserializeSettings>
+ Settings;
NoLimitSorter(const SortOptions& opts,
const Comparator& comp,
@@ -489,7 +490,8 @@ private:
// need to be revisited.
uasserted(16819,
str::stream()
- << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes
+ << "Sort exceeded memory limit of "
+ << _opts.maxMemoryUsageBytes
<< " bytes, but did not opt in to external sorting. Aborting operation."
<< " Pass allowDiskUse:true to opt in.");
}
@@ -569,7 +571,8 @@ public:
typedef std::pair<Key, Value> Data;
typedef SortIteratorInterface<Key, Value> Iterator;
typedef std::pair<typename Key::SorterDeserializeSettings,
- typename Value::SorterDeserializeSettings> Settings;
+ typename Value::SorterDeserializeSettings>
+ Settings;
TopKSorter(const SortOptions& opts,
const Comparator& comp,
@@ -765,7 +768,8 @@ private:
// need to be revisited.
uasserted(16820,
str::stream()
- << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes
+ << "Sort exceeded memory limit of "
+ << _opts.maxMemoryUsageBytes
<< " bytes, but did not opt in to external sorting. Aborting operation."
<< " Pass allowDiskUse:true to opt in.");
}
@@ -840,8 +844,8 @@ SortedFileWriter<Key, Value>::SortedFileWriter(const SortOptions& opts, const Se
_file.open(_fileName.c_str(), std::ios::binary | std::ios::out);
massert(16818,
- str::stream() << "error opening file \"" << _fileName
- << "\": " << sorter::myErrnoWithDescription(),
+ str::stream() << "error opening file \"" << _fileName << "\": "
+ << sorter::myErrnoWithDescription(),
_file.good());
_fileDeleter = std::make_shared<sorter::FileDeleter>(_fileName);
@@ -905,8 +909,8 @@ void SortedFileWriter<Key, Value>::spill() {
} catch (const std::exception&) {
msgasserted(16821,
- str::stream() << "error writing to file \"" << _fileName
- << "\": " << sorter::myErrnoWithDescription());
+ str::stream() << "error writing to file \"" << _fileName << "\": "
+ << sorter::myErrnoWithDescription());
}
_buffer.reset();
diff --git a/src/mongo/db/sorter/sorter.h b/src/mongo/db/sorter/sorter.h
index ba6f3e3192f..54f19dd0197 100644
--- a/src/mongo/db/sorter/sorter.h
+++ b/src/mongo/db/sorter/sorter.h
@@ -159,7 +159,8 @@ public:
typedef std::pair<Key, Value> Data;
typedef SortIteratorInterface<Key, Value> Iterator;
typedef std::pair<typename Key::SorterDeserializeSettings,
- typename Value::SorterDeserializeSettings> Settings;
+ typename Value::SorterDeserializeSettings>
+ Settings;
template <typename Comparator>
static Sorter* make(const SortOptions& opts,
@@ -187,7 +188,8 @@ class SortedFileWriter {
public:
typedef SortIteratorInterface<Key, Value> Iterator;
typedef std::pair<typename Key::SorterDeserializeSettings,
- typename Value::SorterDeserializeSettings> Settings;
+ typename Value::SorterDeserializeSettings>
+ Settings;
explicit SortedFileWriter(const SortOptions& opts, const Settings& settings = Settings());
diff --git a/src/mongo/db/sorter/sorter_test.cpp b/src/mongo/db/sorter/sorter_test.cpp
index c0a90a5fc1d..37bf118fe98 100644
--- a/src/mongo/db/sorter/sorter_test.cpp
+++ b/src/mongo/db/sorter/sorter_test.cpp
@@ -32,9 +32,9 @@
#include <boost/filesystem.hpp>
-#include "mongo/config.h"
#include "mongo/base/data_type_endian.h"
#include "mongo/base/init.h"
+#include "mongo/config.h"
#include "mongo/db/service_context.h"
#include "mongo/db/service_context_noop.h"
#include "mongo/stdx/memory.h"
@@ -192,7 +192,7 @@ void _assertIteratorsEquivalent(It1 it1, It2 it2, int line) {
#define ASSERT_ITERATORS_EQUIVALENT(it1, it2) _assertIteratorsEquivalent(it1, it2, __LINE__)
template <int N>
-std::shared_ptr<IWIterator> makeInMemIterator(const int(&array)[N]) {
+std::shared_ptr<IWIterator> makeInMemIterator(const int (&array)[N]) {
std::vector<IWPair> vec;
for (int i = 0; i < N; i++)
vec.push_back(IWPair(array[i], -array[i]));
@@ -200,7 +200,7 @@ std::shared_ptr<IWIterator> makeInMemIterator(const int(&array)[N]) {
}
template <typename IteratorPtr, int N>
-std::shared_ptr<IWIterator> mergeIterators(IteratorPtr(&array)[N],
+std::shared_ptr<IWIterator> mergeIterators(IteratorPtr (&array)[N],
Direction Dir = ASC,
const SortOptions& opts = SortOptions()) {
std::vector<std::shared_ptr<IWIterator>> vec;