diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:20:35 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-27 11:02:23 -0400 |
commit | 134a4083953270e8a11430395357fb70a29047ad (patch) | |
tree | dd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /src/mongo/db/views | |
parent | 1e46b5049003f427047e723ea5fab15b5a9253ca (diff) | |
download | mongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz |
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'src/mongo/db/views')
-rw-r--r-- | src/mongo/db/views/durable_view_catalog.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/views/resolved_view_test.cpp | 27 | ||||
-rw-r--r-- | src/mongo/db/views/view_catalog.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/views/view_catalog_test.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/views/view_graph.cpp | 6 |
5 files changed, 16 insertions, 27 deletions
diff --git a/src/mongo/db/views/durable_view_catalog.cpp b/src/mongo/db/views/durable_view_catalog.cpp index 193f7a6f432..3d969308c9a 100644 --- a/src/mongo/db/views/durable_view_catalog.cpp +++ b/src/mongo/db/views/durable_view_catalog.cpp @@ -170,9 +170,7 @@ BSONObj DurableViewCatalogImpl::_validateViewDefinition(OperationContext* opCtx, uassert(ErrorCodes::InvalidViewDefinition, str::stream() << "found invalid view definition " << viewDefinition["_id"] - << " while reading '" - << _db->getSystemViewsName() - << "'", + << " while reading '" << _db->getSystemViewsName() << "'", valid); return viewDefinition; diff --git a/src/mongo/db/views/resolved_view_test.cpp b/src/mongo/db/views/resolved_view_test.cpp index b15ccab582d..a4b5111419a 100644 --- a/src/mongo/db/views/resolved_view_test.cpp +++ b/src/mongo/db/views/resolved_view_test.cpp @@ -57,9 +57,8 @@ TEST(ResolvedViewTest, ExpandingAggRequestWithEmptyPipelineOnNoOpViewYieldsEmpty AggregationRequest requestOnView{viewNss, emptyPipeline}; auto result = resolvedView.asExpandedViewAggregation(requestOnView); - BSONObj expected = - BSON("aggregate" << backingNss.coll() << "pipeline" << BSONArray() << "cursor" - << kDefaultCursorOptionDocument); + BSONObj expected = BSON("aggregate" << backingNss.coll() << "pipeline" << BSONArray() + << "cursor" << kDefaultCursorOptionDocument); ASSERT_BSONOBJ_EQ(result.serializeToCommandObj().toBson(), expected); } @@ -72,8 +71,7 @@ TEST(ResolvedViewTest, ExpandingAggRequestWithNonemptyPipelineAppendsToViewPipel BSONObj expected = BSON("aggregate" << backingNss.coll() << "pipeline" << BSON_ARRAY(BSON("skip" << 7) << BSON("limit" << 3)) - << "cursor" - << kDefaultCursorOptionDocument); + << "cursor" << kDefaultCursorOptionDocument); ASSERT_BSONOBJ_EQ(result.serializeToCommandObj().toBson(), expected); } @@ -216,9 +214,8 @@ TEST(ResolvedViewTest, FromBSONFailsOnInvalidPipelineType) { } TEST(ResolvedViewTest, FromBSONFailsOnInvalidCollationType) { - BSONObj badCmdResponse = - BSON("resolvedView" << BSON( - "ns" << backingNss.ns() << "pipeline" << BSONArray() << "collation" << 1)); + BSONObj badCmdResponse = BSON("resolvedView" << BSON("ns" << backingNss.ns() << "pipeline" + << BSONArray() << "collation" << 1)); ASSERT_THROWS_CODE(ResolvedView::fromBSON(badCmdResponse), AssertionException, 40639); } @@ -234,10 +231,10 @@ TEST(ResolvedViewTest, FromBSONSuccessfullyParsesEmptyBSONArrayIntoEmptyVector) } TEST(ResolvedViewTest, FromBSONSuccessfullyParsesCollation) { - BSONObj cmdResponse = BSON( - "resolvedView" << BSON("ns" << backingNss.ns() << "pipeline" << BSONArray() << "collation" - << BSON("locale" - << "fil"))); + BSONObj cmdResponse = BSON("resolvedView" << BSON("ns" << backingNss.ns() << "pipeline" + << BSONArray() << "collation" + << BSON("locale" + << "fil"))); const ResolvedView result = ResolvedView::fromBSON(cmdResponse); ASSERT_EQ(result.getNamespace(), backingNss); ASSERT(std::equal(emptyPipeline.begin(), @@ -257,8 +254,7 @@ TEST(ResolvedViewTest, FromBSONSuccessfullyParsesPopulatedBSONArrayIntoVector) { BSONArray pipeline = BSON_ARRAY(matchStage << sortStage << limitStage); BSONObj cmdResponse = BSON("resolvedView" << BSON("ns" << "testdb.testcoll" - << "pipeline" - << pipeline)); + << "pipeline" << pipeline)); const ResolvedView result = ResolvedView::fromBSON(cmdResponse); ASSERT_EQ(result.getNamespace(), backingNss); @@ -274,8 +270,7 @@ TEST(ResolvedViewTest, IsResolvedViewErrorResponseDetectsKickbackErrorCodeSucces BSONObj errorResponse = BSON("ok" << 0 << "code" << ErrorCodes::CommandOnShardedViewNotSupportedOnMongod << "errmsg" << "This view is sharded and cannot be run on mongod" - << "resolvedView" - << BSON("ns" << backingNss.ns() << "pipeline" << BSONArray())); + << "resolvedView" << BSON("ns" << backingNss.ns() << "pipeline" << BSONArray())); auto status = getStatusFromCommandResult(errorResponse); ASSERT_EQ(status, ErrorCodes::CommandOnShardedViewNotSupportedOnMongod); ASSERT(status.extraInfo<ResolvedView>()); diff --git a/src/mongo/db/views/view_catalog.cpp b/src/mongo/db/views/view_catalog.cpp index 237a9495cf2..6019a012b1a 100644 --- a/src/mongo/db/views/view_catalog.cpp +++ b/src/mongo/db/views/view_catalog.cpp @@ -115,8 +115,7 @@ Status ViewCatalog::_reload(WithLock, return Status(ErrorCodes::InvalidViewDefinition, str::stream() << "View 'pipeline' entries must be objects, but " << viewName.toString() - << " has a pipeline element of type " - << stage.type()); + << " has a pipeline element of type " << stage.type()); } } diff --git a/src/mongo/db/views/view_catalog_test.cpp b/src/mongo/db/views/view_catalog_test.cpp index 87aa9340ba8..7eaab9fc6c7 100644 --- a/src/mongo/db/views/view_catalog_test.cpp +++ b/src/mongo/db/views/view_catalog_test.cpp @@ -256,8 +256,7 @@ TEST_F(ViewCatalogFixture, CanCreateViewWithLookupUsingPipelineSyntax) { << "fcoll" << "as" << "as" - << "pipeline" - << BSONArray()))), + << "pipeline" << BSONArray()))), emptyCollation)); } diff --git a/src/mongo/db/views/view_graph.cpp b/src/mongo/db/views/view_graph.cpp index 7ecc1544e31..def5d50154d 100644 --- a/src/mongo/db/views/view_graph.cpp +++ b/src/mongo/db/views/view_graph.cpp @@ -110,8 +110,7 @@ Status ViewGraph::insertAndValidate(const ViewDefinition& view, return {ErrorCodes::ViewPipelineMaxSizeExceeded, str::stream() << "Operation would result in a resolved view pipeline that exceeds " "the maximum size of " - << kMaxViewPipelineSizeBytes - << " bytes"}; + << kMaxViewPipelineSizeBytes << " bytes"}; } guard.dismiss(); @@ -217,8 +216,7 @@ Status ViewGraph::_validateParents(uint64_t currentId, int currentDepth, StatsMa if (size > kMaxViewPipelineSizeBytes) { return {ErrorCodes::ViewPipelineMaxSizeExceeded, str::stream() << "View pipeline is too large and exceeds the maximum size of " - << ViewGraph::kMaxViewPipelineSizeBytes - << " bytes"}; + << ViewGraph::kMaxViewPipelineSizeBytes << " bytes"}; } return Status::OK(); |