public class UnifiedCachingMapper extends UnifiedCachingRowMapper implements CachingMapper
Mapper that uses a UnifiedCachingRowMapper for row-related operation, and delegates to the
Mapper for others.Mapper.IdentificationRowMapper.CopyResult, RowMapper.IdWithTypes, RowMapper.NodeInfo, RowMapper.RowBatch, RowMapper.RowUpdate| Modifier and Type | Field and Description |
|---|---|
Mapper |
mapper
The
Mapper to which operations are delegated. |
cacheGetTimer, cacheHitCount, isXA, registry, sorGetTimer, sorRowsCLOSE, GET_IDENTIFICATIONTMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY| Constructor and Description |
|---|
UnifiedCachingMapper() |
| Modifier and Type | Method and Description |
|---|---|
int |
cleanupDeletedRows(int max,
Calendar beforeTime)
Cleans up (hard-delete) any rows that have been soft-deleted in the database.
|
void |
close() |
void |
commit(Xid xid,
boolean onePhase) |
void |
connect(boolean noSharing) |
void |
createClusterNode(Serializable nodeId)
Informs the cluster that this node exists.
|
void |
createDatabase(String ddlMode)
Creates the necessary structures in the database.
|
void |
disconnect() |
void |
end(Xid xid,
int flags) |
void |
forget(Xid xid) |
Set<Serializable> |
getAncestorsIds(Collection<Serializable> ids)
Gets the ids for all the ancestors of the given row ids.
|
Invalidations |
getClusterInvalidations(Serializable nodeId)
Gets the invalidations from other cluster nodes.
|
int |
getClusterNodeIdType() |
Mapper.Identification |
getIdentification()
Returns the repository id and mapper id assigned.
|
Lock |
getLock(Serializable id)
Gets the lock state of a document.
|
Serializable |
getRootId(String repositoryId)
Gets the root id for a given repository, if registered.
|
int |
getTableSize(String tableName) |
int |
getTransactionTimeout() |
void |
initialize(String repositoryName,
Model model,
Mapper mapper,
InvalidationsPropagator invalidationsPropagator,
Map<String,String> properties)
Initialize the caching mapper instance
|
void |
insertClusterInvalidations(Serializable nodeId,
Invalidations invalidations)
Inserts the invalidation rows for the other cluster nodes.
|
boolean |
isConnected() |
boolean |
isSameRM(XAResource xares) |
void |
markReferencedBinaries()
Marks the binaries in use by passing them to the binary manager(s)'s GC mark() method.
|
int |
prepare(Xid xid) |
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() |
Xid[] |
recover(int flag) |
void |
removeClusterNode(Serializable nodeId)
Removes this node from the cluster.
|
Lock |
removeLock(Serializable id,
String owner,
boolean force)
Removes a lock from a document.
|
ScrollResult |
scroll(String scrollId)
Get the next batch of results containing id of documents, the
scrollId is part of the previous
ScrollResult response. |
ScrollResult |
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 the
keepAliveSeconds delay. |
ScrollResult |
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 the
keepAliveSeconds delay. |
Lock |
setLock(Serializable id,
Lock lock)
Sets a lock on a document.
|
void |
setRootId(Serializable repositoryId,
Serializable id)
Records the newly generated root id for a given repository.
|
boolean |
setTransactionTimeout(int seconds) |
void |
start(Xid xid,
int flags) |
void |
updateReadAcls() |
cacheGet, cachePut, cachePutAbsent, cachePutAbsentIfNull, cachePutAbsentIfRowId, cacheRemove, clearCache, copy, ehCacheGet, ehCacheGetSize, ehCachePut, ehCacheRemove, ehCacheRemoveAll, generateNewId, getBinaryFulltext, getCacheSize, getDescendantsInfo, hasTransaction, initialize, isAbsent, read, readCollectionRowArray, readSelectionRows, readSelectionsIds, readSimpleRow, receiveInvalidations, remove, rollback, sendInvalidations, setMetrics, sortACLRows, useEhCache, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearCache, copy, generateNewId, getBinaryFulltext, getCacheSize, getDescendantsInfo, read, readCollectionRowArray, readSelectionRows, readSelectionsIds, readSimpleRow, receiveInvalidations, remove, rollback, sendInvalidations, writerollbackpublic UnifiedCachingMapper()
public void initialize(String repositoryName, Model model, Mapper mapper, InvalidationsPropagator invalidationsPropagator, Map<String,String> properties)
CachingMapperinitialize in interface CachingMapperpublic ScrollResult scroll(String query, int batchSize, int keepAliveSeconds)
MapperkeepAliveSeconds delay.public ScrollResult scroll(String query, QueryFilter queryFilter, int batchSize, int keepAliveSeconds)
MapperkeepAliveSeconds delay.public ScrollResult scroll(String scrollId)
MapperscrollId is part of the previous
ScrollResult response.public Mapper.Identification getIdentification()
MapperThis is used in remote stateless mode to be able to identify to which mapper an incoming connection is targeted, and from which repository instance.
getIdentification in interface Mapperpublic void close()
close in interface Mapperclose in class UnifiedCachingRowMapperpublic int getTableSize(String tableName)
getTableSize in interface Mapperpublic void createDatabase(String ddlMode)
MappercreateDatabase in interface MapperddlMode - the DDL execution modepublic Serializable getRootId(String repositoryId)
Mapperpublic void setRootId(Serializable repositoryId, Serializable id)
Mapperpublic PartialList<Serializable> query(String query, String queryType, QueryFilter queryFilter, boolean countTotal)
Mapperpublic PartialList<Serializable> query(String query, String queryType, QueryFilter queryFilter, long countUpTo)
Mapperquery in interface Mapperquery - the queryqueryType - the query typequeryFilter - the query filtercountUpTo - if -1, count the total size without offset/limit.0, don't count the total size.n, count the total number if there are less than n documents otherwise set the size to
-1.public IterableQueryResult queryAndFetch(String query, String queryType, QueryFilter queryFilter, boolean distinctDocuments, Object... params)
MapperqueryAndFetch in interface Mapperquery - the queryqueryType - the query typequeryFilter - the query filterdistinctDocuments - if true then a maximum of one row per document will be returnedparams - optional query-type-dependent parameterspublic PartialList<Map<String,Serializable>> queryProjection(String query, String queryType, QueryFilter queryFilter, boolean distinctDocuments, long countUpTo, Object... params)
MapperqueryProjection in interface Mapperquery - the queryqueryType - the query typequeryFilter - the query filterdistinctDocuments - if true then a maximum of one row per document will be returnedcountUpTo - if -1, also count the total size without offset/limit.0, don't count the total size.n, count the total number if there are less than n documents otherwise set the size to
-1.params - optional query-type-dependent parameterspublic Set<Serializable> getAncestorsIds(Collection<Serializable> ids)
MappergetAncestorsIds in interface Mapperids - the idspublic void updateReadAcls()
updateReadAcls in interface Mapperpublic void rebuildReadAcls()
rebuildReadAcls in interface Mapperpublic int getClusterNodeIdType()
getClusterNodeIdType in interface Mapperpublic void createClusterNode(Serializable nodeId)
MappercreateClusterNode in interface Mapperpublic void removeClusterNode(Serializable nodeId)
MapperremoveClusterNode in interface Mapperpublic void insertClusterInvalidations(Serializable nodeId, Invalidations invalidations)
MapperinsertClusterInvalidations in interface Mapperpublic Invalidations getClusterInvalidations(Serializable nodeId)
MappergetClusterInvalidations in interface Mapperpublic Lock getLock(Serializable id)
Mapper
If the document does not exist, null is returned.
public Lock setLock(Serializable id, Lock lock)
Mapper
If the document is already locked, returns its existing lock status (there is no re-locking, Mapper.removeLock(java.io.Serializable, java.lang.String, boolean)
must be called first).
public Lock removeLock(Serializable id, String owner, boolean force)
MapperThe previous lock is returned.
If owner is null then the lock is unconditionally removed.
If owner is not null, it must match the existing lock owner for the lock to be removed. If it
doesn't match, the returned lock will return true for Lock.getFailed().
removeLock in interface Mapperid - the document idowner - the owner to check, or null for no checkforce - true to just do the remove and not return the previous lockpublic void markReferencedBinaries()
MappermarkReferencedBinaries in interface Mapperpublic int cleanupDeletedRows(int max, Calendar beforeTime)
MappercleanupDeletedRows in interface Mappermax - the maximum number of rows to delete at a timebeforeTime - the maximum deletion time of the rows to deletepublic void start(Xid xid, int flags) throws XAException
start in interface XAResourceXAExceptionpublic void end(Xid xid, int flags) throws XAException
end in interface XAResourceXAExceptionpublic int prepare(Xid xid) throws XAException
prepare in interface XAResourceXAExceptionpublic void commit(Xid xid, boolean onePhase) throws XAException
commit in interface XAResourceXAExceptionpublic void forget(Xid xid) throws XAException
forget in interface XAResourceXAExceptionpublic Xid[] recover(int flag) throws XAException
recover in interface XAResourceXAExceptionpublic boolean setTransactionTimeout(int seconds) throws XAException
setTransactionTimeout in interface XAResourceXAExceptionpublic int getTransactionTimeout() throws XAException
getTransactionTimeout in interface XAResourceXAExceptionpublic boolean isSameRM(XAResource xares) throws XAException
isSameRM in interface XAResourceXAExceptionpublic boolean isConnected()
isConnected in interface Mapperpublic void disconnect()
disconnect in interface MapperCopyright © 2019 Nuxeo. All rights reserved.