mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-19 14:44:37 +00:00
fix(datahub-upgrade): removing the CleanupStep from datahub upgrade (#2728)
This commit is contained in:
parent
3caa09d21a
commit
c74c20af29
@ -1,34 +0,0 @@
|
|||||||
package com.linkedin.datahub.upgrade.nocode;
|
|
||||||
|
|
||||||
import com.linkedin.datahub.upgrade.UpgradeCleanupStep;
|
|
||||||
import com.linkedin.datahub.upgrade.UpgradeContext;
|
|
||||||
import com.linkedin.datahub.upgrade.UpgradeResult;
|
|
||||||
import io.ebean.EbeanServer;
|
|
||||||
import java.util.function.BiConsumer;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes the Aspect Table on Upgrade Failure.
|
|
||||||
*/
|
|
||||||
public class CleanupStep implements UpgradeCleanupStep {
|
|
||||||
|
|
||||||
private final EbeanServer _server;
|
|
||||||
|
|
||||||
public CleanupStep(final EbeanServer server) {
|
|
||||||
_server = server;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String id() {
|
|
||||||
return "CleanupStep";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BiConsumer<UpgradeContext, UpgradeResult> executable() {
|
|
||||||
return (context, result) -> {
|
|
||||||
if (UpgradeResult.Result.FAILED.equals(result.result())) {
|
|
||||||
_server.execute(_server.createSqlUpdate("DROP TABLE metadata_aspect_v2"));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +1,5 @@
|
|||||||
package com.linkedin.datahub.upgrade.nocode;
|
package com.linkedin.datahub.upgrade.nocode;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import com.linkedin.datahub.upgrade.Upgrade;
|
import com.linkedin.datahub.upgrade.Upgrade;
|
||||||
import com.linkedin.datahub.upgrade.UpgradeCleanupStep;
|
import com.linkedin.datahub.upgrade.UpgradeCleanupStep;
|
||||||
import com.linkedin.datahub.upgrade.UpgradeStep;
|
import com.linkedin.datahub.upgrade.UpgradeStep;
|
||||||
@ -8,6 +7,7 @@ import com.linkedin.metadata.entity.EntityService;
|
|||||||
import com.linkedin.metadata.models.registry.SnapshotEntityRegistry;
|
import com.linkedin.metadata.models.registry.SnapshotEntityRegistry;
|
||||||
import io.ebean.EbeanServer;
|
import io.ebean.EbeanServer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class NoCodeUpgrade implements Upgrade {
|
public class NoCodeUpgrade implements Upgrade {
|
||||||
@ -48,7 +48,7 @@ public class NoCodeUpgrade implements Upgrade {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<UpgradeCleanupStep> buildCleanupSteps(final EbeanServer server) {
|
private List<UpgradeCleanupStep> buildCleanupSteps(final EbeanServer server) {
|
||||||
return ImmutableList.of(new CleanupStep(server));
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<UpgradeStep> buildUpgradeSteps(
|
private List<UpgradeStep> buildUpgradeSteps(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user