Class MongoDBRepository
java.lang.Object
org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
org.nuxeo.ecm.core.storage.mongodb.MongoDBRepository
- All Implemented Interfaces:
LockManager
,Repository
,DBSRepository
MongoDB implementation of a
Repository
.- Since:
- 5.9.4
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
DBSRepositoryBase.BlobFinder, DBSRepositoryBase.IdType
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.bson.conversions.Bson
Keys used for document projection when marking all binaries for GC.protected final com.mongodb.client.MongoCollection<org.bson.Document>
protected final MongoDBConverter
static final String
static final String
protected final com.mongodb.client.MongoCollection<org.bson.Document>
protected final MongoDBCursorService
protected final MongoDBRepositoryDescriptor
static final String
protected static final String
protected String
The key to use to store the id in the database.protected boolean
static final String
static final Long
protected static final Duration
Default maximum execution time for a query.protected final long
Maximum execution time for a query when outside of a transaction.protected final com.mongodb.client.MongoClient
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final Double
static final String
Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService
.protected static final int
protected long
Sequence allocation block size.protected static final String
Settings key to determine whetherecm:blobKeys
is supported.protected static final String
protected final com.mongodb.client.MongoCollection<org.bson.Document>
protected boolean
protected final boolean
protected final boolean
static final Double
Fields inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
blobKeysPaths, blobManager, capabilities, changeTokenEnabled, DEBUG_UUIDS, DISABLE_ECM_BLOB_KEYS, fulltextConfiguration, idType, lockManager, repositoryName, selfRegisteredLockManager, TYPE_ROOT, UUID_ZERO, UUID_ZERO_DEBUG
Fields inherited from interface org.nuxeo.ecm.core.model.Repository
CAPABILITY_QUERY_BLOB_KEYS, CAPABILITY_REPOSITORY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the allowed id types for this DBS repository.protected com.mongodb.client.MongoClient
protected com.mongodb.client.MongoCollection<org.bson.Document>
Gets a new connection to this repository.protected MongoDBConverter
protected com.mongodb.client.MongoCollection<org.bson.Document>
protected MongoDBCursorService
protected String
getIdKey()
protected void
protected void
protected void
protected void
protected void
markReferencedBlob
(Object value, BiConsumer<String, String> markerCallback) void
markReferencedBlobs
(BiConsumer<String, String> markerCallback) Marks the blobs in use by passing them to the provided callback (taking the blob key and the repository name).protected void
markReferencedBlobs
(org.bson.Document ob, BiConsumer<String, String> markerCallback) protected void
markReferencedBlobsDenormalized
(org.bson.Document ob, BiConsumer<String, String> markReferencedBlob) protected void
void
shutdown()
protected boolean
boolean
Checks whether this repository supports transactions.void
Update repository capabilities after a migration.Methods inherited from class org.nuxeo.ecm.core.storage.dbs.DBSRepositoryBase
getBlobKeysPaths, getBlobManager, getCapability, getFulltextConfiguration, getIdType, getLock, getLockManager, getLockManagerName, getName, getSession, initLockManager, isChangeTokenEnabled, isFulltextDisabled, isFulltextSearchDisabled, isFulltextStoredInBlob, removeLock, setLock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.core.api.lock.LockManager
clearLockManagerCaches, closeLockManager
Methods inherited from interface org.nuxeo.ecm.core.model.Repository
getActiveSessionsCount, hasCapability
-
Field Details
-
REPOSITORY_CONNECTION_PREFIX
Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService
.The connection id will be
repository/[REPOSITORY_NAME]
.- See Also:
-
LONG_ZERO
-
ZERO
-
ONE
-
MONGODB_ID
- See Also:
-
MONGODB_INC
- See Also:
-
MONGODB_SET
- See Also:
-
MONGODB_UNSET
- See Also:
-
MONGODB_PUSH
- See Also:
-
MONGODB_PULLALL
- Since:
- 11.5
- See Also:
-
MONGODB_EACH
- See Also:
-
MONGODB_META
- See Also:
-
MONGODB_TYPE
- See Also:
-
MONGODB_TEXT_SCORE
- See Also:
-
FULLTEXT_INDEX_NAME
- See Also:
-
LANGUAGE_FIELD
- See Also:
-
SEQUENCE_RANDOMIZED_BLOCKSIZE_DEFAULT
protected static final int SEQUENCE_RANDOMIZED_BLOCKSIZE_DEFAULT- See Also:
-
COUNTER_NAME_UUID
- See Also:
-
COUNTER_FIELD
- See Also:
-
MAX_TIME_DEFAULT
Default maximum execution time for a query.- Since:
- 11.1
-
SETTING_VALUE
- See Also:
-
SETTING_DENORMALIZED_BLOB_KEYS
Settings key to determine whetherecm:blobKeys
is supported.The value is
true
on new or migrated repositories.- See Also:
-
GC_NO_CURSOR_TIMEOUT
- Since:
- 2021.14
- See Also:
-
idKey
The key to use to store the id in the database. -
sequenceBlockSize
protected long sequenceBlockSizeSequence allocation block size. -
descriptor
-
mongoClient
protected final com.mongodb.client.MongoClient mongoClient -
converter
-
cursorService
-
coll
protected final com.mongodb.client.MongoCollection<org.bson.Document> coll -
countersColl
protected final com.mongodb.client.MongoCollection<org.bson.Document> countersColl -
settingsColl
protected final com.mongodb.client.MongoCollection<org.bson.Document> settingsColl -
supportsSessions
protected final boolean supportsSessions -
supportsTransactions
protected final boolean supportsTransactions -
maxTimeMS
protected final long maxTimeMSMaximum execution time for a query when outside of a transaction.- Since:
- 11.1
-
supportsDenormalizedBlobKeys
protected boolean supportsDenormalizedBlobKeys -
indexInitialized
protected volatile boolean indexInitialized -
binaryKeys
protected org.bson.conversions.Bson binaryKeysKeys used for document projection when marking all binaries for GC.Used when denormalized ecm:blobKeys is not available.
-
-
Constructor Details
-
MongoDBRepository
-
-
Method Details
-
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceRepository
- Overrides:
shutdown
in classDBSRepositoryBase
-
initRepository
protected void initRepository() -
initSettings
protected void initSettings() -
updateCapabilities
public void updateCapabilities()Description copied from interface:DBSRepository
Update repository capabilities after a migration. Internal use only. -
readSettings
protected void readSettings() -
initCapabilities
protected void initCapabilities() -
getConnection
Description copied from interface:DBSRepository
Gets a new connection to this repository.- Returns:
- a new connection
-
getAllowedIdTypes
Description copied from class:DBSRepositoryBase
Gets the allowed id types for this DBS repository. The first one is the default.- Specified by:
getAllowedIdTypes
in classDBSRepositoryBase
-
supportsSessions
protected boolean supportsSessions() -
supportsTransactions
public boolean supportsTransactions()Description copied from interface:DBSRepository
Checks whether this repository supports transactions.- Returns:
true
if the repository supports transactions- See Also:
-
getClient
protected com.mongodb.client.MongoClient getClient() -
getCursorService
-
getCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCollection() -
getCountersCollection
protected com.mongodb.client.MongoCollection<org.bson.Document> getCountersCollection() -
getIdKey
-
getConverter
-
initBlobsPaths
protected void initBlobsPaths()- Overrides:
initBlobsPaths
in classDBSRepositoryBase
-
markReferencedBlobs
Description copied from interface:Repository
Marks the blobs in use by passing them to the provided callback (taking the blob key and the repository name). -
markReferencedBlobsDenormalized
protected void markReferencedBlobsDenormalized(org.bson.Document ob, BiConsumer<String, String> markReferencedBlob) -
markReferencedBlobs
-
markReferencedBlob
-