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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringprotected static final intstatic final StringFields inherited from class org.nuxeo.ecm.quota.AbstractQuotaStatsUpdater
descriptionLabel, label, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckQuota(CoreSession session, DocumentModel doc, long delta) Checks the size delta against the maximum quota specified for this document or an ancestor.protected voidclearQuotas(CoreSession session, String docID) voidcomputeInitialStatistics(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 longGets the sum of all blobs sizes for this document.protected longgetVersionsSize(CoreSession session, DocumentModel doc) Gets the sum of all blobs sizes for all the document's versions.protected voidhandleQuotaExceeded(QuotaExceededException e, Event event) protected voidinitDocument(CoreSession session, DocumentModel doc) protected voidprotected booleanneedToProcessEventOnDocument(Event event, DocumentModel doc) protected voidprocessDocumentAboutToBeRemoved(CoreSession session, DocumentModel doc) protected voidprocessDocumentBeforeCheckedIn(CoreSession session, DocumentModel doc) protected voidprocessDocumentBeforeCheckedOut(CoreSession session, DocumentModel doc) protected voidprocessDocumentBeforeRestore(CoreSession session, DocumentModel doc) protected voidprocessDocumentBeforeUpdate(CoreSession session, DocumentModel doc) protected voidprocessDocumentCheckedIn(CoreSession session, DocumentModel doc) protected voidprocessDocumentCheckedOut(CoreSession session, DocumentModel doc) protected voidprocessDocumentCopied(CoreSession session, DocumentModel doc) protected voidprocessDocumentCreated(CoreSession session, DocumentModel doc) protected voidprocessDocumentMoved(CoreSession session, DocumentModel doc, DocumentModel sourceParent) protected voidprocessDocumentRestored(CoreSession session, DocumentModel doc) protected voidprocessDocumentTrashOp(CoreSession session, DocumentModel doc, boolean isTrashed) protected voidprocessDocumentUpdated(CoreSession session, DocumentModel doc) protected longscrollAndDo(CoreSession session, String query, int scrollSize, int scrollKeepAlive, BiConsumer<String, Long> consumer) protected voidupdateAncestors(CoreSession session, DocumentModel doc, long deltaTotal, long deltaTrash, long deltaVersions) protected voidupdateDocument(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions) protected voidupdateDocument(DocumentModel doc, long deltaInner, long deltaTotal, long deltaTrash, long deltaVersions, boolean allowSave) protected voidupdateDocumentAndAncestors(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, updateStatisticsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:QuotaStatsUpdaterCompute the initial statistics under the given path for thisQuotaStatsUpdater.- Parameters:
session- an unrestrictedCoreSessionto be usedpath- the root of the recomputation, ornullfor 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:
handleQuotaExceededin classAbstractQuotaStatsUpdater
-
processDocumentCreated
- Specified by:
processDocumentCreatedin classAbstractQuotaStatsUpdater
-
processDocumentCheckedIn
- Specified by:
processDocumentCheckedInin classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedIn
- Specified by:
processDocumentBeforeCheckedInin classAbstractQuotaStatsUpdater
-
processDocumentCheckedOut
- Specified by:
processDocumentCheckedOutin classAbstractQuotaStatsUpdater
-
processDocumentBeforeCheckedOut
- Specified by:
processDocumentBeforeCheckedOutin classAbstractQuotaStatsUpdater
-
processDocumentUpdated
- Specified by:
processDocumentUpdatedin classAbstractQuotaStatsUpdater
-
processDocumentBeforeUpdate
- Specified by:
processDocumentBeforeUpdatein classAbstractQuotaStatsUpdater
-
processDocumentCopied
- Specified by:
processDocumentCopiedin classAbstractQuotaStatsUpdater
-
processDocumentMoved
protected void processDocumentMoved(CoreSession session, DocumentModel doc, DocumentModel sourceParent) - Specified by:
processDocumentMovedin classAbstractQuotaStatsUpdater
-
processDocumentAboutToBeRemoved
- Specified by:
processDocumentAboutToBeRemovedin classAbstractQuotaStatsUpdater
-
processDocumentTrashOp
- Specified by:
processDocumentTrashOpin classAbstractQuotaStatsUpdater
-
processDocumentBeforeRestore
- Specified by:
processDocumentBeforeRestorein classAbstractQuotaStatsUpdater
-
processDocumentRestored
- Specified by:
processDocumentRestoredin classAbstractQuotaStatsUpdater
-
needToProcessEventOnDocument
- Specified by:
needToProcessEventOnDocumentin 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)
-