Caching in OpenMigrate - tsgrp/OpenMigrate GitHub Wiki

What Is It

As of revision #14935, caching features from OpenContent have been brought over to OpenMigrate. Currently, the only implemented cache type is BasicStringToStringCache (which is just a ConcurrentHashMap<String, String> under the hood), any other cache types will have to be implemented as needed. Caches can be instantiated as singletons so that you can share cache values across multiple steps in the migration.

How to Use It

An example where shared string to string caching would be useful is an Alfresco migration that uses the LinkAlfrescoNodeToParent listener. Both MigrationTargetAlfrescoCMIS and LinkAlfrescoNodeToParenthave their own automatically instantiated caches already - but since both use folder paths during their operation, they can share a cache that maps folder paths to noderefs. Setting it up would look something like this:

app-ctx.xml

<bean id="folderCache" class="com.tsgrp.migration.cache.BasicStringToStringCache" scope="singleton" init-method="init">
    <property name="generateCacheOnStartup" value="true"/>
 </bean>

Cache property in bean for MigrationTargetAlfrescoCMIS

<property name="foldersCache" ref="folderCache"/>

Cache property in bean for LinkAlfrescoNodeToParents listener

<property name="folderCache" ref="folderCache"/>
⚠️ **GitHub.com Fallback** ⚠️