Package org.nuxeo.ecm.core.migrator
Class AbstractBulkMigrator
java.lang.Object
org.nuxeo.ecm.core.migrator.AbstractBulkMigrator
- All Implemented Interfaces:
MigrationService.Migrator
- Direct Known Subclasses:
BlobKeysBulkMigrator
- Since:
- 2023.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MigrationDescriptorprotected static final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearRunningBulkCommands(String migrationId, String step) abstract voidcompute(CoreSession session, List<String> ids, Map<String, Serializable> properties) Executes the migration on the given batch.protected BulkCommandcreateBulkCommand(String repositoryName, String migrationId, String migrationStep) protected StringgetBulkCommandsKey(String migrationId, String step) protected static KeyValueStoreprotected abstract StringgetRunningBulkCommands(String migrationId, String step) protected abstract StringprobeSession(CoreSession session) Probes the current state of asessionby analyzing persistent data.Probes the current state of a migration by analyzing persistent data.voidrun(String step, MigrationService.MigrationContext migrationContext) Runs a migration step.protected voidsaveRunningBulkCommands(String migrationId, String step, List<String> bulkIds) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.migration.MigrationService.Migrator
notifyStatusChange
-
Field Details
-
PARAM_MIGRATION_ID
- See Also:
-
PARAM_MIGRATION_STEP
- See Also:
-
MIGRATION_PROCESSOR_NAME
- See Also:
-
descriptor
-
-
Constructor Details
-
AbstractBulkMigrator
- Parameters:
descriptor- themigration descriptorthis migrator is linked to
-
-
Method Details
-
probeState
Description copied from interface:MigrationService.MigratorProbes the current state of a migration by analyzing persistent data.Assumes no migration step is currently running.
THIS METHOD MAY TAKE A WHILE as it needs to get information from persistent storage.
- Specified by:
probeStatein interfaceMigrationService.Migrator- Returns:
- the probed state, or
nullif it cannot be determined
-
probeSession
Probes the current state of asessionby analyzing persistent data.Assumes no migration step is currently running.
- Returns:
- the probed state, or
nullif it cannot be determined
-
run
Description copied from interface:MigrationService.MigratorRuns a migration step.This method should periodically check for
MigrationService.MigrationContext.isShutdownRequested()andThread.isInterrupted()and return iftrue.- Specified by:
runin interfaceMigrationService.Migrator- Parameters:
step- the migration step to runmigrationContext- the migration context.
-
saveRunningBulkCommands
-
getRunningBulkCommands
-
clearRunningBulkCommands
-
getBulkCommandsKey
-
createBulkCommand
protected BulkCommand createBulkCommand(String repositoryName, String migrationId, String migrationStep) -
getNXQLScrollQuery
- Returns:
- the NXQL query to scroll for bulk migration
-
compute
public abstract void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) Executes the migration on the given batch. The migration step is given throughpropertieswith the keyPARAM_MIGRATION_STEP.This method is called by the
AbstractBulkMigrator.MigrationComputation, the transaction is handled by it. -
getKeyValueStore
-