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
Modifier and TypeClassDescriptionstatic class
static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final MigrationDescriptor
protected static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
clearRunningBulkCommands
(String migrationId, String step) abstract void
compute
(CoreSession session, List<String> ids, Map<String, Serializable> properties) Executes the migration on the given batch.protected BulkCommand
createBulkCommand
(String repositoryName, String migrationId, String migrationStep) protected String
getBulkCommandsKey
(String migrationId, String step) protected static KeyValueStore
protected abstract String
getRunningBulkCommands
(String migrationId, String step) protected abstract String
probeSession
(CoreSession session) Probes the current state of asession
by analyzing persistent data.Probes the current state of a migration by analyzing persistent data.void
run
(String step, MigrationService.MigrationContext migrationContext) Runs a migration step.protected void
saveRunningBulkCommands
(String migrationId, String step, List<String> bulkIds) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 descriptor
this migrator is linked to
-
-
Method Details
-
probeState
Description copied from interface:MigrationService.Migrator
Probes 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:
probeState
in interfaceMigrationService.Migrator
- Returns:
- the probed state, or
null
if it cannot be determined
-
probeSession
Probes the current state of asession
by analyzing persistent data.Assumes no migration step is currently running.
- Returns:
- the probed state, or
null
if it cannot be determined
-
run
Description copied from interface:MigrationService.Migrator
Runs a migration step.This method should periodically check for
MigrationService.MigrationContext.isShutdownRequested()
andThread.isInterrupted()
and return iftrue
.- Specified by:
run
in 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 throughproperties
with the keyPARAM_MIGRATION_STEP
.This method is called by the
AbstractBulkMigrator.MigrationComputation
, the transaction is handled by it. -
getKeyValueStore
-