Revision 47863
Added by Claudio Atzori almost 7 years ago
MDStoreTransactionManagerImpl.java | ||
---|---|---|
15 | 15 |
import com.mongodb.client.MongoDatabase; |
16 | 16 |
import com.mongodb.client.MongoIterable; |
17 | 17 |
import com.mongodb.client.model.Filters; |
18 |
import com.mongodb.client.model.IndexOptions; |
|
18 | 19 |
import com.mongodb.client.model.UpdateOptions; |
19 | 20 |
import eu.dnetlib.data.mdstore.MDStoreServiceException; |
20 | 21 |
import eu.dnetlib.data.mdstore.modular.connector.*; |
... | ... | |
56 | 57 |
/** The expired days. */ |
57 | 58 |
private int expiredDays; |
58 | 59 |
|
60 |
private final IndexOptions options = new IndexOptions().background(true); |
|
61 |
|
|
59 | 62 |
/** |
60 | 63 |
* Bootstrap manager. |
61 | 64 |
*/ |
... | ... | |
82 | 85 |
final BasicDBObject ensureIndex = new BasicDBObject(); |
83 | 86 |
ensureIndex.put("mdId", 1); |
84 | 87 |
log.debug("Create index in MetadaManager "); |
85 |
this.getManagerTable().createIndex(ensureIndex); |
|
88 |
this.getManagerTable().createIndex(ensureIndex, options);
|
|
86 | 89 |
} |
87 | 90 |
|
88 | 91 |
/** |
... | ... | |
659 | 662 |
private void updateIncremental(final String transactionId, final String currentId) { |
660 | 663 |
final MongoCollection<DBObject> transaction = db.getCollection(transactionId, DBObject.class); |
661 | 664 |
final MongoCollection<DBObject> mdstore = db.getCollection(currentId, DBObject.class); |
662 |
final FindIterable<DBObject> it = transaction.find(); |
|
663 |
for (DBObject currentObj : it){ |
|
665 |
final FindIterable<DBObject> it = transaction.find().noCursorTimeout(true);
|
|
666 |
for (DBObject currentObj : it) {
|
|
664 | 667 |
|
665 | 668 |
BasicDBObject newObj = new BasicDBObject(); |
666 | 669 |
|
Also available in: Unified diff
integrated latest changes from dnet40