cancel
Showing results for 
Search instead for 
Did you mean: 

Add an aspect to large number of nodes

kuliado
Champ on-the-rise
Champ on-the-rise

Hello,

I have a little issue I don't know how to tackle properly and concerns performance.

I need to process ~200k documents that are missing an aspect. First, I identified these documents with a mysql query to evaluate how many there are. These nodes have aspect X but are missing aspect Y, so I need to add aspect Y to all these nodes.

I'm exploring the BatchProcessor approach right now and I am basing my code on the class org.alfresco.repo.node.db.NodeStringLengthWorker. Is this the correct way to do this ?

Few questions arise from writing my code :

- what's the best way to get the nodes in the WorkProvider : searchService solr/lucene ? nodeService ? nodeDAO.getNodesWithAspects (here I would have to check each node for the missing aspect) ?

- how do I stagger this search ? I see in NodeStringLengthWorker we use minNodeId and maxNodeId, is this a way to reduce the search load ?

I saw there was a talk https://community.alfresco.com/thread/214163-deleting-over-1000-nodes#comment-716898  about this subject but this link is not working anymore.

Our production environment is very frail so this process should really produce as less load as possible.

Thanks in advance, and if you need any more info I will provide gladly.

1 ACCEPTED ANSWER

I've create a sample project available at:

GitHub - aborroy/auditable-aspect-disable: Alfresco Repository module to disable AUDITABLE ASPECT be... 

Include the QName of the aspect you are adding in alfresco-global.properties to test the module.

Let me know if this works for you.

Hyland Developer Evangelist

View answer in original post

10 REPLIES 10

Wow, that is amazing from your part. I never asked for so much.

I will test this as soon as I can implement it with my code.

I already learned how to listen and execute code after the transaction is completed thanks to you with TransactionListenerAdapter.

A million thanks.