Package org.nuxeo.ecm.core.storage.sql
Class RepositoryImpl
java.lang.Object
org.nuxeo.ecm.core.storage.sql.RepositoryImpl
- All Implemented Interfaces:
Repository
,Repository
,RepositoryManagement
Repository
implementation, to be extended by backend-specific initialization code.-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected VCSClusterInvalidator
Propagator of invalidations to all mappers' caches.protected final io.dropwizard.metrics5.MetricRegistry
protected final RepositoryDescriptor
boolean
protected boolean
protected final io.dropwizard.metrics5.Counter
protected SQLInfo
static final String
static final String
static final String
static final String
static final String
static Map<String,
Serializable> Fields inherited from interface org.nuxeo.ecm.core.model.Repository
CAPABILITY_QUERY_BLOB_KEYS, CAPABILITY_REPOSITORY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
cleanupDeletedDocuments
(int max, Calendar beforeTime) Cleans up (hard-deletes) any documents that have been soft-deleted in the database.int
Clears all the caches.void
close()
Closes the repository and release all resources.protected void
protected void
closeSession
(SessionImpl session) protected Mapper
createCachingMapper
(Model model, Mapper mapper) protected VCSClusterInvalidator
protected void
createDatabase
(String ddlMode) Creates the necessary structures in the database.protected void
createDatabaseNoTx
(String ddlMode) protected void
protected void
createTables
(Connection connection, String ddlMode) protected TableUpgrader
createTableUpgrader
(Connection connection, JDBCLogger logger) findTableNames
(DatabaseMetaData metadata, String schemaName) Finds uppercase table names.long
long
Evaluate number of elements in hier cachelong
Evaluate number of elements in selection cachelong
Evaluate number of elements in all cachesprotected Class<? extends CachingMapper>
getCapability
(String name) Gets the value of the given capability for this repository.Gets a new connection.Gets the fulltext configuration.protected String
getModel()
getName()
Gets the repository name.protected String
getTableName
(String origName) protected void
protected void
protected void
protected void
boolean
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
void
Makes sure that the next transaction will process cluster invalidations.protected static void
runWithoutTransaction
(Runnable runnable) void
shutdown()
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.model.Repository
getActiveSessionsCount, hasCapability
-
Field Details
-
TEST_UPGRADE
- See Also:
-
TEST_UPGRADE_VERSIONS
- See Also:
-
TEST_UPGRADE_LAST_CONTRIBUTOR
- See Also:
-
TEST_UPGRADE_LOCKS
- See Also:
-
TEST_UPGRADE_SYS_CHANGE_TOKEN
- See Also:
-
testProps
-
repositoryDescriptor
-
registry
protected final io.dropwizard.metrics5.MetricRegistry registry -
sessionCount
protected final io.dropwizard.metrics5.Counter sessionCount -
selfRegisteredLockManager
protected boolean selfRegisteredLockManager- Since:
- 7.4 : used to know if the LockManager was provided by this repository or externally
-
invalidationsPropagator
Propagator of invalidations to all mappers' caches. -
clusterInvalidator
-
requiresClusterSQL
public boolean requiresClusterSQL -
sqlInfo
-
-
Constructor Details
-
RepositoryImpl
-
-
Method Details
-
createMetricsGauges
protected void createMetricsGauges() -
createCachingMapper
-
getCachingMapperClass
-
getRepositoryDescriptor
-
getLockManager
-
getModel
-
getSQLInfo
- Since:
- 11.1
-
getInvalidationsPropagator
-
isChangeTokenEnabled
public boolean isChangeTokenEnabled() -
getSession
- Specified by:
getSession
in interfaceRepository
-
getConnection
Gets a new connection.- Specified by:
getConnection
in interfaceRepository
- Returns:
- the session
-
closeSession
-
initRepository
protected void initRepository() -
initRootNode
protected void initRootNode() -
getLockManagerName
-
initLockManager
protected void initLockManager() -
prepareClusterInvalidator
protected void prepareClusterInvalidator() -
createClusterInvalidator
-
initClusterInvalidator
protected void initClusterInvalidator() -
shutdown
public void shutdown()- Specified by:
shutdown
in interfaceRepository
-
close
public void close()Description copied from interface:Repository
Closes the repository and release all resources.- Specified by:
close
in interfaceRepository
-
closeAllSessions
protected void closeAllSessions() -
getName
Description copied from interface:RepositoryManagement
Gets the repository name.- Specified by:
getName
in interfaceRepository
- Specified by:
getName
in interfaceRepositoryManagement
-
clearCaches
public int clearCaches()Description copied from interface:RepositoryManagement
Clears all the caches.- Specified by:
clearCaches
in interfaceRepositoryManagement
- Returns:
- an indicative count of objects removed
-
getCacheSize
public long getCacheSize()Description copied from interface:RepositoryManagement
Evaluate number of elements in all caches- Specified by:
getCacheSize
in interfaceRepositoryManagement
-
getCacheMapperSize
public long getCacheMapperSize() -
getCachePristineSize
public long getCachePristineSize()Description copied from interface:RepositoryManagement
Evaluate number of elements in hier cache- Specified by:
getCachePristineSize
in interfaceRepositoryManagement
-
getCacheSelectionSize
public long getCacheSelectionSize()Description copied from interface:RepositoryManagement
Evaluate number of elements in selection cache- Specified by:
getCacheSelectionSize
in interfaceRepositoryManagement
-
processClusterInvalidationsNext
public void processClusterInvalidationsNext()Description copied from interface:RepositoryManagement
Makes sure that the next transaction will process cluster invalidations.- Specified by:
processClusterInvalidationsNext
in interfaceRepositoryManagement
-
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).- Specified by:
markReferencedBlobs
in interfaceRepository
-
cleanupDeletedDocuments
Description copied from interface:RepositoryManagement
Cleans up (hard-deletes) any documents that have been soft-deleted in the database.- Specified by:
cleanupDeletedDocuments
in interfaceRepositoryManagement
- Parameters:
max
- the maximum number of documents to delete at a timebeforeTime
- the maximum deletion time of the documents to delete- Returns:
- the number of documents deleted
-
getFulltextConfiguration
Description copied from interface:RepositoryManagement
Gets the fulltext configuration.- Specified by:
getFulltextConfiguration
in interfaceRepository
- Specified by:
getFulltextConfiguration
in interfaceRepositoryManagement
-
getCapability
Description copied from interface:Repository
Gets the value of the given capability for this repository.- Specified by:
getCapability
in interfaceRepository
-
createDatabase
Creates the necessary structures in the database.- Parameters:
ddlMode
- the DDL execution mode
-
createDatabaseNoTx
-
getTableName
-
createTables
- Throws:
SQLException
-
createTableUpgrader
-
findTableNames
protected static Set<String> findTableNames(DatabaseMetaData metadata, String schemaName) throws SQLException Finds uppercase table names.- Throws:
SQLException
-
runWithoutTransaction
-