Skip to content

Commit 57d3450

Browse files
committed
Backport: ensure indexes and caps at startup only
1 parent c1490a8 commit 57d3450

File tree

65 files changed

+256
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+256
-132
lines changed

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ cache:
1010
directories:
1111
- "$HOME/.m2/repository"
1212

13+
before_install:
14+
- gpg --fast-import gpg.asc
15+
1316
install:
14-
- echo "<settings><servers><server><id>bintray</id><username>\${env.BINTRAY_USER}</username><password>\${env.BINTRAY_KEY}</password></server></servers></settings>" > ~/.m2/settings.xml
17+
- echo "<settings><servers><server><id>ossrh</id><username>\${env.SONATYPE_USER}</username><password>\${env.SONATYPE_PASSWORD}</password></server></servers></settings>" > ~/.m2/settings.xml
1518
- if [[ $TRAVIS_PULL_REQUEST = false ]] && [[ $TRAVIS_BRANCH = master || $TRAVIS_BRANCH = dev-* ]] || [[ $TRAVIS_TAG = v* ]]; then GOAL=deploy; else GOAL=install; fi
16-
- if [[ $TRAVIS_TAG = v* ]]; then ADDITIONAL_PROFILES=release; mvn -q -U org.seedstack:seedstack-maven-plugin:release; else ADDITIONAL_PROFILES=snapshots; fi
19+
- if [[ $TRAVIS_TAG = v* ]]; then ADDITIONAL_PROFILES=release; mvn -q -U org.seedstack:seedstack-maven-plugin:release; fi
1720

18-
script: mvn -U -Pbuild-number,compatibility,bintray,quality,javadoc,$ADDITIONAL_PROFILES $GOAL jacoco:report
21+
script: mvn -U -Pbuild-number,compatibility,javadoc,quality,$ADDITIONAL_PROFILES $GOAL
1922

2023
after_success: mvn -q coveralls:report -DrepoToken=$COVERALLS_TOKEN

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Version 3.0.3 (2021-07-02)
2+
3+
* [fix] Avoid calling `ensureIndexes()` and `ensureCaps()` for each datastore instantiation which adds a considerable
4+
overhead in some circumstances. It is now done at application startup and can be controlled with
5+
`mongoDb.morphia.ensureCapsAtStartup` and `mongoDb.morphia.ensureIndexesAtStartup` config options.
6+
17
# Version 3.0.2 (2019-01-10)
28

39
* [fix] Fix issue #11: an exception occurred at startup because the way of accessing the ValidationFactory changed.

checkstyle.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<!--
33
4-
Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
4+
Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
55
66
This Source Code Form is subject to the terms of the Mozilla Public
77
License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -23,6 +23,11 @@
2323
<property name="eachLine" value="true"/>
2424
</module>
2525

26+
<module name="LineLength">
27+
<property name="max" value="120"/>
28+
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
29+
</module>
30+
2631
<module name="TreeWalker">
2732
<module name="OuterTypeFilename"/>
2833
<module name="IllegalTokenText">
@@ -37,10 +42,6 @@
3742
<property name="allowByTailComment" value="true"/>
3843
<property name="allowNonPrintableEscapes" value="true"/>
3944
</module>
40-
<module name="LineLength">
41-
<property name="max" value="120"/>
42-
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
43-
</module>
4445
<module name="AvoidStarImport"/>
4546
<module name="OneTopLevelClass"/>
4647
<module name="NoLineWrap"/>
@@ -205,24 +206,22 @@
205206
</module>
206207
<module name="NonEmptyAtclauseDescription"/>
207208
<module name="JavadocTagContinuationIndentation"/>
208-
<!--<module name="SummaryJavadoc">-->
209-
<!--<property name="forbiddenSummaryFragments"-->
210-
<!--value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>-->
211-
<!--</module>-->
209+
<module name="SummaryJavadoc">
210+
<property name="forbiddenSummaryFragments"
211+
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
212+
</module>
212213
<module name="JavadocParagraph"/>
213214
<module name="AtclauseOrder">
214215
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
215216
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
216217
</module>
217-
<module name="JavadocMethod">
218-
<property name="scope" value="public"/>
219-
<property name="allowMissingParamTags" value="true"/>
220-
<property name="allowMissingThrowsTags" value="true"/>
221-
<property name="allowMissingReturnTag" value="true"/>
218+
<module name="MissingJavadocMethodCheck">
222219
<property name="allowMissingPropertyJavadoc" value="true"/>
223220
<property name="minLineCount" value="2"/>
221+
</module>
222+
<module name="JavadocMethod">
223+
<property name="scope" value="public"/>
224224
<property name="allowedAnnotations" value="Override, Test"/>
225-
<property name="allowThrowsTagsForSubclasses" value="true"/>
226225
</module>
227226
<module name="MethodName">
228227
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>

core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
3-
Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
3+
Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
44
55
This Source Code Form is subject to the terms of the Mozilla Public
66
License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -14,7 +14,7 @@
1414
<parent>
1515
<groupId>org.seedstack.addons.mongodb</groupId>
1616
<artifactId>mongodb</artifactId>
17-
<version>3.0.2-SNAPSHOT</version>
17+
<version>3.0.3-SNAPSHOT</version>
1818
</parent>
1919

2020
<artifactId>mongodb-core</artifactId>

core/src/main/java/org/seedstack/mongodb/MongoDbConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
2+
* Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
33
*
44
* This Source Code Form is subject to the terms of the Mozilla Public
55
* License, v. 2.0. If a copy of the MPL was not distributed with this

core/src/main/java/org/seedstack/mongodb/internal/AbstractMongoDbManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
2+
* Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
33
*
44
* This Source Code Form is subject to the terms of the Mozilla Public
55
* License, v. 2.0. If a copy of the MPL was not distributed with this

core/src/main/java/org/seedstack/mongodb/internal/AsyncMongoDbManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
2+
* Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
33
*
44
* This Source Code Form is subject to the terms of the Mozilla Public
55
* License, v. 2.0. If a copy of the MPL was not distributed with this

core/src/main/java/org/seedstack/mongodb/internal/MongoDbErrorCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
2+
* Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
33
*
44
* This Source Code Form is subject to the terms of the Mozilla Public
55
* License, v. 2.0. If a copy of the MPL was not distributed with this

core/src/main/java/org/seedstack/mongodb/internal/MongoDbManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
2+
* Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
33
*
44
* This Source Code Form is subject to the terms of the Mozilla Public
55
* License, v. 2.0. If a copy of the MPL was not distributed with this

core/src/main/java/org/seedstack/mongodb/internal/MongoDbModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright © 2013-2019, The SeedStack authors <http://seedstack.org>
2+
* Copyright © 2013-2021, The SeedStack authors <http://seedstack.org>
33
*
44
* This Source Code Form is subject to the terms of the Mozilla Public
55
* License, v. 2.0. If a copy of the MPL was not distributed with this

0 commit comments

Comments
 (0)