Package org.nuxeo.ecm.quota.size
Class DocumentsSizeUpdater
java.lang.Object
org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
org.nuxeo.ecm.quota.size.DocumentsSizeUpdater
- All Implemented Interfaces:
QuotaStatsUpdater
QuotaStatsUpdater
counting space used by Blobs in document. This implementation does not
track the space used by non-Blob properties.- Since:
- 8.3
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final int
static final int
static final int
static final int
static final String
static final String
static final String
protected static final int
static final String
Fields inherited from class org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
descriptionLabel, label, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkQuota
(CoreSession session, DocumentModel doc, long delta) Checks the size delta against the maximum quota specified for this document or an ancestor.protected void
clearQuotas
(CoreSession session, String docID) void
computeInitialStatistics
(CoreSession session, QuotaStatsInitialWork currentWorker, String path) Compute the initial statistics under the given path for thisQuotaStatsUpdater
.getAllBlobs
(DocumentModel doc) Returns the list of blobs for this document.protected long
Gets the sum of all blobs sizes for this document.protected long
getVersionsSize
(CoreSession session, DocumentModel doc) Gets the sum of all blobs sizes for all the document's versions.protected void
handleQuotaExceeded
(QuotaExceededException e, Event event) protected void
initDocument
(CoreSession session, DocumentModel doc) protected void
protected boolean
needToProcessEventOnDocument
(Event event, DocumentModel doc) protected void
processDocumentAboutToBeRemoved
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeCheckedIn
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeCheckedOut
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeRestore
(CoreSession session, DocumentModel doc) protected void
processDocumentBeforeUpdate
(CoreSession session, DocumentModel doc) protected void
processDocumentCheckedIn
(CoreSession session, DocumentModel doc) protected void
processDocumentCheckedOut
(CoreSession session, DocumentModel doc) protected void
processDocumentCopied
(CoreSession session, DocumentModel doc) protected void
processDocumentCreated
(CoreSession session, DocumentModel doc) protected void
processDocumentMoved
(CoreSession session, DocumentModel doc, DocumentModel sourceParent) protected void
processDocumentRestored
(CoreSession session, DocumentModel doc) protected void
processDocumentTrashOp
(CoreSession session, DocumentModel doc, boolean isTrashed) protected void
processDocumentUpdated
(CoreSession session, DocumentModel doc) protected long
scrollAndDo
(CoreSession session, String query, int scrollSize, int scrollKeepAlive, BiConsumer<String, Long> consumer) protected void
updateAncestors
(CoreSession session, DocumentModel doc, long deltaTotal, long deltaTrash, long deltaVersions) protected void
updateDocument
(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions) protected void
updateDocument
(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions, boolean allowSave) protected void
updateDocumentAndAncestors
(CoreSession session, DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions) Methods inherited from class org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
getAncestors, getDescriptionLabel, getLabel, getName, setDescriptionLabel, setLabel, setName, updateStatistics
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.quota.QuotaStatsUpdater
computeInitialStatistics
-
Field Details
-
DISABLE_QUOTA_CHECK_LISTENER
- See Also:
-
USER_WORKSPACES_ROOT
- See Also:
-
CLEAR_SCROLL_SIZE_PROP
- Since:
- 11.1
- See Also:
-
DEFAULT_CLEAR_SCROLL_SIZE
public static final int DEFAULT_CLEAR_SCROLL_SIZE- Since:
- 11.1
- See Also:
-
CLEAR_SCROLL_KEEP_ALIVE_PROP
- Since:
- 11.1
- See Also:
-
DEFAULT_CLEAR_SCROLL_KEEP_ALIVE
public static final int DEFAULT_CLEAR_SCROLL_KEEP_ALIVE- Since:
- 11.1
- See Also:
-
INIT_SCROLL_SIZE_PROP
- Since:
- 11.1
- See Also:
-
DEFAULT_INIT_SCROLL_SIZE
public static final int DEFAULT_INIT_SCROLL_SIZE- Since:
- 11.1
- See Also:
-
INIT_SCROLL_KEEP_ALIVE_PROP
- Since:
- 11.1
- See Also:
-
DEFAULT_INIT_SCROLL_KEEP_ALIVE
public static final int DEFAULT_INIT_SCROLL_KEEP_ALIVE- Since:
- 11.1
- See Also:
-
TRANSACTION_TIMEOUT_SECONDS
protected static final int TRANSACTION_TIMEOUT_SECONDS- Since:
- 2023.17
- See Also:
-
-
Constructor Details
-
DocumentsSizeUpdater
public DocumentsSizeUpdater()
-
-
Method Details
-
computeInitialStatistics
public void computeInitialStatistics(CoreSession session, QuotaStatsInitialWork currentWorker, String path) Description copied from interface:QuotaStatsUpdater
Compute the initial statistics under the given path for thisQuotaStatsUpdater
.- Parameters:
session
- an unrestrictedCoreSession
to be usedpath
- the root of the recomputation, ornull
for the whole repository
-
scrollAndDo
protected long scrollAndDo(CoreSession session, String query, int scrollSize, int scrollKeepAlive, BiConsumer<String, Long> consumer) -
clearQuotas
-
initDocument
-
initDocumentFromChildren
-
handleQuotaExceeded
- Specified by:
handleQuotaExceeded
in classAbstractQuotaStatsUpdater
-
processDocumentCreated
- Specified by:
processDocumentCreated
in classAbstractQuotaStatsUpdater
-
processDocumentCheckedIn
- Specified by:
processDocumentCheckedIn
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedIn
- Specified by:
processDocumentBeforeCheckedIn
in classAbstractQuotaStatsUpdater
-
processDocumentCheckedOut
- Specified by:
processDocumentCheckedOut
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedOut
- Specified by:
processDocumentBeforeCheckedOut
in classAbstractQuotaStatsUpdater
-
processDocumentUpdated
- Specified by:
processDocumentUpdated
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeUpdate
- Specified by:
processDocumentBeforeUpdate
in classAbstractQuotaStatsUpdater
-
processDocumentCopied
- Specified by:
processDocumentCopied
in classAbstractQuotaStatsUpdater
-
processDocumentMoved
protected void processDocumentMoved(CoreSession session, DocumentModel doc, DocumentModel sourceParent) - Specified by:
processDocumentMoved
in classAbstractQuotaStatsUpdater
-
processDocumentAboutToBeRemoved
- Specified by:
processDocumentAboutToBeRemoved
in classAbstractQuotaStatsUpdater
-
processDocumentTrashOp
- Specified by:
processDocumentTrashOp
in classAbstractQuotaStatsUpdater
-
processDocumentBeforeRestore
- Specified by:
processDocumentBeforeRestore
in classAbstractQuotaStatsUpdater
-
processDocumentRestored
- Specified by:
processDocumentRestored
in classAbstractQuotaStatsUpdater
-
needToProcessEventOnDocument
- Specified by:
needToProcessEventOnDocument
in classAbstractQuotaStatsUpdater
-
checkQuota
Checks the size delta against the maximum quota specified for this document or an ancestor. -
getVersionsSize
Gets the sum of all blobs sizes for all the document's versions. -
getBlobsSize
Gets the sum of all blobs sizes for this document. -
getAllBlobs
Returns the list of blobs for this document. -
updateDocument
protected void updateDocument(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions) -
updateDocument
protected void updateDocument(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions, boolean allowSave) -
updateAncestors
protected void updateAncestors(CoreSession session, DocumentModel doc, long deltaTotal, long deltaTrash, long deltaVersions) -
updateDocumentAndAncestors
protected void updateDocumentAndAncestors(CoreSession session, DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions)
-