Package org.nuxeo.ecm.core.storage.sql
Interface Mapper
-
- All Superinterfaces:
RowMapper
- All Known Subinterfaces:
CachingMapper
- All Known Implementing Classes:
JDBCMapper
,SoftRefCachingMapper
,UnifiedCachingMapper
public interface Mapper extends RowMapper
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Mapper.Identification
Identifiers assigned by a server to identify a client mapper and its repository.-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.storage.sql.RowMapper
RowMapper.CopyResult, RowMapper.IdWithTypes, RowMapper.NodeInfo, RowMapper.RowBatch, RowMapper.RowUpdate
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLOSE
static String
GET_IDENTIFICATION
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
cleanupDeletedRows(int max, Calendar beforeTime)
Cleans up (hard-delete) any rows that have been soft-deleted in the database.void
close()
void
createClusterNode(Serializable nodeId)
Informs the cluster that this node exists.Set<Serializable>
getAncestorsIds(Collection<Serializable> ids)
Gets the ids for all the ancestors of the given row ids.VCSInvalidations
getClusterInvalidations(Serializable nodeId)
Gets the invalidations from other cluster nodes.int
getClusterNodeIdType()
Mapper.Identification
getIdentification()
Returns the repository id and mapper id assigned.Serializable
getRootId(String repositoryId)
Gets the root id for a given repository, if registered.int
getTableSize(String tableName)
void
insertClusterInvalidations(Serializable nodeId, VCSInvalidations invalidations)
Inserts the invalidation rows for the other cluster nodes.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).PartialList<Serializable>
query(String query, String queryType, QueryFilter queryFilter, boolean countTotal)
Makes a NXQL query to the database.PartialList<Serializable>
query(String query, String queryType, QueryFilter queryFilter, long countUpTo)
Makes a NXQL query to the database.IterableQueryResult
queryAndFetch(String query, String queryType, QueryFilter queryFilter, boolean distinctDocuments, Object... params)
Makes a query to the database and returns an iterable (which must be closed when done).PartialList<Map<String,Serializable>>
queryProjection(String query, String queryType, QueryFilter queryFilter, boolean distinctDocuments, long countUpTo, Object... params)
Makes a query to the database.void
rebuildReadAcls()
void
removeClusterNode(Serializable nodeId)
Removes this node from the cluster.ScrollResult<String>
scroll(String scrollId)
Get the next batch of results containing id of documents, thescrollId
is part of the previousScrollResult
response.ScrollResult<String>
scroll(String query, int batchSize, int keepAliveSeconds)
Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within thekeepAliveSeconds
delay.ScrollResult<String>
scroll(String query, QueryFilter queryFilter, int batchSize, int keepAliveSeconds)
Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within thekeepAliveSeconds
delay.void
setRootId(Serializable repositoryId, Serializable id)
Records the newly generated root id for a given repository.void
updateReadAcls()
-
Methods inherited from interface org.nuxeo.ecm.core.storage.sql.RowMapper
clearCache, copy, copy, generateNewId, getBinaryFulltext, getCacheSize, getDescendantsInfo, read, readCollectionRowArray, readSelectionRows, readSelectionsIds, readSimpleRow, receiveInvalidations, remove, rollback, sendInvalidations, write
-
-
-
-
Field Detail
-
GET_IDENTIFICATION
static final String GET_IDENTIFICATION
- See Also:
- Constant Field Values
-
CLOSE
static final String CLOSE
- See Also:
- Constant Field Values
-
-
Method Detail
-
scroll
ScrollResult<String> scroll(String query, int batchSize, int keepAliveSeconds)
Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within thekeepAliveSeconds
delay.- Since:
- 8.4
-
scroll
ScrollResult<String> scroll(String query, QueryFilter queryFilter, int batchSize, int keepAliveSeconds)
Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within thekeepAliveSeconds
delay.- Since:
- 10.3
-
scroll
ScrollResult<String> scroll(String scrollId)
Get the next batch of results containing id of documents, thescrollId
is part of the previousScrollResult
response.- Since:
- 8.4
-
getIdentification
Mapper.Identification getIdentification()
Returns the repository id and mapper id assigned.This is used in remote stateless mode to be able to identify to which mapper an incoming connection is targeted, and from which repository instance.
- Returns:
- the repository and mapper identification
-
close
void close()
-
getTableSize
int getTableSize(String tableName)
-
getRootId
Serializable getRootId(String repositoryId)
Gets the root id for a given repository, if registered.- Parameters:
repositoryId
- the repository id- Returns:
- the root id, or null if not found
-
setRootId
void setRootId(Serializable repositoryId, Serializable id)
Records the newly generated root id for a given repository.- Parameters:
repositoryId
- the repository id, usually 0id
- the root id
-
query
PartialList<Serializable> query(String query, String queryType, QueryFilter queryFilter, boolean countTotal)
Makes a NXQL query to the database.- Parameters:
query
- the queryqueryType
- the query typequeryFilter
- the query filtercountTotal
- iftrue
, count the total size without limit/offset- Returns:
- the list of matching document ids
-
query
PartialList<Serializable> query(String query, String queryType, QueryFilter queryFilter, long countUpTo)
Makes a NXQL query to the database.- Parameters:
query
- the queryqueryType
- the query typequeryFilter
- the query filtercountUpTo
- if-1
, count the total size without offset/limit.
If0
, don't count the total size.
Ifn
, count the total number if there are less than n documents otherwise set the size to-1
.- Returns:
- the list of matching document ids
- Since:
- 5.6
-
queryAndFetch
IterableQueryResult queryAndFetch(String query, String queryType, QueryFilter queryFilter, boolean distinctDocuments, Object... params)
Makes a query to the database and returns an iterable (which must be closed when done).- Parameters:
query
- the queryqueryType
- the query typequeryFilter
- the query filterdistinctDocuments
- iftrue
then a maximum of one row per document will be returnedparams
- optional query-type-dependent parameters- Returns:
- an iterable, which must be closed when done
-
queryProjection
PartialList<Map<String,Serializable>> queryProjection(String query, String queryType, QueryFilter queryFilter, boolean distinctDocuments, long countUpTo, Object... params)
Makes a query to the database.- Parameters:
query
- the queryqueryType
- the query typequeryFilter
- the query filterdistinctDocuments
- iftrue
then a maximum of one row per document will be returnedcountUpTo
- if-1
, also count the total size without offset/limit.
If0
, don't count the total size.
Ifn
, count the total number if there are less than n documents otherwise set the size to-1
.params
- optional query-type-dependent parameters- Returns:
- a projection
- Since:
- 7.10-HF-25, 8.10-HF06, 9.2
-
getAncestorsIds
Set<Serializable> getAncestorsIds(Collection<Serializable> ids)
Gets the ids for all the ancestors of the given row ids.- Parameters:
ids
- the ids- Returns:
- the set of ancestor ids
-
updateReadAcls
void updateReadAcls()
-
rebuildReadAcls
void rebuildReadAcls()
-
getClusterNodeIdType
int getClusterNodeIdType()
-
createClusterNode
void createClusterNode(Serializable nodeId)
Informs the cluster that this node exists.
-
removeClusterNode
void removeClusterNode(Serializable nodeId)
Removes this node from the cluster.
-
insertClusterInvalidations
void insertClusterInvalidations(Serializable nodeId, VCSInvalidations invalidations)
Inserts the invalidation rows for the other cluster nodes.
-
getClusterInvalidations
VCSInvalidations getClusterInvalidations(Serializable nodeId)
Gets the invalidations from other cluster nodes.
-
markReferencedBlobs
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).- Since:
- 2021.8
-
cleanupDeletedRows
int cleanupDeletedRows(int max, Calendar beforeTime)
Cleans up (hard-delete) any rows that have been soft-deleted in the database.- Parameters:
max
- the maximum number of rows to delete at a timebeforeTime
- the maximum deletion time of the rows to delete- Returns:
- the number of rows deleted
-
-