Merge remote-tracking branch 'origin/jetty-9.2.x' into jetty-9.3.x

This commit is contained in:
Jan Bartel 2016-06-15 13:14:39 +10:00
commit 7f58701b53
1 changed files with 17 additions and 6 deletions

View File

@ -183,12 +183,23 @@ public class MongoSessionIdManager extends AbstractSessionIdManager
_server = server;
_sessions = sessions;
_sessions.ensureIndex(
BasicDBObjectBuilder.start().add("id",1).get(),
BasicDBObjectBuilder.start().add("unique",true).add("sparse",false).get());
_sessions.ensureIndex(
BasicDBObjectBuilder.start().add("id",1).add("version",1).get(),
BasicDBObjectBuilder.start().add("unique",true).add("sparse",false).get());
DBObject idKey = BasicDBObjectBuilder.start().add("id", 1).get();
_sessions.createIndex(idKey,
BasicDBObjectBuilder.start()
.add("name", "id_1")
.add("ns", _sessions.getFullName())
.add("sparse", false)
.add("unique", true)
.get());
DBObject versionKey = BasicDBObjectBuilder.start().add("id", 1).add("version", 1).get();
_sessions.createIndex(versionKey, BasicDBObjectBuilder.start()
.add("name", "id_1_version_1")
.add("ns", _sessions.getFullName())
.add("sparse", false)
.add("unique", true)
.get());
// index our accessed and valid fields so that purges are faster, note that the "valid" field is first
// so that we can take advantage of index prefixes