-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: extract msg start subscription migration task
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ngine/state/migration/to_8_3/MultiTenancyMessageStartEventSubscriptionStateMigration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.engine.state.migration.to_8_3; | ||
|
||
import io.camunda.zeebe.engine.state.immutable.ProcessingState; | ||
import io.camunda.zeebe.engine.state.migration.MigrationTask; | ||
import io.camunda.zeebe.engine.state.mutable.MutableProcessingState; | ||
import io.camunda.zeebe.protocol.ZbColumnFamilies; | ||
|
||
public final class MultiTenancyMessageStartEventSubscriptionStateMigration | ||
implements MigrationTask { | ||
|
||
@Override | ||
public String getIdentifier() { | ||
return getClass().getSimpleName(); | ||
} | ||
|
||
@Override | ||
public boolean needsToRun(final ProcessingState processingState) { | ||
return hasOpenMessageStartEventSubscriptionsInDeprecatedCFs(processingState); | ||
} | ||
|
||
@Override | ||
public void runMigration(final MutableProcessingState processingState) { | ||
final var migrationState = processingState.getMigrationState(); | ||
migrationState.migrateMessageStartEventSubscriptionForMultiTenancy(); | ||
} | ||
|
||
private static boolean hasOpenMessageStartEventSubscriptionsInDeprecatedCFs( | ||
final ProcessingState processingState) { | ||
return !processingState.isEmpty( | ||
ZbColumnFamilies.DEPRECATED_MESSAGE_START_EVENT_SUBSCRIPTION_BY_NAME_AND_KEY) | ||
|| !processingState.isEmpty( | ||
ZbColumnFamilies.DEPRECATED_MESSAGE_START_EVENT_SUBSCRIPTION_BY_KEY_AND_NAME); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters