From bf21d504cfdef2932d223ce2b55958de4d43f029 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sat, 12 Dec 2020 17:16:46 +0100 Subject: [PATCH 001/306] Initial commit --- .gitignore | 23 +++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a1c2a23 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/README.md b/README.md new file mode 100644 index 0000000..492105d --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# micro-migration +Migration Lib for MicroStream From 8c05d379ae3abca7ec4bb43d881eabb793e04891 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sat, 12 Dec 2020 17:25:51 +0100 Subject: [PATCH 002/306] Raw structure implemented --- .classpath | 38 ++++ .gitignore | 1 + .project | 23 +++ .settings/org.eclipse.jdt.core.prefs | 16 ++ .settings/org.eclipse.m2e.core.prefs | 4 + pom.xml | 44 +++++ .../micromigration/MicroMigrationScript.java | 33 ++++ .../MigrationEmbeddedStorageManager.java | 178 ++++++++++++++++++ .../migrater/ExplicitMigrater.java | 23 +++ .../migrater/MicroMigrater.java | 34 ++++ .../version/MicroMigrationVersion.java | 72 +++++++ .../version/MicroStreamVersionedRoot.java | 33 ++++ 12 files changed, 499 insertions(+) create mode 100644 .classpath create mode 100644 .project create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs create mode 100644 pom.xml create mode 100644 src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..271ce0c --- /dev/null +++ b/.classpath @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index a1c2a23..c836fce 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +/target/ diff --git a/.project b/.project new file mode 100644 index 0000000..28a7634 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + micro-migration + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8b5c4dc --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,16 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..1a4bc4e --- /dev/null +++ b/pom.xml @@ -0,0 +1,44 @@ + + 4.0.0 + de.johannes_rabauer + micro-migration + 0.0.1-SNAPSHOT + MicroMigration + Migration Lib for MicroStream + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + + + + + microstream-releases + https://repo.microstream.one/repository/maven-public/ + + + + + one.microstream + storage.embedded + 04.00.00-MS-GA + + + one.microstream + storage.embedded.configuration + 04.00.00-MS-GA + + + \ No newline at end of file diff --git a/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java new file mode 100644 index 0000000..2b33a32 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java @@ -0,0 +1,33 @@ +package de.johannes_rabauer.micromigration; + +import java.util.Comparator; + +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +public interface MicroMigrationScript +{ + public final static char VERSION_SEPERATOR = '_'; + final static String WRONG_FORMAT_ERROR_MESSAGE = "Script has invalid class name. Either rename the class to a valid script class name, or implement method getTargetVersion()."; + + public default MicroMigrationVersion getTargetVersion() + { + final String implementationClassName = this.getClass().getSimpleName(); + int indexOfFirstVersionSeperator = implementationClassName.indexOf(VERSION_SEPERATOR); + if(indexOfFirstVersionSeperator < 0) + { + throw new Error(WRONG_FORMAT_ERROR_MESSAGE); + } + int majorVersion = Integer.parseInt(implementationClassName.substring(0, indexOfFirstVersionSeperator)); + return new MicroMigrationVersion(majorVersion); + } + + public void execute(); + + public static Comparator COMPARATOR = new Comparator() + { + @Override + public int compare(MicroMigrationScript o1, MicroMigrationScript o2) { + return MicroMigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); + } + }; +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..6c4d5ef --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -0,0 +1,178 @@ +package de.johannes_rabauer.micromigration; + +import java.util.function.Predicate; + +import de.johannes_rabauer.micromigration.version.MicroStreamVersionedRoot; +import one.microstream.afs.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.reference.Reference; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; + +public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager +{ + private final EmbeddedStorageManager nativeManager; + + public MigrationEmbeddedStorageManager(EmbeddedStorageManager nativeManager) + { + this.nativeManager = nativeManager; + } + + public EmbeddedStorageManager start() + { + this.nativeManager.start(); + if(!(this.nativeManager.root() instanceof MicroStreamVersionedRoot)) + { + //Build VersionedRoot around actual root, set by user. + MicroStreamVersionedRoot versionRoot = new MicroStreamVersionedRoot(this.nativeManager.root()); + nativeManager.setRoot(versionRoot); + } + return this; + } + + public Object root() { + // TODO Auto-generated method stub + return null; + } + + public Object setRoot(Object newRoot) { + // TODO Auto-generated method stub + return null; + } + // Simply forward all the other methods + + public StorageConfiguration configuration() { + // TODO Auto-generated method stub + return null; + } + + public StorageTypeDictionary typeDictionary() { + // TODO Auto-generated method stub + return null; + } + + public boolean shutdown() { + // TODO Auto-generated method stub + return false; + } + + public long storeRoot() { + // TODO Auto-generated method stub + return 0; + } + + public StorageConnection createConnection() { + // TODO Auto-generated method stub + return null; + } + + + public PersistenceRootsView viewRoots() { + // TODO Auto-generated method stub + return null; + } + + public Reference defaultRoot() { + // TODO Auto-generated method stub + return null; + } + + public Database database() { + // TODO Auto-generated method stub + return null; + } + + public boolean isAcceptingTasks() { + // TODO Auto-generated method stub + return false; + } + + public boolean isRunning() { + // TODO Auto-generated method stub + return false; + } + + public boolean isStartingUp() { + // TODO Auto-generated method stub + return false; + } + + public boolean isShuttingDown() { + // TODO Auto-generated method stub + return false; + } + + public void checkAcceptingTasks() { + // TODO Auto-generated method stub + + } + + public long initializationTime() { + // TODO Auto-generated method stub + return 0; + } + + public long operationModeTime() { + // TODO Auto-generated method stub + return 0; + } + + public boolean isActive() { + // TODO Auto-generated method stub + return false; + } + + public boolean issueGarbageCollection(long nanoTimeBudget) { + // TODO Auto-generated method stub + return false; + } + + public boolean issueFileCheck(long nanoTimeBudget) { + // TODO Auto-generated method stub + return false; + } + + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) { + // TODO Auto-generated method stub + return false; + } + + public StorageRawFileStatistics createStorageStatistics() { + // TODO Auto-generated method stub + return null; + } + + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { + // TODO Auto-generated method stub + + } + + public StorageEntityTypeExportStatistics exportTypes(StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) { + // TODO Auto-generated method stub + return null; + } + + public void importFiles(XGettingEnum importFiles) { + // TODO Auto-generated method stub + + } + + public PersistenceManager persistenceManager() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java new file mode 100644 index 0000000..03ca94f --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -0,0 +1,23 @@ +package de.johannes_rabauer.micromigration.migrater; + +import java.util.TreeSet; + +import de.johannes_rabauer.micromigration.MicroMigrationScript; + +public class ExplicitMigrater implements MicroMigrater +{ + private final TreeSet sortedScripts = new TreeSet<>(MicroMigrationScript.COMPARATOR); + + public ExplicitMigrater(MicroMigrationScript ...scripts) + { + for (MicroMigrationScript script : scripts) + { + this.sortedScripts.add(script); + } + } + + @Override + public TreeSet getSortedScripts() { + return this.sortedScripts; + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java new file mode 100644 index 0000000..fa7c0c5 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -0,0 +1,34 @@ +package de.johannes_rabauer.micromigration.migrater; + +import java.util.TreeSet; + +import de.johannes_rabauer.micromigration.MicroMigrationScript; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +public interface MicroMigrater +{ + public TreeSet getSortedScripts(); + + public default void migrateToNewest(MicroMigrationVersion fromVersion) + { + migrateToVersion(fromVersion, getSortedScripts().last().getTargetVersion()); + } + + public default void migrateToVersion + ( + MicroMigrationVersion fromVersion, + MicroMigrationVersion targetVersion + ) + { + for (MicroMigrationScript script : this.getSortedScripts()) + { + if(MicroMigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) <= 0) + { + if(MicroMigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) + { + script.execute(); + } + } + } + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java new file mode 100644 index 0000000..4180416 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java @@ -0,0 +1,72 @@ +package de.johannes_rabauer.micromigration.version; + +import java.util.Comparator; + +import de.johannes_rabauer.micromigration.MicroMigrationScript; + +public class MicroMigrationVersion +{ + private final int majorVersion; + private final int minorVersion; + private final int patchVersion; + + public MicroMigrationVersion + ( + int majorVersion + ) + { + this(majorVersion, 0); + } + + public MicroMigrationVersion + ( + int majorVersion, + int minorVersion + ) + { + this(majorVersion, minorVersion, 0); + } + + public MicroMigrationVersion + ( + int majorVersion, + int minorVersion, + int patchVersion + ) + { + this.majorVersion = majorVersion; + this.minorVersion = minorVersion; + this.patchVersion = patchVersion; + } + + public int getMajorVersion() { + return majorVersion; + } + + public int getMinorVersion() { + return minorVersion; + } + + public int getPatchVersion() { + return patchVersion; + } + + public static Comparator COMPARATOR = new Comparator() + { + @Override + public int compare(MicroMigrationVersion o1, MicroMigrationVersion o2) + { + int majorVersionCompare = Integer.compare(o1.majorVersion, o2.majorVersion); + if(majorVersionCompare != 0) + { + return majorVersionCompare; + } + int minorVersionCompare = Integer.compare(o1.minorVersion, o2.minorVersion); + if(minorVersionCompare != 0) + { + return minorVersionCompare; + } + return Integer.compare(o1.patchVersion, o2.patchVersion); + } + }; +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java new file mode 100644 index 0000000..62c0a4e --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java @@ -0,0 +1,33 @@ +package de.johannes_rabauer.micromigration.version; + +public class MicroStreamVersionedRoot +{ + private MicroMigrationVersion currentVersion; + private Object actualRoot ; + + public MicroStreamVersionedRoot(Object actualRoot) + { + setRoot(actualRoot); + setVersion(new MicroMigrationVersion(0,1,0)); + } + + public void setVersion(MicroMigrationVersion version) + { + this.currentVersion = version; + } + + public MicroMigrationVersion getVersion() + { + return this.currentVersion; + } + + public void setRoot(Object actualRoot) + { + this.actualRoot = actualRoot; + } + + public Object getRoot() + { + return this.actualRoot; + } +} From c418624c952f1dbaa0c2f2f2324e26396ff26f4d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sat, 12 Dec 2020 20:30:44 +0100 Subject: [PATCH 003/306] Update for the first working prototype --- pom.xml | 5 + .../MigrationEmbeddedStorage.java | 17 ++++ .../MigrationEmbeddedStorageManager.java | 98 ++++++++----------- 3 files changed, 63 insertions(+), 57 deletions(-) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java diff --git a/pom.xml b/pom.xml index 1a4bc4e..67b6b09 100644 --- a/pom.xml +++ b/pom.xml @@ -40,5 +40,10 @@ storage.embedded.configuration 04.00.00-MS-GA + + one.microstream + storage.embedded.configuration + 04.00.00-MS-GA + \ No newline at end of file diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java new file mode 100644 index 0000000..57ee421 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -0,0 +1,17 @@ +package de.johannes_rabauer.micromigration; + +import one.microstream.storage.configuration.Configuration; +import one.microstream.storage.types.EmbeddedStorage; +import one.microstream.storage.types.EmbeddedStorageManager; + +public class MigrationEmbeddedStorage +{ + public static final MigrationEmbeddedStorageManager start() + { + return new MigrationEmbeddedStorageManager( + Configuration.Default() + .createEmbeddedStorageFoundation() + .createEmbeddedStorageManager() + ).start(); + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index 6c4d5ef..6f63690 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -23,156 +23,140 @@ public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager { - private final EmbeddedStorageManager nativeManager; + private final EmbeddedStorageManager nativeManager; + private MicroStreamVersionedRoot versionRoot ; public MigrationEmbeddedStorageManager(EmbeddedStorageManager nativeManager) { this.nativeManager = nativeManager; } - public EmbeddedStorageManager start() + public MigrationEmbeddedStorageManager start() { this.nativeManager.start(); - if(!(this.nativeManager.root() instanceof MicroStreamVersionedRoot)) + if(this.nativeManager.root() instanceof MicroStreamVersionedRoot) + { + this.versionRoot = (MicroStreamVersionedRoot)this.nativeManager.root(); + } + else { //Build VersionedRoot around actual root, set by user. - MicroStreamVersionedRoot versionRoot = new MicroStreamVersionedRoot(this.nativeManager.root()); + this.versionRoot = new MicroStreamVersionedRoot(this.nativeManager.root()); nativeManager.setRoot(versionRoot); } return this; } public Object root() { - // TODO Auto-generated method stub - return null; + return this.versionRoot.getRoot(); } public Object setRoot(Object newRoot) { - // TODO Auto-generated method stub - return null; + this.versionRoot.setRoot(newRoot); + return newRoot; } + + //////////////////////////////////////////////////////////////// // Simply forward all the other methods + //////////////////////////////////////////////////////////////// public StorageConfiguration configuration() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.configuration(); } public StorageTypeDictionary typeDictionary() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.typeDictionary(); } - public boolean shutdown() { - // TODO Auto-generated method stub - return false; + public boolean shutdown() + { + return this.nativeManager.shutdown(); } public long storeRoot() { - // TODO Auto-generated method stub - return 0; + return this.nativeManager.storeRoot(); } public StorageConnection createConnection() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.createConnection(); } public PersistenceRootsView viewRoots() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.viewRoots(); } public Reference defaultRoot() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.defaultRoot(); } public Database database() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.database(); } public boolean isAcceptingTasks() { - // TODO Auto-generated method stub - return false; + return this.nativeManager.isAcceptingTasks(); } public boolean isRunning() { - // TODO Auto-generated method stub - return false; + return this.nativeManager.isRunning(); } public boolean isStartingUp() { - // TODO Auto-generated method stub - return false; + return this.nativeManager.isStartingUp(); } public boolean isShuttingDown() { - // TODO Auto-generated method stub - return false; + return this.nativeManager.isShuttingDown(); } public void checkAcceptingTasks() { - // TODO Auto-generated method stub - + this.nativeManager.checkAcceptingTasks(); } public long initializationTime() { - // TODO Auto-generated method stub - return 0; + return this.nativeManager.initializationTime(); } public long operationModeTime() { - // TODO Auto-generated method stub - return 0; + return this.nativeManager.operationModeTime(); } public boolean isActive() { - // TODO Auto-generated method stub - return false; + return this.nativeManager.isActive(); } public boolean issueGarbageCollection(long nanoTimeBudget) { - // TODO Auto-generated method stub - return false; + return this.nativeManager.issueGarbageCollection(nanoTimeBudget); } public boolean issueFileCheck(long nanoTimeBudget) { - // TODO Auto-generated method stub - return false; + return this.nativeManager.issueFileCheck(nanoTimeBudget); } public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) { - // TODO Auto-generated method stub - return false; + return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); } public StorageRawFileStatistics createStorageStatistics() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.createStorageStatistics(); } public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { - // TODO Auto-generated method stub - + this.nativeManager.exportChannels(fileProvider, performGarbageCollection); } public StorageEntityTypeExportStatistics exportTypes(StorageEntityTypeExportFileProvider exportFileProvider, Predicate isExportType) { - // TODO Auto-generated method stub - return null; + return this.nativeManager.exportTypes(exportFileProvider, isExportType); } public void importFiles(XGettingEnum importFiles) { - // TODO Auto-generated method stub - + this.nativeManager.importFiles(importFiles); } public PersistenceManager persistenceManager() { - // TODO Auto-generated method stub - return null; + return this.nativeManager.persistenceManager(); } } From 951b2130e8802a3429588a1e71bdb2881a619bce Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 13 Dec 2020 18:54:39 +0100 Subject: [PATCH 004/306] Further updates for first stage to functionality --- .../micromigration/MicroMigrationScript.java | 5 ++- .../MigrationEmbeddedStorage.java | 14 ++++++-- .../MigrationEmbeddedStorageManager.java | 24 +++++++++++-- .../migrater/MicroMigrater.java | 34 +++++++++++++++---- .../version/MicroMigrationVersion.java | 7 ++-- 5 files changed, 69 insertions(+), 15 deletions(-) diff --git a/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java index 2b33a32..e9dbce5 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java @@ -21,7 +21,10 @@ public default MicroMigrationVersion getTargetVersion() return new MicroMigrationVersion(majorVersion); } - public void execute(); + public void execute( + Object root , + MigrationEmbeddedStorageManager storageManager + ); public static Comparator COMPARATOR = new Comparator() { diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java index 57ee421..631520c 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -1,17 +1,25 @@ package de.johannes_rabauer.micromigration; +import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import one.microstream.storage.configuration.Configuration; import one.microstream.storage.types.EmbeddedStorage; import one.microstream.storage.types.EmbeddedStorageManager; -public class MigrationEmbeddedStorage +public class MigrationEmbeddedStorage { - public static final MigrationEmbeddedStorageManager start() + /** + * Warning "resource" is suppressed because it is used and closed in the @link {@link MigrationEmbeddedStorageManager}. + * @param migrater + * @return + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) { return new MigrationEmbeddedStorageManager( Configuration.Default() .createEmbeddedStorageFoundation() - .createEmbeddedStorageManager() + .createEmbeddedStorageManager(), + migrater ).start(); } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index 6f63690..db91a18 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -2,6 +2,8 @@ import java.util.function.Predicate; +import de.johannes_rabauer.micromigration.migrater.MicroMigrater; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; import de.johannes_rabauer.micromigration.version.MicroStreamVersionedRoot; import one.microstream.afs.AFile; import one.microstream.collections.types.XGettingEnum; @@ -23,12 +25,17 @@ public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager { - private final EmbeddedStorageManager nativeManager; + private final EmbeddedStorageManager nativeManager; + private final MicroMigrater migrater ; private MicroStreamVersionedRoot versionRoot ; - public MigrationEmbeddedStorageManager(EmbeddedStorageManager nativeManager) + public MigrationEmbeddedStorageManager( + EmbeddedStorageManager nativeManager, + MicroMigrater migrater + ) { this.nativeManager = nativeManager; + this.migrater = migrater ; } public MigrationEmbeddedStorageManager start() @@ -44,6 +51,18 @@ public MigrationEmbeddedStorageManager start() this.versionRoot = new MicroStreamVersionedRoot(this.nativeManager.root()); nativeManager.setRoot(versionRoot); } + // Execute Updates + final MicroMigrationVersion versionAfterUpdate = migrater.migrateToNewest( + this.versionRoot.getVersion(), + this , + this.versionRoot.getRoot() + ); + //Update stored version, if needed + if(versionAfterUpdate != this.versionRoot.getVersion()) + { + this.versionRoot.setVersion(versionAfterUpdate); + nativeManager.storeRoot(); + } return this; } @@ -86,6 +105,7 @@ public PersistenceRootsView viewRoots() { return this.nativeManager.viewRoots(); } + @Deprecated public Reference defaultRoot() { return this.nativeManager.defaultRoot(); } diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index fa7c0c5..ecccce7 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -3,32 +3,52 @@ import java.util.TreeSet; import de.johannes_rabauer.micromigration.MicroMigrationScript; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; public interface MicroMigrater { public TreeSet getSortedScripts(); - public default void migrateToNewest(MicroMigrationVersion fromVersion) + public default MicroMigrationVersion migrateToNewest( + MicroMigrationVersion fromVersion , + MigrationEmbeddedStorageManager storageManager, + Object root + ) { - migrateToVersion(fromVersion, getSortedScripts().last().getTargetVersion()); + TreeSet sortedScripts = getSortedScripts(); + if(sortedScripts.size() > 0) + { + return migrateToVersion( + fromVersion , + getSortedScripts().last().getTargetVersion(), + storageManager , + root + ); + } + return fromVersion; } - public default void migrateToVersion + public default MicroMigrationVersion migrateToVersion ( - MicroMigrationVersion fromVersion, - MicroMigrationVersion targetVersion + MicroMigrationVersion fromVersion , + MicroMigrationVersion targetVersion , + MigrationEmbeddedStorageManager storageManager, + Object root ) { + MicroMigrationVersion updateVersionWhichWasExecuted = fromVersion; for (MicroMigrationScript script : this.getSortedScripts()) { - if(MicroMigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) <= 0) + if(MicroMigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) { if(MicroMigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) { - script.execute(); + script.execute(root, storageManager); + updateVersionWhichWasExecuted = script.getTargetVersion(); } } } + return updateVersionWhichWasExecuted; } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java index 4180416..d6e69da 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java @@ -2,8 +2,6 @@ import java.util.Comparator; -import de.johannes_rabauer.micromigration.MicroMigrationScript; - public class MicroMigrationVersion { private final int majorVersion; @@ -51,6 +49,11 @@ public int getPatchVersion() { return patchVersion; } + @Override + public String toString() { + return "v" + this.majorVersion + "." + this.minorVersion + "." + this.patchVersion; + } + public static Comparator COMPARATOR = new Comparator() { @Override From f246ca4e2f9c74cb42580de72c4dc90c0080aea6 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 13 Dec 2020 21:55:36 +0100 Subject: [PATCH 005/306] Provided some documentation --- README.md | 44 ++++++++++++++++++- .../micromigration/MicroMigrationScript.java | 10 +++++ .../MigrationEmbeddedStorage.java | 7 +++ .../MigrationEmbeddedStorageManager.java | 10 +++++ .../migrater/ExplicitMigrater.java | 10 +++++ .../migrater/MicroMigrater.java | 12 ++++- .../version/MicroMigrationVersion.java | 6 +++ .../version/MicroStreamVersionedRoot.java | 7 +++ 8 files changed, 103 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 492105d..ac6bccd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ # micro-migration -Migration Lib for MicroStream +Migration Lib for MicroStream. + +This library deliveres an easy concept to keep your MicroStream datastore versioned +with migration scripts written in plain java. + +## Usage example +A simple example where scripts need to be registered in the `ExplicitMigrater`: +```java +public static void main(String[] args) +{ + final ExplicitMigrater migrater = new ExplicitMigrater( + new UpdateToV1_0(), + new UpdateToV1_1() + ); + final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); + System.out.println(storageManager.root()); + if(storageManager.root() == null) + { + storageManager.setRoot("Hello World! @ " + new Date()); + } + storageManager.storeRoot(); + storageManager.shutdown(); +} +``` +The update scripts can look like this: +```java +public class UpdateToV1_0 implements MicroMigrationScript +{ + public MicroMigrationVersion getTargetVersion() + { + return new MicroMigrationVersion(1,0); + } + + public void execute( + Object root , + MigrationEmbeddedStorageManager storageManager + ) + { + System.out.println("Update " + getTargetVersion().toString() + " executed."); + storageManager.setRoot("Hello World! @ " + new Date() + " Update 1.0"); + } +} +``` \ No newline at end of file diff --git a/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java index e9dbce5..a05163e 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java @@ -4,6 +4,16 @@ import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +/** + * Interface for scripts to migrate / update datastores. + *

+ * One script is supposed to bring a datastore from a lower version to the target version. + * After the {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} method is called, + * the target version is reached. + * + * @author Johannes Rabauer + * + */ public interface MicroMigrationScript { public final static char VERSION_SEPERATOR = '_'; diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java index 631520c..36009f9 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -5,6 +5,13 @@ import one.microstream.storage.types.EmbeddedStorage; import one.microstream.storage.types.EmbeddedStorageManager; +/** + * Wrapper class for the MicroStream {@link EmbeddedStorage} utility class. + * Produces {@link MigrationEmbeddedStorageManager} for updateable datastores. + * + * @author Johannes Rabauer + * + */ public class MigrationEmbeddedStorage { /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index db91a18..af30e00 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -12,6 +12,7 @@ import one.microstream.persistence.types.PersistenceRootsView; import one.microstream.reference.Reference; import one.microstream.storage.types.Database; +import one.microstream.storage.types.EmbeddedStorage; import one.microstream.storage.types.EmbeddedStorageManager; import one.microstream.storage.types.StorageConfiguration; import one.microstream.storage.types.StorageConnection; @@ -23,6 +24,15 @@ import one.microstream.storage.types.StorageRawFileStatistics; import one.microstream.storage.types.StorageTypeDictionary; +/** + * Wrapper class for the MicroStream {@link EmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link MicroStreamVersionedRoot} + * in front of it. This means the datastore is then versioned. + * + * @author Johannes Rabauer + * + */ public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager { private final EmbeddedStorageManager nativeManager; diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 03ca94f..cb15015 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -3,7 +3,17 @@ import java.util.TreeSet; import de.johannes_rabauer.micromigration.MicroMigrationScript; +import de.johannes_rabauer.micromigration.version.MicroStreamVersionedRoot; +import one.microstream.storage.types.EmbeddedStorageManager; +/** + * Executes all the available scripts to migrate the datastore to a certain version. + *

+ * This class needs explicit scripts which are then included in the migration process. + * + * @author Johannes Rabauer + * + */ public class ExplicitMigrater implements MicroMigrater { private final TreeSet sortedScripts = new TreeSet<>(MicroMigrationScript.COMPARATOR); diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index ecccce7..aa25406 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -5,10 +5,18 @@ import de.johannes_rabauer.micromigration.MicroMigrationScript; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MicroStreamVersionedRoot; +import one.microstream.storage.types.EmbeddedStorageManager; +/** + * Executes all the available scripts to migrate the datastore to a certain version. + * + * @author Johannes Rabauer + * + */ public interface MicroMigrater { - public TreeSet getSortedScripts(); + public TreeSet getSortedScripts(); public default MicroMigrationVersion migrateToNewest( MicroMigrationVersion fromVersion , @@ -16,7 +24,7 @@ public default MicroMigrationVersion migrateToNewest( Object root ) { - TreeSet sortedScripts = getSortedScripts(); + TreeSet sortedScripts = getSortedScripts(); if(sortedScripts.size() > 0) { return migrateToVersion( diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java index d6e69da..f734297 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java @@ -2,6 +2,12 @@ import java.util.Comparator; +/** + * Defines one version of the MicroStream datastore. + * + * @author Johannes Rabauer + * + */ public class MicroMigrationVersion { private final int majorVersion; diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java index 62c0a4e..13da04d 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java @@ -1,5 +1,12 @@ package de.johannes_rabauer.micromigration.version; +/** + * This class is inserted as the root of the MicroStream datastore and contains only the + * current version and the actual root object. + * + * @author Johannes Rabauer + * + */ public class MicroStreamVersionedRoot { private MicroMigrationVersion currentVersion; From 11f9aaa329bf061a9cd17708006535ead99a5f80 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 14 Dec 2020 20:08:20 +0100 Subject: [PATCH 006/306] Fixed warnings and tried implementing AutoRegisteringMigrater --- .../AutoRegisteringMigrationScript.java | 20 +++++++++++ .../MigrationEmbeddedStorage.java | 1 - .../MigrationEmbeddedStorageManager.java | 1 - .../migrater/AutoRegisteringMigrater.java | 35 +++++++++++++++++++ .../migrater/ExplicitMigrater.java | 2 -- .../migrater/MicroMigrater.java | 2 -- 6 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/AutoRegisteringMigrationScript.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/AutoRegisteringMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/AutoRegisteringMigrationScript.java new file mode 100644 index 0000000..88d9507 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/AutoRegisteringMigrationScript.java @@ -0,0 +1,20 @@ +package de.johannes_rabauer.micromigration; + +import de.johannes_rabauer.micromigration.migrater.AutoRegisteringMigrater; + +/** + * Extending classes can easily auto register at the {@link AutoRegisteringMigrater}.
+ * Is not usable yet! + * + * @author Johannes Rabauer + * + */ +@Deprecated +public abstract class AutoRegisteringMigrationScript implements MicroMigrationScript +{ + protected static AutoRegisteringMigrationScript registerSelf(AutoRegisteringMigrationScript script) + { + AutoRegisteringMigrater.registerScript(script); + return script; + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java index 36009f9..37ce7ab 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -3,7 +3,6 @@ import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import one.microstream.storage.configuration.Configuration; import one.microstream.storage.types.EmbeddedStorage; -import one.microstream.storage.types.EmbeddedStorageManager; /** * Wrapper class for the MicroStream {@link EmbeddedStorage} utility class. diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index af30e00..c9347d8 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -12,7 +12,6 @@ import one.microstream.persistence.types.PersistenceRootsView; import one.microstream.reference.Reference; import one.microstream.storage.types.Database; -import one.microstream.storage.types.EmbeddedStorage; import one.microstream.storage.types.EmbeddedStorageManager; import one.microstream.storage.types.StorageConfiguration; import one.microstream.storage.types.StorageConnection; diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java new file mode 100644 index 0000000..61bc8a6 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java @@ -0,0 +1,35 @@ +package de.johannes_rabauer.micromigration.migrater; + +import java.util.TreeSet; + +import de.johannes_rabauer.micromigration.AutoRegisteringMigrationScript; +import de.johannes_rabauer.micromigration.MicroMigrationScript; + +/** + * Executes all the scripts which can register themselves.
+ * Is not usable yet! + * @author Johannes Rabauer + * + */ +@Deprecated +public class AutoRegisteringMigrater implements MicroMigrater +{ + private final static TreeSet SORTED_SCRIPTS = new TreeSet<>(MicroMigrationScript.COMPARATOR); + + public final static AutoRegisteringMigrater INSTANCE = new AutoRegisteringMigrater(); + + private AutoRegisteringMigrater() + { + + } + + public static final void registerScript(AutoRegisteringMigrationScript script) + { + SORTED_SCRIPTS.add(script); + } + + @Override + public TreeSet getSortedScripts() { + return SORTED_SCRIPTS; + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index cb15015..1f3e956 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -3,8 +3,6 @@ import java.util.TreeSet; import de.johannes_rabauer.micromigration.MicroMigrationScript; -import de.johannes_rabauer.micromigration.version.MicroStreamVersionedRoot; -import one.microstream.storage.types.EmbeddedStorageManager; /** * Executes all the available scripts to migrate the datastore to a certain version. diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index aa25406..0478f28 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -5,8 +5,6 @@ import de.johannes_rabauer.micromigration.MicroMigrationScript; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; -import de.johannes_rabauer.micromigration.version.MicroStreamVersionedRoot; -import one.microstream.storage.types.EmbeddedStorageManager; /** * Executes all the available scripts to migrate the datastore to a certain version. From 2128ffd529411caba8398b93b7bbb46351b538e4 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 14 Dec 2020 21:02:16 +0100 Subject: [PATCH 007/306] Implemented some tests --- .classpath | 1 + .../MigrationEmbeddedStorage.java | 22 +++++++++- .../MigrationEmbeddedStorageManager.java | 32 ++++++++++++++ ...IntroduceMigrationOnExistingDatastore.java | 42 +++++++++++++++++++ .../migrater/ExplicitMigraterTest.java | 39 +++++++++++++++++ .../testUtil/MicroMigrationScriptDummy.java | 27 ++++++++++++ 6 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java create mode 100644 src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java create mode 100644 src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java diff --git a/.classpath b/.classpath index 271ce0c..6bc00bc 100644 --- a/.classpath +++ b/.classpath @@ -34,5 +34,6 @@ + diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java index 37ce7ab..612e797 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -1,5 +1,7 @@ package de.johannes_rabauer.micromigration; +import java.nio.file.Path; + import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import one.microstream.storage.configuration.Configuration; import one.microstream.storage.types.EmbeddedStorage; @@ -15,8 +17,6 @@ public class MigrationEmbeddedStorage { /** * Warning "resource" is suppressed because it is used and closed in the @link {@link MigrationEmbeddedStorageManager}. - * @param migrater - * @return */ @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) @@ -28,4 +28,22 @@ public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater migrater ).start(); } + + /** + * Warning "resource" is suppressed because it is used and closed in the @link {@link MigrationEmbeddedStorageManager}. + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start( + Path storageDirectory, + MicroMigrater migrater + ) + { + return new MigrationEmbeddedStorageManager( + Configuration.Default() + .setBaseDirectory(storageDirectory.toAbsolutePath().toString()) + .createEmbeddedStorageFoundation() + .createEmbeddedStorageManager(), + migrater + ).start(); + } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index c9347d8..724896f 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -47,6 +47,7 @@ public MigrationEmbeddedStorageManager( this.migrater = migrater ; } + @Override public MigrationEmbeddedStorageManager start() { this.nativeManager.start(); @@ -74,11 +75,18 @@ public MigrationEmbeddedStorageManager start() } return this; } + + public MicroMigrationVersion getCurrentVersion() + { + return this.versionRoot.getVersion(); + } + @Override public Object root() { return this.versionRoot.getRoot(); } + @Override public Object setRoot(Object newRoot) { this.versionRoot.setRoot(newRoot); return newRoot; @@ -88,102 +96,126 @@ public Object setRoot(Object newRoot) { // Simply forward all the other methods //////////////////////////////////////////////////////////////// + @Override public StorageConfiguration configuration() { return this.nativeManager.configuration(); } + @Override public StorageTypeDictionary typeDictionary() { return this.nativeManager.typeDictionary(); } + @Override public boolean shutdown() { return this.nativeManager.shutdown(); } + @Override public long storeRoot() { return this.nativeManager.storeRoot(); } + @Override public StorageConnection createConnection() { return this.nativeManager.createConnection(); } + @Override public PersistenceRootsView viewRoots() { return this.nativeManager.viewRoots(); } + @Override @Deprecated public Reference defaultRoot() { return this.nativeManager.defaultRoot(); } + @Override public Database database() { return this.nativeManager.database(); } + @Override public boolean isAcceptingTasks() { return this.nativeManager.isAcceptingTasks(); } + @Override public boolean isRunning() { return this.nativeManager.isRunning(); } + @Override public boolean isStartingUp() { return this.nativeManager.isStartingUp(); } + @Override public boolean isShuttingDown() { return this.nativeManager.isShuttingDown(); } + @Override public void checkAcceptingTasks() { this.nativeManager.checkAcceptingTasks(); } + @Override public long initializationTime() { return this.nativeManager.initializationTime(); } + @Override public long operationModeTime() { return this.nativeManager.operationModeTime(); } + @Override public boolean isActive() { return this.nativeManager.isActive(); } + @Override public boolean issueGarbageCollection(long nanoTimeBudget) { return this.nativeManager.issueGarbageCollection(nanoTimeBudget); } + @Override public boolean issueFileCheck(long nanoTimeBudget) { return this.nativeManager.issueFileCheck(nanoTimeBudget); } + @Override public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) { return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); } + @Override public StorageRawFileStatistics createStorageStatistics() { return this.nativeManager.createStorageStatistics(); } + @Override public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { this.nativeManager.exportChannels(fileProvider, performGarbageCollection); } + @Override public StorageEntityTypeExportStatistics exportTypes(StorageEntityTypeExportFileProvider exportFileProvider, Predicate isExportType) { return this.nativeManager.exportTypes(exportFileProvider, isExportType); } + @Override public void importFiles(XGettingEnum importFiles) { this.nativeManager.importFiles(importFiles); } + @Override public PersistenceManager persistenceManager() { return this.nativeManager.persistenceManager(); } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java new file mode 100644 index 0000000..e712e24 --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java @@ -0,0 +1,42 @@ +package de.johannes_rabauer.micromigration.integration; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; +import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import one.microstream.storage.types.EmbeddedStorage; +import one.microstream.storage.types.EmbeddedStorageManager; + +class IntroduceMigrationOnExistingDatastore +{ + final static String ROOT = "OriginalRoot"; + + @Test + public void testMigration(@TempDir Path storageFolder) throws IOException + { + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) + { + storageManager.setRoot(ROOT); + storageManager.storeRoot(); + } + + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MicroMigrationVersion(1)) + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(ROOT, migrationStorageManager.root()); + assertEquals(1, migrationStorageManager.getCurrentVersion().getMajorVersion()); + } + } + +} diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java new file mode 100644 index 0000000..5433abb --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java @@ -0,0 +1,39 @@ +package de.johannes_rabauer.micromigration.migrater; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +class ExplicitMigraterTest +{ + + @Test + void testGetSortedScripts_empty() { + final ExplicitMigrater migrater = new ExplicitMigrater(); + assertEquals(0,migrater.getSortedScripts().size()); + } + + @Test + void testGetSortedScripts_sorted() { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MicroMigrationVersion(1)), + new MicroMigrationScriptDummy(new MicroMigrationVersion(2)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getMajorVersion()); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getMajorVersion()); + } + + @Test + void testGetSortedScripts_unsorted() { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MicroMigrationVersion(2)), + new MicroMigrationScriptDummy(new MicroMigrationVersion(1)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getMajorVersion()); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getMajorVersion()); + } + +} diff --git a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java new file mode 100644 index 0000000..839ea88 --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -0,0 +1,27 @@ +package de.johannes_rabauer.micromigration.testUtil; + +import de.johannes_rabauer.micromigration.MicroMigrationScript; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +public class MicroMigrationScriptDummy implements MicroMigrationScript +{ + private final MicroMigrationVersion version; + + public MicroMigrationScriptDummy(MicroMigrationVersion version) + { + this.version = version; + } + + @Override + public MicroMigrationVersion getTargetVersion() + { + return this.version; + } + + @Override + public void execute(Object root, MigrationEmbeddedStorageManager storageManager) { + // Don't do anything. + } + +} From f3ff7fd2d998217b667da1b0113765da43a7bafc Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 15 Dec 2020 21:06:05 +0100 Subject: [PATCH 008/306] Small refactorings --- .../migrater/AutoRegisteringMigrater.java | 4 +- .../migrater/ExplicitMigrater.java | 2 +- .../migrater/MicroMigrater.java | 2 +- .../AutoRegisteringMigrationScript.java | 2 +- .../{ => scripts}/MicroMigrationScript.java | 3 +- .../scripts/SimpleMigrationScript.java | 34 +++++++++++ .../version/MicroMigrationVersion.java | 30 ++++++++++ .../version/MicroStreamVersionedRoot.java | 2 +- ...IntroduceMigrationOnExistingDatastore.java | 2 +- .../MigrationScriptAfterScript.java | 57 +++++++++++++++++++ .../testUtil/MicroMigrationScriptDummy.java | 2 +- 11 files changed, 131 insertions(+), 9 deletions(-) rename src/main/java/de/johannes_rabauer/micromigration/{ => scripts}/AutoRegisteringMigrationScript.java (90%) rename src/main/java/de/johannes_rabauer/micromigration/{ => scripts}/MicroMigrationScript.java (92%) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java create mode 100644 src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java index 61bc8a6..2e7aa17 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java @@ -2,8 +2,8 @@ import java.util.TreeSet; -import de.johannes_rabauer.micromigration.AutoRegisteringMigrationScript; -import de.johannes_rabauer.micromigration.MicroMigrationScript; +import de.johannes_rabauer.micromigration.scripts.AutoRegisteringMigrationScript; +import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; /** * Executes all the scripts which can register themselves.
diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 1f3e956..55b4729 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -2,7 +2,7 @@ import java.util.TreeSet; -import de.johannes_rabauer.micromigration.MicroMigrationScript; +import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; /** * Executes all the available scripts to migrate the datastore to a certain version. diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 0478f28..18ac893 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -2,8 +2,8 @@ import java.util.TreeSet; -import de.johannes_rabauer.micromigration.MicroMigrationScript; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/AutoRegisteringMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/AutoRegisteringMigrationScript.java similarity index 90% rename from src/main/java/de/johannes_rabauer/micromigration/AutoRegisteringMigrationScript.java rename to src/main/java/de/johannes_rabauer/micromigration/scripts/AutoRegisteringMigrationScript.java index 88d9507..5d167d8 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/AutoRegisteringMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/AutoRegisteringMigrationScript.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration; +package de.johannes_rabauer.micromigration.scripts; import de.johannes_rabauer.micromigration.migrater.AutoRegisteringMigrater; diff --git a/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java similarity index 92% rename from src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java rename to src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java index a05163e..cafa75a 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MicroMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java @@ -1,7 +1,8 @@ -package de.johannes_rabauer.micromigration; +package de.johannes_rabauer.micromigration.scripts; import java.util.Comparator; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java new file mode 100644 index 0000000..d2575c3 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -0,0 +1,34 @@ +package de.johannes_rabauer.micromigration.scripts; + +import java.util.function.BiConsumer; + +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +public class SimpleMigrationScript implements MicroMigrationScript +{ + private final MicroMigrationVersion version; + private final BiConsumer consumer; + + public SimpleMigrationScript( + final MicroMigrationVersion version, + final BiConsumer consumer + ) + { + this.version = version ; + this.consumer = consumer; + } + + @Override + public MicroMigrationVersion getTargetVersion() + { + return this.version; + } + + @Override + public void execute(Object root, MigrationEmbeddedStorageManager storageManager) + { + this.consumer.accept(root, storageManager); + } + +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java index f734297..9e576c6 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java @@ -78,4 +78,34 @@ public int compare(MicroMigrationVersion o1, MicroMigrationVersion o2) return Integer.compare(o1.patchVersion, o2.patchVersion); } }; + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + majorVersion; + result = prime * result + minorVersion; + result = prime * result + patchVersion; + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + MicroMigrationVersion other = (MicroMigrationVersion) obj; + if (majorVersion != other.majorVersion) + return false; + if (minorVersion != other.minorVersion) + return false; + if (patchVersion != other.patchVersion) + return false; + return true; + } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java index 13da04d..21b2301 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java @@ -15,7 +15,7 @@ public class MicroStreamVersionedRoot public MicroStreamVersionedRoot(Object actualRoot) { setRoot(actualRoot); - setVersion(new MicroMigrationVersion(0,1,0)); + setVersion(new MicroMigrationVersion(0,0,0)); } public void setVersion(MicroMigrationVersion version) diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java index e712e24..024af9b 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java @@ -21,7 +21,7 @@ class IntroduceMigrationOnExistingDatastore final static String ROOT = "OriginalRoot"; @Test - public void testMigration(@TempDir Path storageFolder) throws IOException + public void testIntroducingMigrationOnExistingDatastore(@TempDir Path storageFolder) throws IOException { try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) { diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java new file mode 100644 index 0000000..5ebdc04 --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java @@ -0,0 +1,57 @@ +package de.johannes_rabauer.micromigration.integration; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; +import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; +import de.johannes_rabauer.micromigration.scripts.SimpleMigrationScript; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +class MigrationScriptAfterScript +{ + @Test + public void testMigrationWithThreeDifferenMigrater(@TempDir Path storageFolder) throws IOException + { + //First run without any migration script + final ExplicitMigrater firstMigrater = new ExplicitMigrater(); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, firstMigrater)) + { + migrationStorageManager.setRoot(0); + assertEquals(0, migrationStorageManager.root()); + assertEquals(new MicroMigrationVersion(0,0,0), migrationStorageManager.getCurrentVersion()); + } + + //Run with one migration script + final MicroMigrationScript firstScript = new SimpleMigrationScript( + new MicroMigrationVersion(1), + (root, storage) -> storage.setRoot(1) + ); + final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + { + assertEquals(1, migrationStorageManager.root()); + assertEquals(new MicroMigrationVersion(1,0,0), migrationStorageManager.getCurrentVersion()); + } + + //Run with two migration scripts + final MicroMigrationScript secondScript = new SimpleMigrationScript( + new MicroMigrationVersion(2), + (root, storage) -> storage.setRoot(2) + ); + final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) + { + assertEquals(2, migrationStorageManager.root()); + assertEquals(new MicroMigrationVersion(2,0,0), migrationStorageManager.getCurrentVersion()); + } + } + +} diff --git a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java index 839ea88..7c94403 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,7 +1,7 @@ package de.johannes_rabauer.micromigration.testUtil; -import de.johannes_rabauer.micromigration.MicroMigrationScript; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; public class MicroMigrationScriptDummy implements MicroMigrationScript From 0911ba0b7ca2046d76b0c048dba36313504880ba Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 15 Dec 2020 21:33:37 +0100 Subject: [PATCH 009/306] Extended README.md --- README.md | 58 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index ac6bccd..ed3eb53 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,22 @@ # micro-migration Migration Lib for MicroStream. -This library deliveres an easy concept to keep your MicroStream datastore versioned +This library delivers an easy concept to keep your MicroStream datastore versioned with migration scripts written in plain java. +It can be used on a brand new datastore or introduced later, after a MicroStream datastore is already in use. +Only the storage manager (`MigrationEmbeddedStorageManager`) knows about the versioning. +The rest of application does not know about the version and can have no regards about it. + ## Usage example +Extensive examples can be found in its [own repository](https://github.com/JohannesRabauer/micro-migration-examples). A simple example where scripts need to be registered in the `ExplicitMigrater`: ```java public static void main(String[] args) { - final ExplicitMigrater migrater = new ExplicitMigrater( - new UpdateToV1_0(), - new UpdateToV1_1() - ); + final ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); - System.out.println(storageManager.root()); - if(storageManager.root() == null) - { - storageManager.setRoot("Hello World! @ " + new Date()); - } - storageManager.storeRoot(); + //Do some business logic storageManager.shutdown(); } ``` @@ -27,18 +24,37 @@ The update scripts can look like this: ```java public class UpdateToV1_0 implements MicroMigrationScript { - public MicroMigrationVersion getTargetVersion() - { + public MicroMigrationVersion getTargetVersion(){ return new MicroMigrationVersion(1,0); } - public void execute( - Object root , - MigrationEmbeddedStorageManager storageManager - ) - { - System.out.println("Update " + getTargetVersion().toString() + " executed."); - storageManager.setRoot("Hello World! @ " + new Date() + " Update 1.0"); + public void execute(Object root, MigrationEmbeddedStorageManager storageManager){ + //Logic of the update + storageManager.setRoot("Update 1.0"); } } -``` \ No newline at end of file +``` + +## Migrater +### `ExplicitMigrater` +Scripts for the migrations must be registered in a `MicroMigrater`. +The simplest way for this is to use the `ExplicitMigrater` and just put the scripts in the constructor. +A downside of this method is that you need to register all scripts (new or old) manually in the constructor. + +```java +final ExplicitMigrater migrater = new ExplicitMigrater( + new UpdateToV1_0(), + new UpdateToV1_1() +); +``` + +### `ReflectiveMigrater` +For a more convenient usage the `ReflectiveMigrater` was built. +You simply instanciate a object of this class with the package name of your `MicroMigrationScript`s. +The `ReflectiveMigrater` will search for any implementations of `MicroMigrationScript` in the given package. +This way scripts can simply be placed in the same package and on startup of the application all scripts are loaded in. + +```java +final ReflectiveMigrater migrater = new ReflectiveMigrater("de.johannes_rabauer.micromigration.examples.reflective.scripts"); +``` +Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own repository](https://github.com/JohannesRabauer/micro-migration-reflection). \ No newline at end of file From e27b9c5a3442e25946cbc91313233f07496ec73b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 16 Dec 2020 21:40:47 +0100 Subject: [PATCH 010/306] Added some JavaDoc, NonNull-Checks and JUnit Tests --- .../MigrationEmbeddedStorage.java | 28 +++- .../MigrationEmbeddedStorageManager.java | 20 +++ .../migrater/ExplicitMigrater.java | 3 + .../migrater/MicroMigrater.java | 46 ++++++ .../scripts/MicroMigrationScript.java | 17 +-- .../ReflectiveVersionMigrationScript.java | 81 +++++++++++ .../scripts/SimpleMigrationScript.java | 3 + .../version/MicroMigrationVersion.java | 38 ++--- .../version/MicroStreamVersionedRoot.java | 3 + .../ReflectiveVersionMigrationScriptTest.java | 136 ++++++++++++++++++ 10 files changed, 336 insertions(+), 39 deletions(-) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java create mode 100644 src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java index 612e797..29242c2 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -1,14 +1,16 @@ package de.johannes_rabauer.micromigration; import java.nio.file.Path; +import java.util.Objects; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import one.microstream.storage.configuration.Configuration; import one.microstream.storage.types.EmbeddedStorage; +import one.microstream.storage.types.EmbeddedStorageManager; /** - * Wrapper class for the MicroStream {@link EmbeddedStorage} utility class. - * Produces {@link MigrationEmbeddedStorageManager} for updateable datastores. + * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. * * @author Johannes Rabauer * @@ -16,11 +18,18 @@ public class MigrationEmbeddedStorage { /** - * Warning "resource" is suppressed because it is used and closed in the @link {@link MigrationEmbeddedStorageManager}. + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link Configuration#Default()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater */ @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) { + Objects.requireNonNull(migrater); return new MigrationEmbeddedStorageManager( Configuration.Default() .createEmbeddedStorageFoundation() @@ -30,14 +39,23 @@ public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater } /** - * Warning "resource" is suppressed because it is used and closed in the @link {@link MigrationEmbeddedStorageManager}. + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link Configuration#Default()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param storageDirectory is used as the base directory for the datastore {@link Configuration#setBaseDirectory(String)} + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater */ @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start( - Path storageDirectory, + Path storageDirectory, MicroMigrater migrater ) { + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageDirectory); return new MigrationEmbeddedStorageManager( Configuration.Default() .setBaseDirectory(storageDirectory.toAbsolutePath().toString()) diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index 724896f..5ea24a5 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -1,5 +1,6 @@ package de.johannes_rabauer.micromigration; +import java.util.Objects; import java.util.function.Predicate; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; @@ -38,15 +39,34 @@ public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager private final MicroMigrater migrater ; private MicroStreamVersionedRoot versionRoot ; + /** + * @param nativeManager which will be used as the underlying storage manager. + * Almost all methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link MicroStreamVersionedRoot} is placed between the requests. + * @param migrater which is used as source for the migration scripts + */ public MigrationEmbeddedStorageManager( EmbeddedStorageManager nativeManager, MicroMigrater migrater ) { + Objects.requireNonNull(nativeManager); + Objects.requireNonNull(migrater); this.nativeManager = nativeManager; this.migrater = migrater ; } + /** + * {@inheritDoc} + *

+ * Checks if the root object is of the instance of {@link MicroStreamVersionedRoot}. + * If it is not, the root will be replaced with the versioned root and the actual root object + * will be put inside the versioned root. + *

+ * After starting the storage manager, all the available update scripts are executed in order + * until the newest version of the datastore is reached. + */ @Override public MigrationEmbeddedStorageManager start() { diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 55b4729..1dce6bc 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -16,6 +16,9 @@ public class ExplicitMigrater implements MicroMigrater { private final TreeSet sortedScripts = new TreeSet<>(MicroMigrationScript.COMPARATOR); + /** + * @param scripts are all the scripts that are executed, if the current version is lower than this of the script + */ public ExplicitMigrater(MicroMigrationScript ...scripts) { for (MicroMigrationScript script : scripts) diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 18ac893..5367b8a 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -5,6 +5,7 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import one.microstream.storage.types.EmbeddedStorageManager; /** * Executes all the available scripts to migrate the datastore to a certain version. @@ -16,6 +17,27 @@ public interface MicroMigrater { public TreeSet getSortedScripts(); + /** + * Executes all the scripts that are available to the migrater. + * Only scripts with a higher target version than the given fromVersion are executed.
+ * Scripts are executed one after another from the lowest to the highest version. + *

+ * Example:
+ * Current version is 1.0.0
+ * Scripts for v1.1.0, v2.0.0 and v1.2.1 are available
+ * Scripts are chain executed like v1.1.0 then v1.2.1 then v2.0.0 + * + * @param fromVersion is the current version of the datastore. + * Scripts for lower versions then the fromVersion are not executed. + * + * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. + * + * @param root is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * method. This way the script can change something within the root object. + * + * @return the target version of the last executed script + */ public default MicroMigrationVersion migrateToNewest( MicroMigrationVersion fromVersion , MigrationEmbeddedStorageManager storageManager, @@ -35,6 +57,30 @@ public default MicroMigrationVersion migrateToNewest( return fromVersion; } + /** + * Executes all the scripts that are available to the migrater until the given targetVersion is reached. + * Only scripts with a higher target version than the given fromVersion are executed.
+ * Scripts are executed one after another from the lowest to the highest version. + *

+ * Example:
+ * Current version is 1.0.0
+ * Scripts for v1.1.0, v2.0.0 and v1.2.1 are available
+ * Scripts are chain executed like v1.1.0 then v1.2.1 then v2.0.0 + * + * @param fromVersion is the current version of the datastore. + * Scripts for lower versions then the fromVersion are not executed. + * + * @param targetVersion is the highest allowed script version. + * Scripts which have a higher version won't be exectued. + * + * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. + * + * @param root is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * method. This way the script can change something within the root object. + * + * @return the target version of the last executed script + */ public default MicroMigrationVersion migrateToVersion ( MicroMigrationVersion fromVersion , diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java index cafa75a..60541f9 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java @@ -16,21 +16,8 @@ * */ public interface MicroMigrationScript -{ - public final static char VERSION_SEPERATOR = '_'; - final static String WRONG_FORMAT_ERROR_MESSAGE = "Script has invalid class name. Either rename the class to a valid script class name, or implement method getTargetVersion()."; - - public default MicroMigrationVersion getTargetVersion() - { - final String implementationClassName = this.getClass().getSimpleName(); - int indexOfFirstVersionSeperator = implementationClassName.indexOf(VERSION_SEPERATOR); - if(indexOfFirstVersionSeperator < 0) - { - throw new Error(WRONG_FORMAT_ERROR_MESSAGE); - } - int majorVersion = Integer.parseInt(implementationClassName.substring(0, indexOfFirstVersionSeperator)); - return new MicroMigrationVersion(majorVersion); - } +{ + public MicroMigrationVersion getTargetVersion(); public void execute( Object root , diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java new file mode 100644 index 0000000..a2d3611 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -0,0 +1,81 @@ +package de.johannes_rabauer.micromigration.scripts; + +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +/** + * Script which creates the target version of the script through the class name. + *

+ * Class name has to be in the scheme:
+ * + * vM_Classname
+ * vM_m_Classname
+ * vM_m_p_Classname
+ *
+ * Where v is short for version and is a constant (just a char),
+ * M is a integer for the major version,
+ * m is a integer for the minor version,
+ * p is a integer for the patch version and
+ * Classname is a custom String that the user can choose. + *

+ * If the class name has the wrong format, an {@link Error} is thrown. + * + * @author Johannes Rabauer + * + */ +public abstract class ReflectiveVersionMigrationScript implements MicroMigrationScript +{ + private final static char PREFIX = 'v'; + private final static String VERSION_SEPERATOR = "_"; + private final static String WRONG_FORMAT_ERROR_MESSAGE = "Script has invalid class name. Either rename the class to a valid script class name, or implement method getTargetVersion()."; + + private final MicroMigrationVersion version; + + /** + * @throws Error if the class name has the wrong format + */ + public ReflectiveVersionMigrationScript() + { + this.version = createTargetVersionFromClassName(); + } + + private MicroMigrationVersion createTargetVersionFromClassName() + { + final String implementationClassName = this.getClass().getSimpleName(); + if(PREFIX != implementationClassName.charAt(0)) + { + throw new Error(WRONG_FORMAT_ERROR_MESSAGE); + } + final String implementationClassNameWithoutPrefix = implementationClassName.substring(1); + final String[] classNameParts = implementationClassNameWithoutPrefix.split(VERSION_SEPERATOR); + if(classNameParts.length < 2) + { + throw new Error(WRONG_FORMAT_ERROR_MESSAGE); + } + try + { + int majorVersion = Integer.parseInt(classNameParts[0]); + if(classNameParts.length == 2) + { + return new MicroMigrationVersion(majorVersion); + } + int minorVersion = Integer.parseInt(classNameParts[1]); + if(classNameParts.length == 3) + { + return new MicroMigrationVersion(majorVersion, minorVersion); + } + int patchVersion = Integer.parseInt(classNameParts[2]); + return new MicroMigrationVersion(majorVersion, minorVersion, patchVersion); + } + catch (NumberFormatException e) + { + throw new Error(WRONG_FORMAT_ERROR_MESSAGE); + } + } + + @Override + public MicroMigrationVersion getTargetVersion() + { + return this.version; + } + +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java index d2575c3..4754341 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -1,5 +1,6 @@ package de.johannes_rabauer.micromigration.scripts; +import java.util.Objects; import java.util.function.BiConsumer; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; @@ -15,6 +16,8 @@ public SimpleMigrationScript( final BiConsumer consumer ) { + Objects.requireNonNull(version); + Objects.requireNonNull(consumer); this.version = version ; this.consumer = consumer; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java index 9e576c6..c1fdcfe 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java @@ -59,25 +59,6 @@ public int getPatchVersion() { public String toString() { return "v" + this.majorVersion + "." + this.minorVersion + "." + this.patchVersion; } - - public static Comparator COMPARATOR = new Comparator() - { - @Override - public int compare(MicroMigrationVersion o1, MicroMigrationVersion o2) - { - int majorVersionCompare = Integer.compare(o1.majorVersion, o2.majorVersion); - if(majorVersionCompare != 0) - { - return majorVersionCompare; - } - int minorVersionCompare = Integer.compare(o1.minorVersion, o2.minorVersion); - if(minorVersionCompare != 0) - { - return minorVersionCompare; - } - return Integer.compare(o1.patchVersion, o2.patchVersion); - } - }; @Override public int hashCode() @@ -108,4 +89,23 @@ public boolean equals(Object obj) return false; return true; } + + public static Comparator COMPARATOR = new Comparator() + { + @Override + public int compare(MicroMigrationVersion o1, MicroMigrationVersion o2) + { + int majorVersionCompare = Integer.compare(o1.majorVersion, o2.majorVersion); + if(majorVersionCompare != 0) + { + return majorVersionCompare; + } + int minorVersionCompare = Integer.compare(o1.minorVersion, o2.minorVersion); + if(minorVersionCompare != 0) + { + return minorVersionCompare; + } + return Integer.compare(o1.patchVersion, o2.patchVersion); + } + }; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java index 21b2301..976c988 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java @@ -1,5 +1,7 @@ package de.johannes_rabauer.micromigration.version; +import java.util.Objects; + /** * This class is inserted as the root of the MicroStream datastore and contains only the * current version and the actual root object. @@ -20,6 +22,7 @@ public MicroStreamVersionedRoot(Object actualRoot) public void setVersion(MicroMigrationVersion version) { + Objects.requireNonNull(version); this.currentVersion = version; } diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java new file mode 100644 index 0000000..1ea2b76 --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -0,0 +1,136 @@ +package de.johannes_rabauer.micromigration.scripts; + +import static org.junit.Assert.assertEquals; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +class ReflectiveVersionMigrationScriptTest +{ + + public static class v1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} + @Test + void testCorrectName_v1_CorrectClassName() + { + assertEquals(new MicroMigrationVersion(1, 0, 0), new v1_CorrectClassName().getTargetVersion()); + } + + public static class v1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} + @Test + void testCorrectName_v1_1_CorrectClassName() + { + assertEquals(new MicroMigrationVersion(1, 1, 0), new v1_1_CorrectClassName().getTargetVersion()); + } + + public static class v1_1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} + @Test + void testCorrectName_v1_1_1_CorrectClassName() + { + assertEquals(new MicroMigrationVersion(1, 1, 1), new v1_1_1_CorrectClassName().getTargetVersion()); + } + + public static class v10_1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} + @Test + void testCorrectName_v10_1_1_CorrectClassName() + { + assertEquals(new MicroMigrationVersion(10, 1, 1), new v10_1_1_CorrectClassName().getTargetVersion()); + } + + public static class v10_10_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} + @Test + void testCorrectName_v10_10_1_CorrectClassName() + { + assertEquals(new MicroMigrationVersion(10, 10, 1), new v10_10_1_CorrectClassName().getTargetVersion()); + } + + public static class v10_10_10_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} + @Test + void testCorrectName_v10_10_10_CorrectClassName() + { + assertEquals(new MicroMigrationVersion(10, 10, 10), new v10_10_10_CorrectClassName().getTargetVersion()); + } + + public static class a1_InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_a1_InvalidClassName() + { + Assertions.assertThrows(Error.class, () -> { + new a1_InvalidClassName(); + }); + } + + public static class foo1_InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_foo1_InvalidClassName() + { + Assertions.assertThrows(Error.class, () -> { + new foo1_InvalidClassName(); + }); + } + + public static class InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_InvalidClassName() + { + Assertions.assertThrows(Error.class, () -> { + new InvalidClassName(); + }); + } + + public static class InvalidClassName_v1 extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_InvalidClassName_v1() + { + Assertions.assertThrows(Error.class, () -> { + new InvalidClassName_v1(); + }); + } + + public static class v1_k_InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_v1_k_InvalidClassName() + { + Assertions.assertThrows(Error.class, () -> { + new v1_k_InvalidClassName(); + }); + } + + public static class v1_k_2_InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_v1_k_2_InvalidClassName() + { + Assertions.assertThrows(Error.class, () -> { + new v1_k_2_InvalidClassName(); + }); + } + + public static class v2147483648_InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_v2147483648_InvalidClassName() + { + Assertions.assertThrows(Error.class, () -> { + new v2147483648_InvalidClassName(); + }); + } + + public static class v___InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } + @Test + void testInvalildName_v___InvalidClassName() + { + Assertions.assertThrows(Error.class, () -> { + new v___InvalidClassName(); + }); + } + + + public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript + { + @Override + public void execute(Object root, MigrationEmbeddedStorageManager storageManager) { + //Dummy + } + } +} From c1d12a5458cdd2f7cee449c6607bc3cebf11a6dc Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 17 Dec 2020 21:18:12 +0100 Subject: [PATCH 011/306] Added one more integration tests; Added more JavaDoc. --- .../scripts/MicroMigrationScript.java | 10 ++++ .../scripts/SimpleMigrationScript.java | 11 ++++ .../StoreStuffInMigrationStorageManager.java | 59 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java index 60541f9..fe8ed83 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java @@ -17,8 +17,18 @@ */ public interface MicroMigrationScript { + /** + * @return the version of the datastore after this script is executed. + */ public MicroMigrationVersion getTargetVersion(); + /** + * Execute logic to migrate the given datastore to a newer version of the store. + * After executing the {@link #getTargetVersion()} is reached. + * + * @param root which is the current root object. Must be cast to the desired class. + * @param storageManager for storing-calls or other usage + */ public void execute( Object root , MigrationEmbeddedStorageManager storageManager diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java index 4754341..d961427 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -6,11 +6,22 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +/** + * Provides a simple way to create a migration script with the necessary version + * and {@link BiConsumer}. + * + * @author Johannes Rabauer + * + */ public class SimpleMigrationScript implements MicroMigrationScript { private final MicroMigrationVersion version; private final BiConsumer consumer; + /** + * @param version of the datastore after this script is executed + * @param consumer which is executed to reach the given datastore version + */ public SimpleMigrationScript( final MicroMigrationVersion version, final BiConsumer consumer diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java new file mode 100644 index 0000000..66f6019 --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java @@ -0,0 +1,59 @@ +package de.johannes_rabauer.micromigration.integration; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; +import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; +import de.johannes_rabauer.micromigration.scripts.SimpleMigrationScript; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; + +public class StoreStuffInMigrationStorageManager +{ + private static class RootClass + { + private ChildClass child = new ChildClass(); + } + + private static class ChildClass + { + private int i = 0; + } + + @Test + public void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException + { + final MicroMigrationScript script = new SimpleMigrationScript( + new MicroMigrationVersion(1), + (root, storage) -> {} + ); + final ExplicitMigrater secondMigrater = new ExplicitMigrater(script); + //Create new store and change stored object + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + { + migrationStorageManager.setRoot(new RootClass()); + migrationStorageManager.storeRoot(); + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertEquals(0, storedRoot.child.i); + ((RootClass)migrationStorageManager.root()).child.i = 1; + migrationStorageManager.store(storedRoot.child); + assertEquals(1, storedRoot.child.i); + } + //Check if stored object is correct + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + { + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertNotNull(storedRoot); + assertEquals(1, storedRoot.child.i); + } + } + +} From f45dde5f71be6c753afe3ee094bfc486658d276c Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sat, 19 Dec 2020 18:46:57 +0100 Subject: [PATCH 012/306] Bugfix for AutoClosable#close not working on MigrationEmbeddedStorageManager --- .../micromigration/MigrationEmbeddedStorageManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index 5ea24a5..2738c07 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -12,6 +12,7 @@ import one.microstream.persistence.types.PersistenceManager; import one.microstream.persistence.types.PersistenceRootsView; import one.microstream.reference.Reference; +import one.microstream.storage.exceptions.StorageException; import one.microstream.storage.types.Database; import one.microstream.storage.types.EmbeddedStorageManager; import one.microstream.storage.types.StorageConfiguration; @@ -132,6 +133,12 @@ public boolean shutdown() return this.nativeManager.shutdown(); } + @Override + public void close() throws StorageException + { + this.nativeManager.close(); + } + @Override public long storeRoot() { return this.nativeManager.storeRoot(); From 4d2074be5fcfe5fa45eb38583c9ef7b9edde3a50 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sat, 19 Dec 2020 18:53:34 +0100 Subject: [PATCH 013/306] Added Apache License --- LICENSE.txt | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..6d8d58f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2013-2018 Docker, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 6ee2b21f71f22841c8b83c15550511cbfdf0e7dd Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sat, 19 Dec 2020 21:25:25 +0100 Subject: [PATCH 014/306] Introduced StandaloneMicroMigrationManager for less intrusive versioning --- .../StandaloneMicroMigrationManager.java | 50 +++++++++++++++++++ .../migrater/MicroMigrater.java | 18 +++---- .../scripts/MicroMigrationScript.java | 5 +- .../scripts/SimpleMigrationScript.java | 12 ++--- ...IntroduceMigrationOnExistingDatastore.java | 25 +++++++++- .../ReflectiveVersionMigrationScriptTest.java | 4 +- .../testUtil/MicroMigrationScriptDummy.java | 4 +- 7 files changed, 95 insertions(+), 23 deletions(-) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/StandaloneMicroMigrationManager.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/StandaloneMicroMigrationManager.java b/src/main/java/de/johannes_rabauer/micromigration/StandaloneMicroMigrationManager.java new file mode 100644 index 0000000..36b51af --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/StandaloneMicroMigrationManager.java @@ -0,0 +1,50 @@ +package de.johannes_rabauer.micromigration; + +import java.util.function.Consumer; +import java.util.function.Supplier; + +import de.johannes_rabauer.micromigration.migrater.MicroMigrater; +import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import one.microstream.storage.types.EmbeddedStorageManager; + +public class StandaloneMicroMigrationManager +{ + private final Supplier currentVersionGetter; + private final Consumer currentVersionSetter; + private final Consumer currentVersionStorer; + private final MicroMigrater migrater ; + private final EmbeddedStorageManager storageManager ; + + public StandaloneMicroMigrationManager + ( + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + this.currentVersionGetter = currentVersionGetter; + this.currentVersionSetter = currentVersionSetter; + this.currentVersionStorer = currentVersionStorer; + this.migrater = migrater; + this.storageManager = storageManager; + } + + public void migrate(Object root) + { + final MicroMigrationVersion versionBeforeUpdate = currentVersionGetter.get(); + // Execute Updates + final MicroMigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( + versionBeforeUpdate, + this.storageManager, + root + ); + //Update stored version, if needed + if(!versionAfterUpdate.equals(versionBeforeUpdate)) + { + currentVersionSetter.accept(versionAfterUpdate); + currentVersionStorer.accept(versionAfterUpdate); + } + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 5367b8a..9b0a021 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -30,7 +30,7 @@ public interface MicroMigrater * @param fromVersion is the current version of the datastore. * Scripts for lower versions then the fromVersion are not executed. * - * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, EmbeddedStorageManager)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * * @param root is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} @@ -39,9 +39,9 @@ public interface MicroMigrater * @return the target version of the last executed script */ public default MicroMigrationVersion migrateToNewest( - MicroMigrationVersion fromVersion , - MigrationEmbeddedStorageManager storageManager, - Object root + MicroMigrationVersion fromVersion , + EmbeddedStorageManager storageManager, + Object root ) { TreeSet sortedScripts = getSortedScripts(); @@ -73,7 +73,7 @@ public default MicroMigrationVersion migrateToNewest( * @param targetVersion is the highest allowed script version. * Scripts which have a higher version won't be exectued. * - * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, EmbeddedStorageManager)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * * @param root is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} @@ -83,10 +83,10 @@ public default MicroMigrationVersion migrateToNewest( */ public default MicroMigrationVersion migrateToVersion ( - MicroMigrationVersion fromVersion , - MicroMigrationVersion targetVersion , - MigrationEmbeddedStorageManager storageManager, - Object root + MicroMigrationVersion fromVersion , + MicroMigrationVersion targetVersion , + EmbeddedStorageManager storageManager, + Object root ) { MicroMigrationVersion updateVersionWhichWasExecuted = fromVersion; diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java index fe8ed83..4e843de 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java @@ -4,6 +4,7 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import one.microstream.storage.types.EmbeddedStorageManager; /** * Interface for scripts to migrate / update datastores. @@ -30,8 +31,8 @@ public interface MicroMigrationScript * @param storageManager for storing-calls or other usage */ public void execute( - Object root , - MigrationEmbeddedStorageManager storageManager + Object root , + EmbeddedStorageManager storageManager ); public static Comparator COMPARATOR = new Comparator() diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java index d961427..7698ae2 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -3,8 +3,8 @@ import java.util.Objects; import java.util.function.BiConsumer; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import one.microstream.storage.types.EmbeddedStorageManager; /** * Provides a simple way to create a migration script with the necessary version @@ -15,16 +15,16 @@ */ public class SimpleMigrationScript implements MicroMigrationScript { - private final MicroMigrationVersion version; - private final BiConsumer consumer; + private final MicroMigrationVersion version; + private final BiConsumer consumer; /** * @param version of the datastore after this script is executed * @param consumer which is executed to reach the given datastore version */ public SimpleMigrationScript( - final MicroMigrationVersion version, - final BiConsumer consumer + final MicroMigrationVersion version, + final BiConsumer consumer ) { Objects.requireNonNull(version); @@ -40,7 +40,7 @@ public MicroMigrationVersion getTargetVersion() } @Override - public void execute(Object root, MigrationEmbeddedStorageManager storageManager) + public void execute(Object root, EmbeddedStorageManager storageManager) { this.consumer.accept(root, storageManager); } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java index 024af9b..08bf970 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java @@ -19,9 +19,9 @@ class IntroduceMigrationOnExistingDatastore { final static String ROOT = "OriginalRoot"; - + @Test - public void testIntroducingMigrationOnExistingDatastore(@TempDir Path storageFolder) throws IOException + public void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException { try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) { @@ -38,5 +38,26 @@ public void testIntroducingMigrationOnExistingDatastore(@TempDir Path storageFol assertEquals(1, migrationStorageManager.getCurrentVersion().getMajorVersion()); } } + + @Test + public void testIntroducingMigrationOnExistingDatastore_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + { + //TODO +// try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) +// { +// storageManager.setRoot(ROOT); +// storageManager.storeRoot(); +// } +// +// final ExplicitMigrater migrater = new ExplicitMigrater( +// new MicroMigrationScriptDummy(new MicroMigrationVersion(1)) +// ); +// final StandaloneMicroMigrationManager standaloneMigrationManager = new StandaloneMicroMigrationManager(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, storageManager) +// try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) +// { +// assertEquals(ROOT, migrationStorageManager.root()); +// assertEquals(1, migrationStorageManager.getCurrentVersion().getMajorVersion()); +// } + } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index 1ea2b76..50ed110 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -5,8 +5,8 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import one.microstream.storage.types.EmbeddedStorageManager; class ReflectiveVersionMigrationScriptTest { @@ -129,7 +129,7 @@ void testInvalildName_v___InvalidClassName() public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript { @Override - public void execute(Object root, MigrationEmbeddedStorageManager storageManager) { + public void execute(Object root, EmbeddedStorageManager storageManager) { //Dummy } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java index 7c94403..a882adc 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,8 +1,8 @@ package de.johannes_rabauer.micromigration.testUtil; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import one.microstream.storage.types.EmbeddedStorageManager; public class MicroMigrationScriptDummy implements MicroMigrationScript { @@ -20,7 +20,7 @@ public MicroMigrationVersion getTargetVersion() } @Override - public void execute(Object root, MigrationEmbeddedStorageManager storageManager) { + public void execute(Object root, EmbeddedStorageManager storageManager) { // Don't do anything. } From 5cbc69cc487e51124a964e5232a4b2d6c69a71dc Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 20 Dec 2020 11:16:54 +0100 Subject: [PATCH 015/306] Removed useless AutoRegisteringMigrator --- .../migrater/AutoRegisteringMigrater.java | 35 ------------------- .../AutoRegisteringMigrationScript.java | 20 ----------- 2 files changed, 55 deletions(-) delete mode 100644 src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java delete mode 100644 src/main/java/de/johannes_rabauer/micromigration/scripts/AutoRegisteringMigrationScript.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java deleted file mode 100644 index 2e7aa17..0000000 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AutoRegisteringMigrater.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.johannes_rabauer.micromigration.migrater; - -import java.util.TreeSet; - -import de.johannes_rabauer.micromigration.scripts.AutoRegisteringMigrationScript; -import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; - -/** - * Executes all the scripts which can register themselves.
- * Is not usable yet! - * @author Johannes Rabauer - * - */ -@Deprecated -public class AutoRegisteringMigrater implements MicroMigrater -{ - private final static TreeSet SORTED_SCRIPTS = new TreeSet<>(MicroMigrationScript.COMPARATOR); - - public final static AutoRegisteringMigrater INSTANCE = new AutoRegisteringMigrater(); - - private AutoRegisteringMigrater() - { - - } - - public static final void registerScript(AutoRegisteringMigrationScript script) - { - SORTED_SCRIPTS.add(script); - } - - @Override - public TreeSet getSortedScripts() { - return SORTED_SCRIPTS; - } -} diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/AutoRegisteringMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/AutoRegisteringMigrationScript.java deleted file mode 100644 index 5d167d8..0000000 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/AutoRegisteringMigrationScript.java +++ /dev/null @@ -1,20 +0,0 @@ -package de.johannes_rabauer.micromigration.scripts; - -import de.johannes_rabauer.micromigration.migrater.AutoRegisteringMigrater; - -/** - * Extending classes can easily auto register at the {@link AutoRegisteringMigrater}.
- * Is not usable yet! - * - * @author Johannes Rabauer - * - */ -@Deprecated -public abstract class AutoRegisteringMigrationScript implements MicroMigrationScript -{ - protected static AutoRegisteringMigrationScript registerSelf(AutoRegisteringMigrationScript script) - { - AutoRegisteringMigrater.registerScript(script); - return script; - } -} From 1d578c0ed0858f3be5344e98a991185f33ac0654 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 20 Dec 2020 11:25:22 +0100 Subject: [PATCH 016/306] Refactored because of alternative way to migration with MigrationManager; Fixed Unit tests --- .../MigrationEmbeddedStorageManager.java | 48 ++++++------ ...tionManager.java => MigrationManager.java} | 48 +++++++++++- .../migrater/MicroMigrater.java | 6 ++ .../micromigration/version/Versioned.java | 14 ++++ .../version/VersionedObject.java | 51 +++++++++++++ ...mVersionedRoot.java => VersionedRoot.java} | 10 ++- ...IntroduceMigrationOnExistingDatastore.java | 22 ------ .../MigrationScriptAfterScript.java | 74 ++++++++++++++++++- .../StoreStuffInMigrationStorageManager.java | 6 +- 9 files changed, 219 insertions(+), 60 deletions(-) rename src/main/java/de/johannes_rabauer/micromigration/{StandaloneMicroMigrationManager.java => MigrationManager.java} (56%) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java rename src/main/java/de/johannes_rabauer/micromigration/version/{MicroStreamVersionedRoot.java => VersionedRoot.java} (75%) diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index 2738c07..bad3b60 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -5,7 +5,8 @@ import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; -import de.johannes_rabauer.micromigration.version.MicroStreamVersionedRoot; +import de.johannes_rabauer.micromigration.version.Versioned; +import de.johannes_rabauer.micromigration.version.VersionedRoot; import one.microstream.afs.AFile; import one.microstream.collections.types.XGettingEnum; import one.microstream.persistence.binary.types.Binary; @@ -28,7 +29,7 @@ /** * Wrapper class for the MicroStream {@link EmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link MicroStreamVersionedRoot} + * Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the datastore is then versioned. * * @author Johannes Rabauer @@ -36,15 +37,15 @@ */ public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager { - private final EmbeddedStorageManager nativeManager; - private final MicroMigrater migrater ; - private MicroStreamVersionedRoot versionRoot ; + private final EmbeddedStorageManager nativeManager; + private final MicroMigrater migrater ; + private VersionedRoot versionRoot ; /** * @param nativeManager which will be used as the underlying storage manager. * Almost all methods are only rerouted to this native manager. * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted - * and a {@link MicroStreamVersionedRoot} is placed between the requests. + * and a {@link Versioned} is placed between the requests. * @param migrater which is used as source for the migration scripts */ public MigrationEmbeddedStorageManager( @@ -61,7 +62,7 @@ public MigrationEmbeddedStorageManager( /** * {@inheritDoc} *

- * Checks if the root object is of the instance of {@link MicroStreamVersionedRoot}. + * Checks if the root object is of the instance of {@link Versioned}. * If it is not, the root will be replaced with the versioned root and the actual root object * will be put inside the versioned root. *

@@ -72,28 +73,23 @@ public MigrationEmbeddedStorageManager( public MigrationEmbeddedStorageManager start() { this.nativeManager.start(); - if(this.nativeManager.root() instanceof MicroStreamVersionedRoot) + if(this.nativeManager.root() instanceof VersionedRoot) { - this.versionRoot = (MicroStreamVersionedRoot)this.nativeManager.root(); + this.versionRoot = (VersionedRoot)this.nativeManager.root(); } else { //Build VersionedRoot around actual root, set by user. - this.versionRoot = new MicroStreamVersionedRoot(this.nativeManager.root()); + this.versionRoot = new VersionedRoot(this.nativeManager.root()); nativeManager.setRoot(versionRoot); - } - // Execute Updates - final MicroMigrationVersion versionAfterUpdate = migrater.migrateToNewest( - this.versionRoot.getVersion(), - this , - this.versionRoot.getRoot() - ); - //Update stored version, if needed - if(versionAfterUpdate != this.versionRoot.getVersion()) - { - this.versionRoot.setVersion(versionAfterUpdate); nativeManager.storeRoot(); } + new MigrationManager( + this.versionRoot, + migrater, + this + ) + .migrate(this.versionRoot.getRoot()); return this; } @@ -112,6 +108,11 @@ public Object setRoot(Object newRoot) { this.versionRoot.setRoot(newRoot); return newRoot; } + + @Override + public long storeRoot() { + return this.nativeManager.store(this.versionRoot); + } //////////////////////////////////////////////////////////////// // Simply forward all the other methods @@ -139,11 +140,6 @@ public void close() throws StorageException this.nativeManager.close(); } - @Override - public long storeRoot() { - return this.nativeManager.storeRoot(); - } - @Override public StorageConnection createConnection() { return this.nativeManager.createConnection(); diff --git a/src/main/java/de/johannes_rabauer/micromigration/StandaloneMicroMigrationManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java similarity index 56% rename from src/main/java/de/johannes_rabauer/micromigration/StandaloneMicroMigrationManager.java rename to src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java index 36b51af..ea222cc 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/StandaloneMicroMigrationManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java @@ -1,21 +1,23 @@ package de.johannes_rabauer.micromigration; +import java.util.Objects; import java.util.function.Consumer; import java.util.function.Supplier; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.Versioned; import one.microstream.storage.types.EmbeddedStorageManager; -public class StandaloneMicroMigrationManager +public class MigrationManager { private final Supplier currentVersionGetter; private final Consumer currentVersionSetter; private final Consumer currentVersionStorer; private final MicroMigrater migrater ; private final EmbeddedStorageManager storageManager ; - - public StandaloneMicroMigrationManager + + public MigrationManager ( final Supplier currentVersionGetter, final Consumer currentVersionSetter, @@ -24,12 +26,52 @@ public class StandaloneMicroMigrationManager final EmbeddedStorageManager storageManager ) { + Objects.requireNonNull(currentVersionGetter); + Objects.requireNonNull(currentVersionSetter); + Objects.requireNonNull(currentVersionStorer); + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageManager); this.currentVersionGetter = currentVersionGetter; this.currentVersionSetter = currentVersionSetter; this.currentVersionStorer = currentVersionStorer; this.migrater = migrater; this.storageManager = storageManager; } + + public MigrationManager + ( + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + this( + () -> versionedObject.getVersion() , + (version) -> versionedObject.setVersion(version) , + (version) -> storageManager.store(versionedObject), + migrater, + storageManager + ); + Objects.requireNonNull(versionedObject); + } + + public MigrationManager + ( + final Versioned versionedObject , + final Consumer currentVersionStorer, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + this( + () -> versionedObject.getVersion() , + (version) -> versionedObject.setVersion(version), + currentVersionStorer, + migrater, + storageManager + ); + Objects.requireNonNull(versionedObject); + } public void migrate(Object root) { diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 9b0a021..3826256 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -1,5 +1,6 @@ package de.johannes_rabauer.micromigration.migrater; +import java.util.Objects; import java.util.TreeSet; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; @@ -44,6 +45,8 @@ public default MicroMigrationVersion migrateToNewest( Object root ) { + Objects.requireNonNull(fromVersion); + Objects.requireNonNull(storageManager); TreeSet sortedScripts = getSortedScripts(); if(sortedScripts.size() > 0) { @@ -89,6 +92,9 @@ public default MicroMigrationVersion migrateToNewest( Object root ) { + Objects.requireNonNull(fromVersion); + Objects.requireNonNull(targetVersion); + Objects.requireNonNull(storageManager); MicroMigrationVersion updateVersionWhichWasExecuted = fromVersion; for (MicroMigrationScript script : this.getSortedScripts()) { diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java b/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java new file mode 100644 index 0000000..ab7f3ed --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java @@ -0,0 +1,14 @@ +package de.johannes_rabauer.micromigration.version; + +/** + * This class is inserted as the root of the MicroStream datastore and contains only the + * current version and the actual root object. + * + * @author Johannes Rabauer + * + */ +public interface Versioned +{ + public void setVersion(MicroMigrationVersion version); + public MicroMigrationVersion getVersion(); +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java new file mode 100644 index 0000000..5c1b3de --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java @@ -0,0 +1,51 @@ +package de.johannes_rabauer.micromigration.version; + +import java.util.Objects; + +/** + * This class is inserted as the root of the MicroStream datastore and contains only the + * current version and the actual root object. + * + * @author Johannes Rabauer + * + */ +public class VersionedObject implements Versioned +{ + private MicroMigrationVersion currentVersion; + private Object actualObject ; + + public VersionedObject(Object actualObject) + { + this.actualObject = actualObject ; + this.currentVersion = new MicroMigrationVersion(0,0,0); + } + + @Override + public void setVersion(MicroMigrationVersion version) + { + Objects.requireNonNull(version); + this.currentVersion = version; + } + + @Override + public MicroMigrationVersion getVersion() + { + return this.currentVersion; + } + + public void setObject(Object actualObject) + { + this.actualObject = actualObject; + } + + public Object getObject() + { + return this.actualObject; + } + + @Override + public String toString() + { + return this.currentVersion.toString() + "\n" + this.actualObject; + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java similarity index 75% rename from src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java rename to src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java index 976c988..0064987 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroStreamVersionedRoot.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java @@ -9,23 +9,25 @@ * @author Johannes Rabauer * */ -public class MicroStreamVersionedRoot +public class VersionedRoot implements Versioned { private MicroMigrationVersion currentVersion; private Object actualRoot ; - public MicroStreamVersionedRoot(Object actualRoot) + public VersionedRoot(Object actualRoot) { - setRoot(actualRoot); - setVersion(new MicroMigrationVersion(0,0,0)); + this.actualRoot = actualRoot ; + this.currentVersion = new MicroMigrationVersion(0,0,0); } + @Override public void setVersion(MicroMigrationVersion version) { Objects.requireNonNull(version); this.currentVersion = version; } + @Override public MicroMigrationVersion getVersion() { return this.currentVersion; diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java index 08bf970..77aae0c 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java @@ -38,26 +38,4 @@ public void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorage assertEquals(1, migrationStorageManager.getCurrentVersion().getMajorVersion()); } } - - @Test - public void testIntroducingMigrationOnExistingDatastore_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException - { - //TODO -// try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) -// { -// storageManager.setRoot(ROOT); -// storageManager.storeRoot(); -// } -// -// final ExplicitMigrater migrater = new ExplicitMigrater( -// new MicroMigrationScriptDummy(new MicroMigrationVersion(1)) -// ); -// final StandaloneMicroMigrationManager standaloneMigrationManager = new StandaloneMicroMigrationManager(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, storageManager) -// try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) -// { -// assertEquals(ROOT, migrationStorageManager.root()); -// assertEquals(1, migrationStorageManager.getCurrentVersion().getMajorVersion()); -// } - } - } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java index 5ebdc04..fe7351b 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java @@ -10,29 +10,37 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.MigrationManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleMigrationScript; import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.Versioned; +import de.johannes_rabauer.micromigration.version.VersionedObject; +import one.microstream.storage.configuration.Configuration; +import one.microstream.storage.types.EmbeddedStorageManager; class MigrationScriptAfterScript { @Test - public void testMigrationWithThreeDifferenMigrater(@TempDir Path storageFolder) throws IOException + public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException { //First run without any migration script final ExplicitMigrater firstMigrater = new ExplicitMigrater(); try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, firstMigrater)) { migrationStorageManager.setRoot(0); + migrationStorageManager.storeRoot(); assertEquals(0, migrationStorageManager.root()); assertEquals(new MicroMigrationVersion(0,0,0), migrationStorageManager.getCurrentVersion()); } + //Run with one migration script final MicroMigrationScript firstScript = new SimpleMigrationScript( new MicroMigrationVersion(1), - (root, storage) -> storage.setRoot(1) + (root, storage) -> + storage.setRoot(1) ); final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) @@ -41,6 +49,7 @@ public void testMigrationWithThreeDifferenMigrater(@TempDir Path storageFolder) assertEquals(new MicroMigrationVersion(1,0,0), migrationStorageManager.getCurrentVersion()); } + //Run with two migration scripts final MicroMigrationScript secondScript = new SimpleMigrationScript( new MicroMigrationVersion(2), @@ -53,5 +62,66 @@ public void testMigrationWithThreeDifferenMigrater(@TempDir Path storageFolder) assertEquals(new MicroMigrationVersion(2,0,0), migrationStorageManager.getCurrentVersion()); } } + + @Test + public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + { + //First run without any migration script + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + VersionedObject firstRoot = new VersionedObject(0); + storageManager.setRoot(firstRoot); + storageManager.storeRoot(); + assertEquals(0, firstRoot.getObject()); + assertEquals(new MicroMigrationVersion(0,0,0), firstRoot.getVersion()); + } + + + //Run with one migration script + final MicroMigrationScript firstScript = new SimpleMigrationScript( + new MicroMigrationVersion(1), + (root, storage) -> ((VersionedObject)root).setObject(1) + ); + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManager( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript), + storageManager + ) + .migrate(storageManager.root()); + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(1, currentRoot.getObject()); + assertEquals(new MicroMigrationVersion(1,0,0), currentRoot.getVersion()); + } + + + //Run with two migration scripts + final MicroMigrationScript secondScript = new SimpleMigrationScript( + new MicroMigrationVersion(2), + (root, storage) -> ((VersionedObject)root).setObject(2) + ); + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManager( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript, secondScript), + storageManager + ) + .migrate(storageManager.root()); + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(2, currentRoot.getObject()); + assertEquals(new MicroMigrationVersion(2,0,0), currentRoot.getVersion()); + } + } + + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(Path storageFolder) + { + return Configuration.Default() + .setBaseDirectory(storageFolder.toAbsolutePath().toString()) + .createEmbeddedStorageFoundation() + .createEmbeddedStorageManager() + .start(); + } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java index 66f6019..946c069 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java @@ -35,9 +35,9 @@ public void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throw new MicroMigrationVersion(1), (root, storage) -> {} ); - final ExplicitMigrater secondMigrater = new ExplicitMigrater(script); + final ExplicitMigrater migrater = new ExplicitMigrater(script); //Create new store and change stored object - try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { migrationStorageManager.setRoot(new RootClass()); migrationStorageManager.storeRoot(); @@ -48,7 +48,7 @@ public void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throw assertEquals(1, storedRoot.child.i); } //Check if stored object is correct - try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); assertNotNull(storedRoot); From 72b7cfecab6279a8e8e5f9fd4f6373ed258a5467 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 22 Dec 2020 21:21:37 +0100 Subject: [PATCH 017/306] Refactoring; Updated JavaDoc --- .../MigrationEmbeddedStorageManager.java | 74 +++++++++++------ .../micromigration/MigrationManager.java | 82 +++++++++++-------- .../migrater/ExplicitMigrater.java | 10 +-- .../migrater/MicroMigrater.java | 34 ++++---- ...rationScript.java => MigrationScript.java} | 14 ++-- .../ReflectiveVersionMigrationScript.java | 16 ++-- .../scripts/SimpleMigrationScript.java | 10 +-- ...tionVersion.java => MigrationVersion.java} | 14 ++-- .../micromigration/version/Versioned.java | 9 +- .../version/VersionedObject.java | 25 +++--- .../micromigration/version/VersionedRoot.java | 8 +- ...IntroduceMigrationOnExistingDatastore.java | 4 +- .../MigrationScriptAfterScript.java | 32 ++++---- .../StoreStuffInMigrationStorageManager.java | 8 +- .../migrater/ExplicitMigraterTest.java | 10 +-- .../ReflectiveVersionMigrationScriptTest.java | 14 ++-- .../testUtil/MicroMigrationScriptDummy.java | 12 +-- 17 files changed, 207 insertions(+), 169 deletions(-) rename src/main/java/de/johannes_rabauer/micromigration/scripts/{MicroMigrationScript.java => MigrationScript.java} (64%) rename src/main/java/de/johannes_rabauer/micromigration/version/{MicroMigrationVersion.java => MigrationVersion.java} (84%) diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index bad3b60..67fe408 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -4,7 +4,7 @@ import java.util.function.Predicate; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; import de.johannes_rabauer.micromigration.version.VersionedRoot; import one.microstream.afs.AFile; @@ -30,7 +30,8 @@ * Wrapper class for the MicroStream {@link EmbeddedStorageManager} interface. *

* Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the datastore is then versioned. + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManager} to do the actual migration. * * @author Johannes Rabauer * @@ -93,7 +94,7 @@ public MigrationEmbeddedStorageManager start() return this; } - public MicroMigrationVersion getCurrentVersion() + public MigrationVersion getCurrentVersion() { return this.versionRoot.getVersion(); } @@ -119,12 +120,14 @@ public long storeRoot() { //////////////////////////////////////////////////////////////// @Override - public StorageConfiguration configuration() { + public StorageConfiguration configuration() + { return this.nativeManager.configuration(); } @Override - public StorageTypeDictionary typeDictionary() { + public StorageTypeDictionary typeDictionary() + { return this.nativeManager.typeDictionary(); } @@ -141,106 +144,125 @@ public void close() throws StorageException } @Override - public StorageConnection createConnection() { + public StorageConnection createConnection() + { return this.nativeManager.createConnection(); } @Override - public PersistenceRootsView viewRoots() { + public PersistenceRootsView viewRoots() + { return this.nativeManager.viewRoots(); } @Override @Deprecated - public Reference defaultRoot() { + public Reference defaultRoot() + { return this.nativeManager.defaultRoot(); } @Override - public Database database() { + public Database database() + { return this.nativeManager.database(); } @Override - public boolean isAcceptingTasks() { + public boolean isAcceptingTasks() + { return this.nativeManager.isAcceptingTasks(); } @Override - public boolean isRunning() { + public boolean isRunning() + { return this.nativeManager.isRunning(); } @Override - public boolean isStartingUp() { + public boolean isStartingUp() + { return this.nativeManager.isStartingUp(); } @Override - public boolean isShuttingDown() { + public boolean isShuttingDown() + { return this.nativeManager.isShuttingDown(); } @Override - public void checkAcceptingTasks() { + public void checkAcceptingTasks() + { this.nativeManager.checkAcceptingTasks(); } @Override - public long initializationTime() { + public long initializationTime() + { return this.nativeManager.initializationTime(); } @Override - public long operationModeTime() { + public long operationModeTime() + { return this.nativeManager.operationModeTime(); } @Override - public boolean isActive() { + public boolean isActive() + { return this.nativeManager.isActive(); } @Override - public boolean issueGarbageCollection(long nanoTimeBudget) { + public boolean issueGarbageCollection(long nanoTimeBudget) + { return this.nativeManager.issueGarbageCollection(nanoTimeBudget); } @Override - public boolean issueFileCheck(long nanoTimeBudget) { + public boolean issueFileCheck(long nanoTimeBudget) + { return this.nativeManager.issueFileCheck(nanoTimeBudget); } @Override - public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) { + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) + { return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); } @Override - public StorageRawFileStatistics createStorageStatistics() { + public StorageRawFileStatistics createStorageStatistics() + { return this.nativeManager.createStorageStatistics(); } @Override - public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + { this.nativeManager.exportChannels(fileProvider, performGarbageCollection); } @Override public StorageEntityTypeExportStatistics exportTypes(StorageEntityTypeExportFileProvider exportFileProvider, - Predicate isExportType) { + Predicate isExportType) + { return this.nativeManager.exportTypes(exportFileProvider, isExportType); } @Override - public void importFiles(XGettingEnum importFiles) { + public void importFiles(XGettingEnum importFiles) + { this.nativeManager.importFiles(importFiles); } @Override - public PersistenceManager persistenceManager() { + public PersistenceManager persistenceManager() + { return this.nativeManager.persistenceManager(); } - } diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java index ea222cc..ec03263 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java @@ -5,24 +5,44 @@ import java.util.function.Supplier; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; import one.microstream.storage.types.EmbeddedStorageManager; +/** + * Manages a given object and keeps the version for it. + *

+ * Can be used to keep the version of the MicroStream-Root-Object to keep the whole + * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * multiple versioned objects can be used in one datastore. + * + * @author Johannes Rabauer + * + */ public class MigrationManager { - private final Supplier currentVersionGetter; - private final Consumer currentVersionSetter; - private final Consumer currentVersionStorer; - private final MicroMigrater migrater ; - private final EmbeddedStorageManager storageManager ; + private final Supplier currentVersionGetter; + private final Consumer currentVersionSetter; + private final Consumer currentVersionStorer; + private final MicroMigrater migrater ; + private final EmbeddedStorageManager storageManager ; + /** + * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager ( - final Supplier currentVersionGetter, - final Consumer currentVersionSetter, - final Consumer currentVersionStorer, - final MicroMigrater migrater , + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater , final EmbeddedStorageManager storageManager ) { @@ -38,6 +58,14 @@ public class MigrationManager this.storageManager = storageManager; } + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link MigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager ( final Versioned versionedObject, @@ -46,41 +74,27 @@ public class MigrationManager ) { this( - () -> versionedObject.getVersion() , + ( ) -> versionedObject.getVersion() , (version) -> versionedObject.setVersion(version) , (version) -> storageManager.store(versionedObject), - migrater, - storageManager - ); - Objects.requireNonNull(versionedObject); - } - - public MigrationManager - ( - final Versioned versionedObject , - final Consumer currentVersionStorer, - final MicroMigrater migrater , - final EmbeddedStorageManager storageManager - ) - { - this( - () -> versionedObject.getVersion() , - (version) -> versionedObject.setVersion(version), - currentVersionStorer, - migrater, + migrater , storageManager ); Objects.requireNonNull(versionedObject); } - public void migrate(Object root) + /** + * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. + * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon + */ + public void migrate(Object objectToMigrate) { - final MicroMigrationVersion versionBeforeUpdate = currentVersionGetter.get(); + final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); // Execute Updates - final MicroMigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( + final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( versionBeforeUpdate, this.storageManager, - root + objectToMigrate ); //Update stored version, if needed if(!versionAfterUpdate.equals(versionBeforeUpdate)) diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 1dce6bc..587a505 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -2,7 +2,7 @@ import java.util.TreeSet; -import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; /** * Executes all the available scripts to migrate the datastore to a certain version. @@ -14,21 +14,21 @@ */ public class ExplicitMigrater implements MicroMigrater { - private final TreeSet sortedScripts = new TreeSet<>(MicroMigrationScript.COMPARATOR); + private final TreeSet sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); /** * @param scripts are all the scripts that are executed, if the current version is lower than this of the script */ - public ExplicitMigrater(MicroMigrationScript ...scripts) + public ExplicitMigrater(MigrationScript ...scripts) { - for (MicroMigrationScript script : scripts) + for (MigrationScript script : scripts) { this.sortedScripts.add(script); } } @Override - public TreeSet getSortedScripts() { + public TreeSet getSortedScripts() { return this.sortedScripts; } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 3826256..ca67616 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -4,8 +4,8 @@ import java.util.TreeSet; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.types.EmbeddedStorageManager; /** @@ -16,7 +16,7 @@ */ public interface MicroMigrater { - public TreeSet getSortedScripts(); + public TreeSet getSortedScripts(); /** * Executes all the scripts that are available to the migrater. @@ -31,23 +31,23 @@ public interface MicroMigrater * @param fromVersion is the current version of the datastore. * Scripts for lower versions then the fromVersion are not executed. * - * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, EmbeddedStorageManager)} + * @param storageManager is relayed to the scripts {@link MigrationScript#execute(Object, EmbeddedStorageManager)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param root is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * @param root is relayed to the scripts {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} * method. This way the script can change something within the root object. * * @return the target version of the last executed script */ - public default MicroMigrationVersion migrateToNewest( - MicroMigrationVersion fromVersion , + public default MigrationVersion migrateToNewest( + MigrationVersion fromVersion , EmbeddedStorageManager storageManager, Object root ) { Objects.requireNonNull(fromVersion); Objects.requireNonNull(storageManager); - TreeSet sortedScripts = getSortedScripts(); + TreeSet sortedScripts = getSortedScripts(); if(sortedScripts.size() > 0) { return migrateToVersion( @@ -76,18 +76,18 @@ public default MicroMigrationVersion migrateToNewest( * @param targetVersion is the highest allowed script version. * Scripts which have a higher version won't be exectued. * - * @param storageManager is relayed to the scripts {@link MicroMigrationScript#execute(Object, EmbeddedStorageManager)} + * @param storageManager is relayed to the scripts {@link MigrationScript#execute(Object, EmbeddedStorageManager)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param root is relayed to the scripts {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * @param root is relayed to the scripts {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} * method. This way the script can change something within the root object. * * @return the target version of the last executed script */ - public default MicroMigrationVersion migrateToVersion + public default MigrationVersion migrateToVersion ( - MicroMigrationVersion fromVersion , - MicroMigrationVersion targetVersion , + MigrationVersion fromVersion , + MigrationVersion targetVersion , EmbeddedStorageManager storageManager, Object root ) @@ -95,12 +95,12 @@ public default MicroMigrationVersion migrateToNewest( Objects.requireNonNull(fromVersion); Objects.requireNonNull(targetVersion); Objects.requireNonNull(storageManager); - MicroMigrationVersion updateVersionWhichWasExecuted = fromVersion; - for (MicroMigrationScript script : this.getSortedScripts()) + MigrationVersion updateVersionWhichWasExecuted = fromVersion; + for (MigrationScript script : this.getSortedScripts()) { - if(MicroMigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) + if(MigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) { - if(MicroMigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) + if(MigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) { script.execute(root, storageManager); updateVersionWhichWasExecuted = script.getTargetVersion(); diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java similarity index 64% rename from src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java rename to src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java index 4e843de..dfef725 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MicroMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java @@ -3,25 +3,25 @@ import java.util.Comparator; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.types.EmbeddedStorageManager; /** * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MicroMigrationScript#execute(Object, MigrationEmbeddedStorageManager)} method is called, + * After the {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MicroMigrationScript +public interface MigrationScript { /** * @return the version of the datastore after this script is executed. */ - public MicroMigrationVersion getTargetVersion(); + public MigrationVersion getTargetVersion(); /** * Execute logic to migrate the given datastore to a newer version of the store. @@ -35,11 +35,11 @@ public void execute( EmbeddedStorageManager storageManager ); - public static Comparator COMPARATOR = new Comparator() + public static Comparator COMPARATOR = new Comparator() { @Override - public int compare(MicroMigrationScript o1, MicroMigrationScript o2) { - return MicroMigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); + public int compare(MigrationScript o1, MigrationScript o2) { + return MigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); } }; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java index a2d3611..49e8096 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -1,6 +1,6 @@ package de.johannes_rabauer.micromigration.scripts; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; /** * Script which creates the target version of the script through the class name. @@ -22,13 +22,13 @@ * @author Johannes Rabauer * */ -public abstract class ReflectiveVersionMigrationScript implements MicroMigrationScript +public abstract class ReflectiveVersionMigrationScript implements MigrationScript { private final static char PREFIX = 'v'; private final static String VERSION_SEPERATOR = "_"; private final static String WRONG_FORMAT_ERROR_MESSAGE = "Script has invalid class name. Either rename the class to a valid script class name, or implement method getTargetVersion()."; - private final MicroMigrationVersion version; + private final MigrationVersion version; /** * @throws Error if the class name has the wrong format @@ -38,7 +38,7 @@ public ReflectiveVersionMigrationScript() this.version = createTargetVersionFromClassName(); } - private MicroMigrationVersion createTargetVersionFromClassName() + private MigrationVersion createTargetVersionFromClassName() { final String implementationClassName = this.getClass().getSimpleName(); if(PREFIX != implementationClassName.charAt(0)) @@ -56,15 +56,15 @@ private MicroMigrationVersion createTargetVersionFromClassName() int majorVersion = Integer.parseInt(classNameParts[0]); if(classNameParts.length == 2) { - return new MicroMigrationVersion(majorVersion); + return new MigrationVersion(majorVersion); } int minorVersion = Integer.parseInt(classNameParts[1]); if(classNameParts.length == 3) { - return new MicroMigrationVersion(majorVersion, minorVersion); + return new MigrationVersion(majorVersion, minorVersion); } int patchVersion = Integer.parseInt(classNameParts[2]); - return new MicroMigrationVersion(majorVersion, minorVersion, patchVersion); + return new MigrationVersion(majorVersion, minorVersion, patchVersion); } catch (NumberFormatException e) { @@ -73,7 +73,7 @@ private MicroMigrationVersion createTargetVersionFromClassName() } @Override - public MicroMigrationVersion getTargetVersion() + public MigrationVersion getTargetVersion() { return this.version; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java index 7698ae2..e96b2e2 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -3,7 +3,7 @@ import java.util.Objects; import java.util.function.BiConsumer; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.types.EmbeddedStorageManager; /** @@ -13,9 +13,9 @@ * @author Johannes Rabauer * */ -public class SimpleMigrationScript implements MicroMigrationScript +public class SimpleMigrationScript implements MigrationScript { - private final MicroMigrationVersion version; + private final MigrationVersion version; private final BiConsumer consumer; /** @@ -23,7 +23,7 @@ public class SimpleMigrationScript implements MicroMigrationScript * @param consumer which is executed to reach the given datastore version */ public SimpleMigrationScript( - final MicroMigrationVersion version, + final MigrationVersion version, final BiConsumer consumer ) { @@ -34,7 +34,7 @@ public SimpleMigrationScript( } @Override - public MicroMigrationVersion getTargetVersion() + public MigrationVersion getTargetVersion() { return this.version; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java b/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java similarity index 84% rename from src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java rename to src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java index c1fdcfe..d77e483 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MicroMigrationVersion.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java @@ -8,13 +8,13 @@ * @author Johannes Rabauer * */ -public class MicroMigrationVersion +public class MigrationVersion { private final int majorVersion; private final int minorVersion; private final int patchVersion; - public MicroMigrationVersion + public MigrationVersion ( int majorVersion ) @@ -22,7 +22,7 @@ public class MicroMigrationVersion this(majorVersion, 0); } - public MicroMigrationVersion + public MigrationVersion ( int majorVersion, int minorVersion @@ -31,7 +31,7 @@ public class MicroMigrationVersion this(majorVersion, minorVersion, 0); } - public MicroMigrationVersion + public MigrationVersion ( int majorVersion, int minorVersion, @@ -80,7 +80,7 @@ public boolean equals(Object obj) return false; if (getClass() != obj.getClass()) return false; - MicroMigrationVersion other = (MicroMigrationVersion) obj; + MigrationVersion other = (MigrationVersion) obj; if (majorVersion != other.majorVersion) return false; if (minorVersion != other.minorVersion) @@ -90,10 +90,10 @@ public boolean equals(Object obj) return true; } - public static Comparator COMPARATOR = new Comparator() + public static Comparator COMPARATOR = new Comparator() { @Override - public int compare(MicroMigrationVersion o1, MicroMigrationVersion o2) + public int compare(MigrationVersion o1, MigrationVersion o2) { int majorVersionCompare = Integer.compare(o1.majorVersion, o2.majorVersion); if(majorVersionCompare != 0) diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java b/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java index ab7f3ed..cf4e8d3 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java @@ -1,14 +1,15 @@ package de.johannes_rabauer.micromigration.version; +import de.johannes_rabauer.micromigration.MigrationManager; + /** - * This class is inserted as the root of the MicroStream datastore and contains only the - * current version and the actual root object. + * Interface used by the {@link MigrationManager} for easier versioning of objects. * * @author Johannes Rabauer * */ public interface Versioned { - public void setVersion(MicroMigrationVersion version); - public MicroMigrationVersion getVersion(); + public void setVersion(MigrationVersion version); + public MigrationVersion getVersion(); } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java index 5c1b3de..2eb8bde 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java @@ -3,42 +3,43 @@ import java.util.Objects; /** - * This class is inserted as the root of the MicroStream datastore and contains only the - * current version and the actual root object. + * Simple container to hold a specific object and a correlating version for it. + * + * @param type of the object that's contained * * @author Johannes Rabauer * */ -public class VersionedObject implements Versioned +public class VersionedObject implements Versioned { - private MicroMigrationVersion currentVersion; - private Object actualObject ; + private MigrationVersion currentVersion; + private T actualObject ; - public VersionedObject(Object actualObject) + public VersionedObject(T actualObject) { - this.actualObject = actualObject ; - this.currentVersion = new MicroMigrationVersion(0,0,0); + this.actualObject = actualObject ; + this.currentVersion = new MigrationVersion(0,0,0); } @Override - public void setVersion(MicroMigrationVersion version) + public void setVersion(MigrationVersion version) { Objects.requireNonNull(version); this.currentVersion = version; } @Override - public MicroMigrationVersion getVersion() + public MigrationVersion getVersion() { return this.currentVersion; } - public void setObject(Object actualObject) + public void setObject(T actualObject) { this.actualObject = actualObject; } - public Object getObject() + public T getObject() { return this.actualObject; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java index 0064987..b426681 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java @@ -11,24 +11,24 @@ */ public class VersionedRoot implements Versioned { - private MicroMigrationVersion currentVersion; + private MigrationVersion currentVersion; private Object actualRoot ; public VersionedRoot(Object actualRoot) { this.actualRoot = actualRoot ; - this.currentVersion = new MicroMigrationVersion(0,0,0); + this.currentVersion = new MigrationVersion(0,0,0); } @Override - public void setVersion(MicroMigrationVersion version) + public void setVersion(MigrationVersion version) { Objects.requireNonNull(version); this.currentVersion = version; } @Override - public MicroMigrationVersion getVersion() + public MigrationVersion getVersion() { return this.currentVersion; } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java index 77aae0c..7f0ff87 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java @@ -12,7 +12,7 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.types.EmbeddedStorage; import one.microstream.storage.types.EmbeddedStorageManager; @@ -30,7 +30,7 @@ public void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorage } final ExplicitMigrater migrater = new ExplicitMigrater( - new MicroMigrationScriptDummy(new MicroMigrationVersion(1)) + new MicroMigrationScriptDummy(new MigrationVersion(1)) ); try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java index fe7351b..d979d1f 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java @@ -12,9 +12,9 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.MigrationManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; -import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleMigrationScript; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; import de.johannes_rabauer.micromigration.version.VersionedObject; import one.microstream.storage.configuration.Configuration; @@ -32,13 +32,13 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag migrationStorageManager.setRoot(0); migrationStorageManager.storeRoot(); assertEquals(0, migrationStorageManager.root()); - assertEquals(new MicroMigrationVersion(0,0,0), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(0,0,0), migrationStorageManager.getCurrentVersion()); } //Run with one migration script - final MicroMigrationScript firstScript = new SimpleMigrationScript( - new MicroMigrationVersion(1), + final MigrationScript firstScript = new SimpleMigrationScript( + new MigrationVersion(1), (root, storage) -> storage.setRoot(1) ); @@ -46,20 +46,20 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) { assertEquals(1, migrationStorageManager.root()); - assertEquals(new MicroMigrationVersion(1,0,0), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(1,0,0), migrationStorageManager.getCurrentVersion()); } //Run with two migration scripts - final MicroMigrationScript secondScript = new SimpleMigrationScript( - new MicroMigrationVersion(2), + final MigrationScript secondScript = new SimpleMigrationScript( + new MigrationVersion(2), (root, storage) -> storage.setRoot(2) ); final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) { assertEquals(2, migrationStorageManager.root()); - assertEquals(new MicroMigrationVersion(2,0,0), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(2,0,0), migrationStorageManager.getCurrentVersion()); } } @@ -73,13 +73,13 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag storageManager.setRoot(firstRoot); storageManager.storeRoot(); assertEquals(0, firstRoot.getObject()); - assertEquals(new MicroMigrationVersion(0,0,0), firstRoot.getVersion()); + assertEquals(new MigrationVersion(0,0,0), firstRoot.getVersion()); } //Run with one migration script - final MicroMigrationScript firstScript = new SimpleMigrationScript( - new MicroMigrationVersion(1), + final MigrationScript firstScript = new SimpleMigrationScript( + new MigrationVersion(1), (root, storage) -> ((VersionedObject)root).setObject(1) ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) @@ -92,13 +92,13 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag .migrate(storageManager.root()); VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(1, currentRoot.getObject()); - assertEquals(new MicroMigrationVersion(1,0,0), currentRoot.getVersion()); + assertEquals(new MigrationVersion(1,0,0), currentRoot.getVersion()); } //Run with two migration scripts - final MicroMigrationScript secondScript = new SimpleMigrationScript( - new MicroMigrationVersion(2), + final MigrationScript secondScript = new SimpleMigrationScript( + new MigrationVersion(2), (root, storage) -> ((VersionedObject)root).setObject(2) ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) @@ -111,7 +111,7 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag .migrate(storageManager.root()); VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(2, currentRoot.getObject()); - assertEquals(new MicroMigrationVersion(2,0,0), currentRoot.getVersion()); + assertEquals(new MigrationVersion(2,0,0), currentRoot.getVersion()); } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java index 946c069..cf8ac0d 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java @@ -12,9 +12,9 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; -import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleMigrationScript; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; public class StoreStuffInMigrationStorageManager { @@ -31,8 +31,8 @@ private static class ChildClass @Test public void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final MicroMigrationScript script = new SimpleMigrationScript( - new MicroMigrationVersion(1), + final MigrationScript script = new SimpleMigrationScript( + new MigrationVersion(1), (root, storage) -> {} ); final ExplicitMigrater migrater = new ExplicitMigrater(script); diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java index 5433abb..643b1a6 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; class ExplicitMigraterTest { @@ -19,8 +19,8 @@ void testGetSortedScripts_empty() { @Test void testGetSortedScripts_sorted() { final ExplicitMigrater migrater = new ExplicitMigrater( - new MicroMigrationScriptDummy(new MicroMigrationVersion(1)), - new MicroMigrationScriptDummy(new MicroMigrationVersion(2)) + new MicroMigrationScriptDummy(new MigrationVersion(1)), + new MicroMigrationScriptDummy(new MigrationVersion(2)) ); assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getMajorVersion()); assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getMajorVersion()); @@ -29,8 +29,8 @@ void testGetSortedScripts_sorted() { @Test void testGetSortedScripts_unsorted() { final ExplicitMigrater migrater = new ExplicitMigrater( - new MicroMigrationScriptDummy(new MicroMigrationVersion(2)), - new MicroMigrationScriptDummy(new MicroMigrationVersion(1)) + new MicroMigrationScriptDummy(new MigrationVersion(2)), + new MicroMigrationScriptDummy(new MigrationVersion(1)) ); assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getMajorVersion()); assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getMajorVersion()); diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index 50ed110..d4ad5a3 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.types.EmbeddedStorageManager; class ReflectiveVersionMigrationScriptTest @@ -15,42 +15,42 @@ public static class v1_CorrectClassName extends ReflectiveVersionMigrationScript @Test void testCorrectName_v1_CorrectClassName() { - assertEquals(new MicroMigrationVersion(1, 0, 0), new v1_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(1, 0, 0), new v1_CorrectClassName().getTargetVersion()); } public static class v1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v1_1_CorrectClassName() { - assertEquals(new MicroMigrationVersion(1, 1, 0), new v1_1_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(1, 1, 0), new v1_1_CorrectClassName().getTargetVersion()); } public static class v1_1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v1_1_1_CorrectClassName() { - assertEquals(new MicroMigrationVersion(1, 1, 1), new v1_1_1_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(1, 1, 1), new v1_1_1_CorrectClassName().getTargetVersion()); } public static class v10_1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v10_1_1_CorrectClassName() { - assertEquals(new MicroMigrationVersion(10, 1, 1), new v10_1_1_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(10, 1, 1), new v10_1_1_CorrectClassName().getTargetVersion()); } public static class v10_10_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v10_10_1_CorrectClassName() { - assertEquals(new MicroMigrationVersion(10, 10, 1), new v10_10_1_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(10, 10, 1), new v10_10_1_CorrectClassName().getTargetVersion()); } public static class v10_10_10_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v10_10_10_CorrectClassName() { - assertEquals(new MicroMigrationVersion(10, 10, 10), new v10_10_10_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(10, 10, 10), new v10_10_10_CorrectClassName().getTargetVersion()); } public static class a1_InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } diff --git a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java index a882adc..0b1fe8d 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,20 +1,20 @@ package de.johannes_rabauer.micromigration.testUtil; -import de.johannes_rabauer.micromigration.scripts.MicroMigrationScript; -import de.johannes_rabauer.micromigration.version.MicroMigrationVersion; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.types.EmbeddedStorageManager; -public class MicroMigrationScriptDummy implements MicroMigrationScript +public class MicroMigrationScriptDummy implements MigrationScript { - private final MicroMigrationVersion version; + private final MigrationVersion version; - public MicroMigrationScriptDummy(MicroMigrationVersion version) + public MicroMigrationScriptDummy(MigrationVersion version) { this.version = version; } @Override - public MicroMigrationVersion getTargetVersion() + public MigrationVersion getTargetVersion() { return this.version; } From cf7f9849e5fbcd5724678d99da78f6ad9ef82582 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 25 Dec 2020 10:48:37 +0100 Subject: [PATCH 018/306] Restructured for use of generics --- .../migrater/AbstractMigrater.java | 75 +++++++++++++++++++ .../migrater/ExplicitMigrater.java | 10 +-- .../migrater/MicroMigrater.java | 58 +++----------- .../micromigration/scripts/Context.java | 40 ++++++++++ .../scripts/MigrationScript.java | 15 ++-- .../ReflectiveVersionMigrationScript.java | 2 +- .../scripts/SimpleMigrationScript.java | 39 ++-------- .../scripts/SimpleTypedMigrationScript.java | 46 ++++++++++++ .../MigrationScriptAfterScript.java | 31 ++++---- .../StoreStuffInMigrationStorageManager.java | 6 +- .../ReflectiveVersionMigrationScriptTest.java | 5 +- .../testUtil/MicroMigrationScriptDummy.java | 9 +-- 12 files changed, 215 insertions(+), 121 deletions(-) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java new file mode 100644 index 0000000..2049eba --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java @@ -0,0 +1,75 @@ +package de.johannes_rabauer.micromigration.migrater; + +import java.util.Objects; +import java.util.TreeSet; + +import de.johannes_rabauer.micromigration.scripts.Context; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; +import one.microstream.storage.types.EmbeddedStorageManager; + +public abstract class AbstractMigrater implements MicroMigrater +{ + @Override + public MigrationVersion migrateToNewest( + MigrationVersion fromVersion , + EmbeddedStorageManager storageManager, + Object root + ) + { + Objects.requireNonNull(fromVersion); + Objects.requireNonNull(storageManager); + + TreeSet> sortedScripts = getSortedScripts(); + if(sortedScripts.size() > 0) + { + return migrateToVersion( + fromVersion , + getSortedScripts().last().getTargetVersion(), + storageManager , + root + ); + } + return fromVersion; + } + + @Override + public MigrationVersion migrateToVersion + ( + MigrationVersion fromVersion , + MigrationVersion targetVersion , + EmbeddedStorageManager storageManager , + Object objectToMigrate + ) + { + Objects.requireNonNull(fromVersion); + Objects.requireNonNull(targetVersion); + Objects.requireNonNull(storageManager); + + MigrationVersion updateVersionWhichWasExecuted = fromVersion; + for (MigrationScript script : this.getSortedScripts()) + { + if(MigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) + { + if(MigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) + { + updateVersionWhichWasExecuted = migrateWithScript(script, storageManager, objectToMigrate); + } + } + } + return updateVersionWhichWasExecuted; + } + + @SuppressWarnings("unchecked") + private MigrationVersion migrateWithScript( + MigrationScript script , + EmbeddedStorageManager storageManager , + Object objectToMigrate + ) + { + T castedObjectToMigrate = (T) objectToMigrate; + script.migrate(new Context<>(castedObjectToMigrate, storageManager)); + return script.getTargetVersion(); + } + +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 587a505..737d103 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -12,23 +12,23 @@ * @author Johannes Rabauer * */ -public class ExplicitMigrater implements MicroMigrater +public class ExplicitMigrater extends AbstractMigrater { - private final TreeSet sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); + private final TreeSet> sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); /** * @param scripts are all the scripts that are executed, if the current version is lower than this of the script */ - public ExplicitMigrater(MigrationScript ...scripts) + public ExplicitMigrater(MigrationScript ...scripts) { - for (MigrationScript script : scripts) + for (MigrationScript script : scripts) { this.sortedScripts.add(script); } } @Override - public TreeSet getSortedScripts() { + public TreeSet> getSortedScripts() { return this.sortedScripts; } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index ca67616..0d2f9b6 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -1,6 +1,5 @@ package de.johannes_rabauer.micromigration.migrater; -import java.util.Objects; import java.util.TreeSet; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; @@ -16,7 +15,7 @@ */ public interface MicroMigrater { - public TreeSet getSortedScripts(); + public TreeSet> getSortedScripts(); /** * Executes all the scripts that are available to the migrater. @@ -39,26 +38,11 @@ public interface MicroMigrater * * @return the target version of the last executed script */ - public default MigrationVersion migrateToNewest( - MigrationVersion fromVersion , + public MigrationVersion migrateToNewest( + MigrationVersion fromVersion , EmbeddedStorageManager storageManager, Object root - ) - { - Objects.requireNonNull(fromVersion); - Objects.requireNonNull(storageManager); - TreeSet sortedScripts = getSortedScripts(); - if(sortedScripts.size() > 0) - { - return migrateToVersion( - fromVersion , - getSortedScripts().last().getTargetVersion(), - storageManager , - root - ); - } - return fromVersion; - } + ); /** * Executes all the scripts that are available to the migrater until the given targetVersion is reached. @@ -79,34 +63,16 @@ public default MigrationVersion migrateToNewest( * @param storageManager is relayed to the scripts {@link MigrationScript#execute(Object, EmbeddedStorageManager)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param root is relayed to the scripts {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} - * method. This way the script can change something within the root object. + * @param objectToMigrate is relayed to the scripts {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * method. This way the script can change something within the object to migrate. * * @return the target version of the last executed script */ - public default MigrationVersion migrateToVersion + public MigrationVersion migrateToVersion ( - MigrationVersion fromVersion , - MigrationVersion targetVersion , - EmbeddedStorageManager storageManager, - Object root - ) - { - Objects.requireNonNull(fromVersion); - Objects.requireNonNull(targetVersion); - Objects.requireNonNull(storageManager); - MigrationVersion updateVersionWhichWasExecuted = fromVersion; - for (MigrationScript script : this.getSortedScripts()) - { - if(MigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) - { - if(MigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) - { - script.execute(root, storageManager); - updateVersionWhichWasExecuted = script.getTargetVersion(); - } - } - } - return updateVersionWhichWasExecuted; - } + MigrationVersion fromVersion , + MigrationVersion targetVersion , + EmbeddedStorageManager storageManager , + Object objectToMigrate + ); } diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java new file mode 100644 index 0000000..8519d8e --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java @@ -0,0 +1,40 @@ +package de.johannes_rabauer.micromigration.scripts; + +import one.microstream.storage.types.EmbeddedStorageManager; + +/** + * Container that holds necessary information for the execution of an {@link MigrationScript} + * + * @author Johannes Rabauer + */ +public class Context +{ + private final T migratingObject; + private final EmbeddedStorageManager storageManager ; + + public Context( + final T migratingObject, + final EmbeddedStorageManager storageManager + ) + { + super(); + this.migratingObject = migratingObject; + this.storageManager = storageManager ; + } + + /** + * @return the current object where the migration is executed upon + */ + public T getMigratingObject() + { + return migratingObject; + } + + /** + * @return the responsible storage manager for the migrating object + */ + public EmbeddedStorageManager getStorageManager() + { + return storageManager; + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java index dfef725..b8d4593 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java @@ -4,7 +4,6 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.types.EmbeddedStorageManager; /** * Interface for scripts to migrate / update datastores. @@ -16,7 +15,7 @@ * @author Johannes Rabauer * */ -public interface MigrationScript +public interface MigrationScript { /** * @return the version of the datastore after this script is executed. @@ -27,18 +26,14 @@ public interface MigrationScript * Execute logic to migrate the given datastore to a newer version of the store. * After executing the {@link #getTargetVersion()} is reached. * - * @param root which is the current root object. Must be cast to the desired class. - * @param storageManager for storing-calls or other usage + * @param context that holds necessary data for the migration */ - public void execute( - Object root , - EmbeddedStorageManager storageManager - ); + public void migrate(Context context); - public static Comparator COMPARATOR = new Comparator() + public static Comparator> COMPARATOR = new Comparator>() { @Override - public int compare(MigrationScript o1, MigrationScript o2) { + public int compare(MigrationScript o1, MigrationScript o2) { return MigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); } }; diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java index 49e8096..2fbb8b9 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -22,7 +22,7 @@ * @author Johannes Rabauer * */ -public abstract class ReflectiveVersionMigrationScript implements MigrationScript +public abstract class ReflectiveVersionMigrationScript implements MigrationScript { private final static char PREFIX = 'v'; private final static String VERSION_SEPERATOR = "_"; diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java index e96b2e2..2629e91 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -1,48 +1,23 @@ package de.johannes_rabauer.micromigration.scripts; -import java.util.Objects; -import java.util.function.BiConsumer; +import java.util.function.Consumer; import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.types.EmbeddedStorageManager; /** * Provides a simple way to create a migration script with the necessary version - * and {@link BiConsumer}. + * and {@link Consumer}. * * @author Johannes Rabauer * */ -public class SimpleMigrationScript implements MigrationScript +public class SimpleMigrationScript extends SimpleTypedMigrationScript { - private final MigrationVersion version; - private final BiConsumer consumer; - - /** - * @param version of the datastore after this script is executed - * @param consumer which is executed to reach the given datastore version - */ public SimpleMigrationScript( - final MigrationVersion version, - final BiConsumer consumer - ) + final MigrationVersion version , + final Consumer> consumer + ) { - Objects.requireNonNull(version); - Objects.requireNonNull(consumer); - this.version = version ; - this.consumer = consumer; + super(version, consumer); } - - @Override - public MigrationVersion getTargetVersion() - { - return this.version; - } - - @Override - public void execute(Object root, EmbeddedStorageManager storageManager) - { - this.consumer.accept(root, storageManager); - } - } diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java new file mode 100644 index 0000000..733b764 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java @@ -0,0 +1,46 @@ +package de.johannes_rabauer.micromigration.scripts; + +import java.util.Objects; +import java.util.function.Consumer; + +import de.johannes_rabauer.micromigration.version.MigrationVersion; + +/** + * Provides a simple way to create a migration script with the necessary version + * and {@link Consumer}. + * + * @author Johannes Rabauer + * + */ +public class SimpleTypedMigrationScript implements MigrationScript +{ + private final MigrationVersion version ; + private final Consumer> consumer; + + /** + * @param version of the datastore after this script is executed + * @param consumer which is executed to reach the given datastore version + */ + public SimpleTypedMigrationScript( + final MigrationVersion version , + final Consumer> consumer + ) + { + Objects.requireNonNull(version ); + Objects.requireNonNull(consumer); + this.version = version ; + this.consumer = consumer; + } + + @Override + public MigrationVersion getTargetVersion() + { + return this.version; + } + + @Override + public void migrate(Context context) + { + this.consumer.accept(context); + } +} diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java index d979d1f..ff7511f 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java @@ -13,7 +13,7 @@ import de.johannes_rabauer.micromigration.MigrationManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.scripts.SimpleMigrationScript; +import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; import de.johannes_rabauer.micromigration.version.VersionedObject; @@ -37,10 +37,9 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag //Run with one migration script - final MigrationScript firstScript = new SimpleMigrationScript( + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), - (root, storage) -> - storage.setRoot(1) + (context) -> context.getStorageManager().setRoot(1) ); final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) @@ -51,9 +50,9 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag //Run with two migration scripts - final MigrationScript secondScript = new SimpleMigrationScript( + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), - (root, storage) -> storage.setRoot(2) + (context) -> context.getStorageManager().setRoot(2) ); final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) @@ -69,18 +68,18 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag //First run without any migration script try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - VersionedObject firstRoot = new VersionedObject(0); + VersionedObject firstRoot = new VersionedObject<>(0); storageManager.setRoot(firstRoot); storageManager.storeRoot(); - assertEquals(0, firstRoot.getObject()); + assertEquals(Integer.valueOf(0), firstRoot.getObject()); assertEquals(new MigrationVersion(0,0,0), firstRoot.getVersion()); } //Run with one migration script - final MigrationScript firstScript = new SimpleMigrationScript( + final MigrationScript> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), - (root, storage) -> ((VersionedObject)root).setObject(1) + (context) -> context.getMigratingObject().setObject(1) ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { @@ -90,16 +89,16 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag storageManager ) .migrate(storageManager.root()); - VersionedObject currentRoot = (VersionedObject)storageManager.root(); - assertEquals(1, currentRoot.getObject()); + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(1), currentRoot.getObject()); assertEquals(new MigrationVersion(1,0,0), currentRoot.getVersion()); } //Run with two migration scripts - final MigrationScript secondScript = new SimpleMigrationScript( + final MigrationScript> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), - (root, storage) -> ((VersionedObject)root).setObject(2) + (context) -> context.getMigratingObject().setObject(2) ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { @@ -109,8 +108,8 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag storageManager ) .migrate(storageManager.root()); - VersionedObject currentRoot = (VersionedObject)storageManager.root(); - assertEquals(2, currentRoot.getObject()); + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(2), currentRoot.getObject()); assertEquals(new MigrationVersion(2,0,0), currentRoot.getVersion()); } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java index cf8ac0d..8f6e1cb 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java @@ -13,7 +13,7 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.scripts.SimpleMigrationScript; +import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; public class StoreStuffInMigrationStorageManager @@ -31,9 +31,9 @@ private static class ChildClass @Test public void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final MigrationScript script = new SimpleMigrationScript( + final MigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), - (root, storage) -> {} + (context) -> {} ); final ExplicitMigrater migrater = new ExplicitMigrater(script); //Create new store and change stored object diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index d4ad5a3..9b67cb1 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test; import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.types.EmbeddedStorageManager; class ReflectiveVersionMigrationScriptTest { @@ -126,10 +125,10 @@ void testInvalildName_v___InvalidClassName() } - public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript + public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript { @Override - public void execute(Object root, EmbeddedStorageManager storageManager) { + public void migrate(Context context) { //Dummy } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java index 0b1fe8d..6805aa8 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,10 +1,10 @@ package de.johannes_rabauer.micromigration.testUtil; +import de.johannes_rabauer.micromigration.scripts.Context; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.types.EmbeddedStorageManager; -public class MicroMigrationScriptDummy implements MigrationScript +public class MicroMigrationScriptDummy implements MigrationScript { private final MigrationVersion version; @@ -18,10 +18,9 @@ public MigrationVersion getTargetVersion() { return this.version; } - + @Override - public void execute(Object root, EmbeddedStorageManager storageManager) { + public void migrate(Context context) { // Don't do anything. } - } From ccdb97b680d4ae5ef799d9b1500e688757a0b586 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sat, 26 Dec 2020 21:01:43 +0100 Subject: [PATCH 019/306] Expanded README.md --- README.md | 73 ++++++++++++++++++++++++++++------ docs/MigrationSequence.drawio | 1 + docs/MigrationSequence_1.png | Bin 0 -> 4372 bytes docs/MigrationSequence_2.png | Bin 0 -> 11729 bytes docs/MigrationSequence_3.png | Bin 0 -> 15863 bytes docs/MigrationSequence_4.png | Bin 0 -> 20410 bytes 6 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 docs/MigrationSequence.drawio create mode 100644 docs/MigrationSequence_1.png create mode 100644 docs/MigrationSequence_2.png create mode 100644 docs/MigrationSequence_3.png create mode 100644 docs/MigrationSequence_4.png diff --git a/README.md b/README.md index ed3eb53..5e4faf5 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,89 @@ -# micro-migration -Migration Lib for MicroStream. +# Micro migration +When you think about default database setup, you probably imagine something like this: + +![Imaginative system layout](./docs/MigrationSequence_1.png "Imaginative system layout") + +Yet in reality most workflows involve different systems like test systems and prodution systems. +In code this workflow is represented with version-control systems and different branches. + +![Code workflow](./docs/MigrationSequence_2.png "Code workflow") + +For this code workflow to behave correctly, for each system a seperate datastore is needed. +To keep these datastores to represent the correspondend data for the code is a hassle. + +![Code workflow with datastore](./docs/MigrationSequence_3.png "Code workflow with datastore") + +That's why migration frameworks like [Flyway](https://flywaydb.org) and [Liquibase](https://www.liquibase.org/) exist. +Unfortunately both these frameworks are designed to support any type of SQL databases but no NoSQL +databases like [MicroStream](https://microstream.one/). This led to the creation of this library. This library delivers an easy concept to keep your MicroStream datastore versioned with migration scripts written in plain java. +It's easy to create code, that automatically brings an datastore with an older version to +the version, suited to the current code. + +![Migrate datastore to new version](./docs/MigrationSequence_4.png "Migrate datastore to new version") + +## Approaches +There are two possible usages with the Micro migration library: +The **first**, easier approach is to use the `MigrationEmbeddedStorageManager`. It can be used on a brand new datastore or introduced later, after a MicroStream datastore is already in use. Only the storage manager (`MigrationEmbeddedStorageManager`) knows about the versioning. The rest of application does not know about the version and can have no regards about it. -## Usage example +### `MigrationEmbeddedStorageManager` Extensive examples can be found in its [own repository](https://github.com/JohannesRabauer/micro-migration-examples). A simple example where scripts need to be registered in the `ExplicitMigrater`: + ```java public static void main(String[] args) { - final ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); - final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); + ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); + MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); //Do some business logic storageManager.shutdown(); } ``` + The update scripts can look like this: + ```java -public class UpdateToV1_0 implements MicroMigrationScript +public class UpdateToV1_0 implements MigrationScript { - public MicroMigrationVersion getTargetVersion(){ - return new MicroMigrationVersion(1,0); + @Override + public MigrationVersion getTargetVersion(){ + return new MigrationVersion(1); } - - public void execute(Object root, MigrationEmbeddedStorageManager storageManager){ - //Logic of the update - storageManager.setRoot("Update 1.0"); + + @Override + public void migrate(Context context) + { + //Logic of the update + context.getStorageManager().setRoot("Update 1.0"); } } ``` +### `MigrationManager` +Although the approach with the `MigrationEmbeddedStorageManager` is pretty easy to handle, it is intrusive +in the way, that it replaces the root entry point of the MicroStream datastore and inserts its own `VersionedRoot` as root. Some users might find this too entrusive. + +That's why a second approach can be used, where the `MigrationManager` is used. This class is also used internally by +the `MigrationEmbeddedStorageManager`. + +```java +public static void main(String[] args) +{ + ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); + EmbeddedStorageManager storageManager = EmbeddedStorage.start(); + VersionedObject versionedRoot =(VersionedObject)storageManager.root(); + new MigrationManager(versionedRoot, migrater, storageManager).migrate(versionedBranch); + //Do some business logic + storageManager.shutdown(); +} +``` + ## Migrater ### `ExplicitMigrater` Scripts for the migrations must be registered in a `MicroMigrater`. diff --git a/docs/MigrationSequence.drawio b/docs/MigrationSequence.drawio new file mode 100644 index 0000000..4d51a09 --- /dev/null +++ b/docs/MigrationSequence.drawio @@ -0,0 +1 @@ +7V1bd6I6FP41fTxdgXDz0VtbusR2qp2OviGkiKK4ABX89ScoVK6KjiKek1ljhRBCsvPtvb+EZPsAmzP32ZIXY8lUkfFAA9V9gK0HmqZYFuAvP8XbpQgc3CVolq4GmfYJPX2DgsTgPm2pq8iOZXRM03D0RTxRMedzpDixNNmyzHU827dpxJ+6kDWUSugpspFO/dJVZxykUlxtf+EF6do4eLRA87sLMznMHLTEHsuquY4kwfYDbFqm6eyOZm4TGb7wQrns7nvKufpTMQvNnSI3iCtlyk1setUE7qepeI7Ze/mHEnbFrGRjGbQ4qK3jhSLAFV/4h98Gcuu+SB9gA83V4LClGLJt6wpOHDszAydQ+PDbnDtP8kw3/G7vIc1EuMxPcXunY3l/cCoITwb+ySMbnrbc6MWWF565uvMnKN0/jtyFz/Y3+SfhPd+6YTRNw7S2DYHN7T+cvmsiUlNdv5dlkGSbS0tBBwQYoNmRLQ05B/LVfnocqwoyZwi3Dd+33mMq1JRxBE1hmoUM2dFX8erKAbS1n+J+nvBu6rghNAjVkGN3t4RKGJYbFrFrZnBXFEOJgrBCxwsCiYJ2ckgVhA8izd4nbSF6ClxrBK5/BddaQbhS9C3xSkMQgxnLn4lXCNjDBV0Zr6HtJ3g9E68UXRSw7E0ByyQAK5wL2ISBTRV0bcBSxwGrWeZyEWRDloPcmNACIiaPwu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UUD1AidvPgL8nyYypYScHa28JulAzDIf7UC6FgPsQXHXfBq/ZMO05LRP6KNsywXuHNQZNp+ZO27JbuzUgXJK1k3tgj3f3Xe+rvCVoGTh09FwTI2Z6Ol/TdAuSIy2Mf4ygcqCxxhSPMoOJK/hns5cKQXPnwgWY2rKQi74c5VswaS8gcZ8mcy5H895UyH1mi7SFlutfBHHW3F0heOfbfyD8RNZy30KVXcXIFtr7gYfWGjuPDCQQSaq9iTOSg9wwS2/7JmmH6u3MLmsIm1VlS6C2CZ3ohLD+wO9EAxGc/N+eFFbdcTb7hw7GbiLMBJj+7ZztktfUyeB/dRH2TQR3dXhyg5uruavenu6uSm6NQCxcK7qxOBMEoOX8EViD5+hygKbd9xFN04CorwCHlICzxkeMgJXHzc+w94BILAcDxk8TcQqFr46xSnoozi4CNPMbTABn8Tv2daMugKBNW8R9AVjWSyG5fdDHT8QdDVHmsUxUKaY/B3jUpMqRQGHH8QcCWHkOCyBsJXB1wYvyQMUlIkfokPz3DKHxkjc93eJ5SA4NsCUzgITOoyyAzfLyRHJkegiLEhe5FsCz+Dnd+YnMfsgb0r8LIwTw/pS4T5KWF6ojA3LWdsauZcNqJY3wcN2scJGjxEwwTlBA3ylQYfh69yylObAoafu2kIq4xZqNqZrJWvPUKGw8oo7P7GF9oX5ROn6hTNZlc/NzZcIn84mZbvtMCh/FdS2vQ8UBlKe1wBQ+/1o8qDiJLnqPWZSnt9DRXuQ0OppIamIoYX1VDhsIaWTMD4AsPMs4LOleKtrg9PcEvU0XGrR50bKI5NlMOVjLECo8qSMHZmwMMCOCsae5C/KaLYROxB4VyeAYUjBZ2NKXxqmaYTzW7Ji7FkqsjP8S8= \ No newline at end of file diff --git a/docs/MigrationSequence_1.png b/docs/MigrationSequence_1.png new file mode 100644 index 0000000000000000000000000000000000000000..822153dcdbf05977beb2bd4527ebe67b2f9d8f06 GIT binary patch literal 4372 zcmaJ_2Ut|sx>YfVv0$QNVgZa96C2E&=|O~PXNKv$fs*OHpD7Gd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ationVersion from major/minor/patch-Version to an array of int versions --- .../ReflectiveVersionMigrationScript.java | 16 ++- .../version/MigrationVersion.java | 102 ++++++++---------- .../version/VersionedObject.java | 2 +- .../micromigration/version/VersionedRoot.java | 6 +- ...IntroduceMigrationOnExistingDatastore.java | 2 +- .../MigrationScriptAfterScript.java | 12 +-- .../migrater/ExplicitMigraterTest.java | 8 +- .../ReflectiveVersionMigrationScriptTest.java | 4 +- .../version/MigrationVersionTest.java | 45 ++++++++ 9 files changed, 111 insertions(+), 86 deletions(-) create mode 100644 src/test/java/de/johannes_rabauer/micromigration/version/MigrationVersionTest.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java index 2fbb8b9..7a729c3 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -1,5 +1,7 @@ package de.johannes_rabauer.micromigration.scripts; +import java.util.ArrayList; + import de.johannes_rabauer.micromigration.version.MigrationVersion; /** @@ -53,18 +55,12 @@ private MigrationVersion createTargetVersionFromClassName() } try { - int majorVersion = Integer.parseInt(classNameParts[0]); - if(classNameParts.length == 2) - { - return new MigrationVersion(majorVersion); - } - int minorVersion = Integer.parseInt(classNameParts[1]); - if(classNameParts.length == 3) + final ArrayList versionNumbers = new ArrayList<>(); + for(int i = 0; i < classNameParts.length - 1; i++) { - return new MigrationVersion(majorVersion, minorVersion); + versionNumbers.add(Integer.parseInt(classNameParts[i])); } - int patchVersion = Integer.parseInt(classNameParts[2]); - return new MigrationVersion(majorVersion, minorVersion, patchVersion); + return new MigrationVersion(versionNumbers); } catch (NumberFormatException e) { diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java b/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java index d77e483..34d51f4 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java @@ -1,6 +1,8 @@ package de.johannes_rabauer.micromigration.version; +import java.util.Arrays; import java.util.Comparator; +import java.util.List; /** * Defines one version of the MicroStream datastore. @@ -10,64 +12,60 @@ */ public class MigrationVersion { - private final int majorVersion; - private final int minorVersion; - private final int patchVersion; + private final int[] versions; - public MigrationVersion - ( - int majorVersion - ) + public MigrationVersion(int... versions) { - this(majorVersion, 0); - } - - public MigrationVersion - ( - int majorVersion, - int minorVersion - ) - { - this(majorVersion, minorVersion, 0); + if(versions == null || versions.length == 0) + { + this.versions = new int[] {0}; + } + else + { + this.versions = versions; + } } - public MigrationVersion - ( - int majorVersion, - int minorVersion, - int patchVersion - ) + public MigrationVersion(List versionsAsList) { - this.majorVersion = majorVersion; - this.minorVersion = minorVersion; - this.patchVersion = patchVersion; - } - - public int getMajorVersion() { - return majorVersion; - } - - public int getMinorVersion() { - return minorVersion; + if(versionsAsList == null || versionsAsList.size() == 0) + { + this.versions = new int[] {0}; + } + else + { + int[] versionsAsArray = new int[versionsAsList.size()]; + for(int i = 0; i < versionsAsArray.length; i++) + { + versionsAsArray[i] = versionsAsList.get(i); + } + this.versions = versionsAsArray; + } } - public int getPatchVersion() { - return patchVersion; + public int[] getVersions() + { + return this.versions; } @Override - public String toString() { - return "v" + this.majorVersion + "." + this.minorVersion + "." + this.patchVersion; + public String toString() + { + final StringBuilder sb = new StringBuilder("v"); + for (int version : versions) + { + sb.append(version).append("."); + } + sb.deleteCharAt(sb.length()-1); + return sb.toString(); } - + @Override public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + majorVersion; - result = prime * result + minorVersion; - result = prime * result + patchVersion; + result = prime * result + Arrays.hashCode(versions); return result; } @@ -81,31 +79,17 @@ public boolean equals(Object obj) if (getClass() != obj.getClass()) return false; MigrationVersion other = (MigrationVersion) obj; - if (majorVersion != other.majorVersion) - return false; - if (minorVersion != other.minorVersion) - return false; - if (patchVersion != other.patchVersion) + if (!Arrays.equals(versions, other.versions)) return false; return true; } - + public static Comparator COMPARATOR = new Comparator() { @Override public int compare(MigrationVersion o1, MigrationVersion o2) { - int majorVersionCompare = Integer.compare(o1.majorVersion, o2.majorVersion); - if(majorVersionCompare != 0) - { - return majorVersionCompare; - } - int minorVersionCompare = Integer.compare(o1.minorVersion, o2.minorVersion); - if(minorVersionCompare != 0) - { - return minorVersionCompare; - } - return Integer.compare(o1.patchVersion, o2.patchVersion); + return Arrays.compare(o1.versions, o2.versions); } }; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java index 2eb8bde..ef33ece 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java @@ -18,7 +18,7 @@ public class VersionedObject implements Versioned public VersionedObject(T actualObject) { this.actualObject = actualObject ; - this.currentVersion = new MigrationVersion(0,0,0); + this.currentVersion = new MigrationVersion(0); } @Override diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java index b426681..7e0ced7 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java @@ -12,12 +12,12 @@ public class VersionedRoot implements Versioned { private MigrationVersion currentVersion; - private Object actualRoot ; + private Object actualRoot ; public VersionedRoot(Object actualRoot) { - this.actualRoot = actualRoot ; - this.currentVersion = new MigrationVersion(0,0,0); + this.actualRoot = actualRoot ; + this.currentVersion = new MigrationVersion(0); } @Override diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java index 7f0ff87..95d7b5d 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java @@ -35,7 +35,7 @@ public void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorage try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { assertEquals(ROOT, migrationStorageManager.root()); - assertEquals(1, migrationStorageManager.getCurrentVersion().getMajorVersion()); + assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); } } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java index ff7511f..f1a52ef 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java @@ -32,7 +32,7 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag migrationStorageManager.setRoot(0); migrationStorageManager.storeRoot(); assertEquals(0, migrationStorageManager.root()); - assertEquals(new MigrationVersion(0,0,0), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); } @@ -45,7 +45,7 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) { assertEquals(1, migrationStorageManager.root()); - assertEquals(new MigrationVersion(1,0,0), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); } @@ -58,7 +58,7 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) { assertEquals(2, migrationStorageManager.root()); - assertEquals(new MigrationVersion(2,0,0), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); } } @@ -72,7 +72,7 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag storageManager.setRoot(firstRoot); storageManager.storeRoot(); assertEquals(Integer.valueOf(0), firstRoot.getObject()); - assertEquals(new MigrationVersion(0,0,0), firstRoot.getVersion()); + assertEquals(new MigrationVersion(0), firstRoot.getVersion()); } @@ -91,7 +91,7 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag .migrate(storageManager.root()); VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(1), currentRoot.getObject()); - assertEquals(new MigrationVersion(1,0,0), currentRoot.getVersion()); + assertEquals(new MigrationVersion(1), currentRoot.getVersion()); } @@ -110,7 +110,7 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag .migrate(storageManager.root()); VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(2), currentRoot.getObject()); - assertEquals(new MigrationVersion(2,0,0), currentRoot.getVersion()); + assertEquals(new MigrationVersion(2), currentRoot.getVersion()); } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java index 643b1a6..e12efd4 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java @@ -22,8 +22,8 @@ void testGetSortedScripts_sorted() { new MicroMigrationScriptDummy(new MigrationVersion(1)), new MicroMigrationScriptDummy(new MigrationVersion(2)) ); - assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getMajorVersion()); - assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getMajorVersion()); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); } @Test @@ -32,8 +32,8 @@ void testGetSortedScripts_unsorted() { new MicroMigrationScriptDummy(new MigrationVersion(2)), new MicroMigrationScriptDummy(new MigrationVersion(1)) ); - assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getMajorVersion()); - assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getMajorVersion()); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index 9b67cb1..51e40d2 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -14,14 +14,14 @@ public static class v1_CorrectClassName extends ReflectiveVersionMigrationScript @Test void testCorrectName_v1_CorrectClassName() { - assertEquals(new MigrationVersion(1, 0, 0), new v1_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(1), new v1_CorrectClassName().getTargetVersion()); } public static class v1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v1_1_CorrectClassName() { - assertEquals(new MigrationVersion(1, 1, 0), new v1_1_CorrectClassName().getTargetVersion()); + assertEquals(new MigrationVersion(1, 1), new v1_1_CorrectClassName().getTargetVersion()); } public static class v1_1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} diff --git a/src/test/java/de/johannes_rabauer/micromigration/version/MigrationVersionTest.java b/src/test/java/de/johannes_rabauer/micromigration/version/MigrationVersionTest.java new file mode 100644 index 0000000..fa37da2 --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/version/MigrationVersionTest.java @@ -0,0 +1,45 @@ +package de.johannes_rabauer.micromigration.version; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +class MigrationVersionTest +{ + + @Test + void testToString_v1() + { + MigrationVersion version = new MigrationVersion(1); + assertEquals("v1", version.toString()); + } + + @Test + void testToString_v11() + { + MigrationVersion version = new MigrationVersion(1,1); + assertEquals("v1.1", version.toString()); + } + + @Test + void testToString_v111() + { + MigrationVersion version = new MigrationVersion(1,1,1); + assertEquals("v1.1.1", version.toString()); + } + + @Test + void testToString_v0() + { + MigrationVersion version = new MigrationVersion(0); + assertEquals("v0", version.toString()); + } + + @Test + void testToString_vNull() + { + MigrationVersion version = new MigrationVersion(); + assertEquals("v0", version.toString()); + } + +} From 904d1b3868666cbdfb1e6e54cc2003affce9f4fb Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 28 Dec 2020 10:47:13 +0100 Subject: [PATCH 021/306] Added some JavaDoc --- .../micromigration/migrater/ExplicitMigrater.java | 2 +- .../micromigration/migrater/MicroMigrater.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 737d103..56562b3 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -5,7 +5,7 @@ import de.johannes_rabauer.micromigration.scripts.MigrationScript; /** - * Executes all the available scripts to migrate the datastore to a certain version. + * Contains all the available scripts to migrate the datastore to a certain version. *

* This class needs explicit scripts which are then included in the migration process. * diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 0d2f9b6..3fb07e6 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -15,6 +15,9 @@ */ public interface MicroMigrater { + /** + * @return all the contained {@link MigrationScript}s, sorted by their {@link MigrationVersion} ascending. + */ public TreeSet> getSortedScripts(); /** From 19aae97a2f467449aaf8301762660c4d411c70bf Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 28 Dec 2020 14:31:25 +0100 Subject: [PATCH 022/306] Implemented test for wrongly typed migration scripts --- .../migrater/ExplicitMigraterTest.java | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java index e12efd4..13e80c9 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java @@ -2,8 +2,15 @@ import static org.junit.jupiter.api.Assertions.assertEquals; +import java.nio.file.Path; + +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; import de.johannes_rabauer.micromigration.version.MigrationVersion; @@ -11,13 +18,15 @@ class ExplicitMigraterTest { @Test - void testGetSortedScripts_empty() { + void testGetSortedScripts_empty() + { final ExplicitMigrater migrater = new ExplicitMigrater(); assertEquals(0,migrater.getSortedScripts().size()); } @Test - void testGetSortedScripts_sorted() { + void testGetSortedScripts_sorted() + { final ExplicitMigrater migrater = new ExplicitMigrater( new MicroMigrationScriptDummy(new MigrationVersion(1)), new MicroMigrationScriptDummy(new MigrationVersion(2)) @@ -27,13 +36,38 @@ void testGetSortedScripts_sorted() { } @Test - void testGetSortedScripts_unsorted() { + void testGetSortedScripts_unsorted() + { final ExplicitMigrater migrater = new ExplicitMigrater( new MicroMigrationScriptDummy(new MigrationVersion(2)), new MicroMigrationScriptDummy(new MigrationVersion(1)) ); assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testWrongTypedVersionedScript(@TempDir Path storageFolder) + { + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(storageFolder, new ExplicitMigrater())) + { + storageManager.setRoot("SomeString"); + storageManager.storeRoot(); + } + final ExplicitMigrater migrater = new ExplicitMigrater( + new SimpleTypedMigrationScript( + new MigrationVersion(1), + (context) -> { + context.getStorageManager().setRoot(context.getMigratingObject() + 1); + } + ) + ); + Assertions.assertThrows(ClassCastException.class, () -> + { + MigrationEmbeddedStorage.start(storageFolder, migrater); + } + ); + } } From a795bef8243c50b86c04af34c105e41a427881f3 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 14 Feb 2021 17:43:48 +0100 Subject: [PATCH 023/306] Extended gitignore --- .gitignore | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c836fce..435d4b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,74 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/maven,java,eclipse,windows +# Edit at https://www.toptal.com/developers/gitignore?templates=maven,java,eclipse,windows + +### Eclipse ### +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +### Eclipse Patch ### +# Spring Boot Tooling +.sts4-cache/ + +### Java ### # Compiled class file *.class @@ -21,4 +92,44 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -/target/ + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/maven,java,eclipse,windows From c49166ffe5bace6435c8403af5cd7e7038465348 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 14 Feb 2021 17:51:35 +0100 Subject: [PATCH 024/306] Duplicated Dependency and Source/JavaDoc-Plugin in pom changed --- pom.xml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 67b6b09..c850bd9 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,30 @@ 1.8 + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + @@ -40,10 +64,5 @@ storage.embedded.configuration 04.00.00-MS-GA - - one.microstream - storage.embedded.configuration - 04.00.00-MS-GA - \ No newline at end of file From 80b7208006540be200956528105d66bd6af1f005 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 14 Feb 2021 19:48:54 +0100 Subject: [PATCH 025/306] Fixed some JavaDoc links --- .../micromigration/migrater/MicroMigrater.java | 9 ++++----- .../micromigration/scripts/MigrationScript.java | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 3fb07e6..bf8ad98 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -2,7 +2,6 @@ import java.util.TreeSet; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.types.EmbeddedStorageManager; @@ -33,10 +32,10 @@ public interface MicroMigrater * @param fromVersion is the current version of the datastore. * Scripts for lower versions then the fromVersion are not executed. * - * @param storageManager is relayed to the scripts {@link MigrationScript#execute(Object, EmbeddedStorageManager)} + * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param root is relayed to the scripts {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * @param root is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} * method. This way the script can change something within the root object. * * @return the target version of the last executed script @@ -63,10 +62,10 @@ public MigrationVersion migrateToNewest( * @param targetVersion is the highest allowed script version. * Scripts which have a higher version won't be exectued. * - * @param storageManager is relayed to the scripts {@link MigrationScript#execute(Object, EmbeddedStorageManager)} + * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param objectToMigrate is relayed to the scripts {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} + * @param objectToMigrate is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} * method. This way the script can change something within the object to migrate. * * @return the target version of the last executed script diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java index b8d4593..385e114 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java @@ -2,14 +2,13 @@ import java.util.Comparator; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.version.MigrationVersion; /** * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScript#execute(Object, MigrationEmbeddedStorageManager)} method is called, + * After the {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} method is called, * the target version is reached. * * @author Johannes Rabauer From e6196c15525981cc9c5acca8abc323c4fa9c7f25 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 14 Feb 2021 19:49:26 +0100 Subject: [PATCH 026/306] Extended pom for utf-8 --- pom.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pom.xml b/pom.xml index c850bd9..67f34b2 100644 --- a/pom.xml +++ b/pom.xml @@ -18,11 +18,13 @@ 1.8 1.8 + UTF-8 org.apache.maven.plugins maven-source-plugin + 3.2.1 attach-sources @@ -35,6 +37,11 @@ org.apache.maven.plugins maven-javadoc-plugin + 3.2.0 + + 8 + UTF-8 + attach-javadocs @@ -44,6 +51,13 @@ + + maven-resources-plugin + 2.6 + + UTF-8 + + From b14e9fe60d586b49eca396bda8649f1ca6f2313a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 14 Feb 2021 19:52:18 +0100 Subject: [PATCH 027/306] Further adjusted gitignore --- .gitignore | 2 +- .project | 23 ----------------------- .settings/org.eclipse.jdt.core.prefs | 16 ---------------- .settings/org.eclipse.m2e.core.prefs | 4 ---- 4 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 .project delete mode 100644 .settings/org.eclipse.jdt.core.prefs delete mode 100644 .settings/org.eclipse.m2e.core.prefs diff --git a/.gitignore b/.gitignore index 435d4b6..fba3840 100644 --- a/.gitignore +++ b/.gitignore @@ -62,7 +62,7 @@ local.properties # Uncomment this line if you wish to ignore the project description file. # Typically, this file would be tracked if it contains build/dependency configurations: -#.project +.project ### Eclipse Patch ### # Spring Boot Tooling diff --git a/.project b/.project deleted file mode 100644 index 28a7634..0000000 --- a/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - micro-migration - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 8b5c4dc..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,16 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 From 22af2d0b6469871564f5b00d2bd28927b20a09f7 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Sun, 14 Feb 2021 20:29:30 +0100 Subject: [PATCH 028/306] Added gitignore for MicroStream default datastore directory --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index fba3840..b3314e0 100644 --- a/.gitignore +++ b/.gitignore @@ -133,3 +133,6 @@ $RECYCLE.BIN/ *.lnk # End of https://www.toptal.com/developers/gitignore/api/maven,java,eclipse,windows + +#MicroStream Datastore default directory +/storage/ \ No newline at end of file From 20b00c9fbdc9e119bb35c99127747eb6f9ca6199 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 15 Feb 2021 07:04:44 +0100 Subject: [PATCH 029/306] Updated Java Version to 9 --- .classpath | 2 +- pom.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.classpath b/.classpath index 6bc00bc..473188a 100644 --- a/.classpath +++ b/.classpath @@ -24,7 +24,7 @@ - + diff --git a/pom.xml b/pom.xml index 67f34b2..d556c67 100644 --- a/pom.xml +++ b/pom.xml @@ -16,8 +16,8 @@ maven-compiler-plugin 3.8.0 - 1.8 - 1.8 + 9 + 9 UTF-8 @@ -39,7 +39,7 @@ maven-javadoc-plugin 3.2.0 - 8 + 9 UTF-8 From 4698bd195f4959f50f970308da405ceffafc72a4 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 15 Feb 2021 18:39:45 +0100 Subject: [PATCH 030/306] Fixed tests for maven test --- pom.xml | 17 +++++++++++++++++ ...roduceMigrationOnExistingDatastoreTest.java} | 6 +++--- ...java => MigrationScriptAfterScriptTest.java} | 10 ++++++---- ...toreStuffInMigrationStorageManagerTest.java} | 12 ++++++------ .../migrater/ExplicitMigraterTest.java | 3 ++- .../ReflectiveVersionMigrationScriptTest.java | 2 +- 6 files changed, 35 insertions(+), 15 deletions(-) rename src/test/java/de/johannes_rabauer/micromigration/integration/{IntroduceMigrationOnExistingDatastore.java => IntroduceMigrationOnExistingDatastoreTest.java} (84%) rename src/test/java/de/johannes_rabauer/micromigration/integration/{MigrationScriptAfterScript.java => MigrationScriptAfterScriptTest.java} (91%) rename src/test/java/de/johannes_rabauer/micromigration/integration/{StoreStuffInMigrationStorageManager.java => StoreStuffInMigrationStorageManagerTest.java} (85%) diff --git a/pom.xml b/pom.xml index d556c67..7abd029 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ 9 UTF-8 + false @@ -58,6 +59,10 @@ UTF-8 + + maven-surefire-plugin + 2.22.2 + @@ -78,5 +83,17 @@ storage.embedded.configuration 04.00.00-MS-GA + + org.junit.jupiter + junit-jupiter-api + 5.6.2 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.6.2 + test + \ No newline at end of file diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java similarity index 84% rename from src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java rename to src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 95d7b5d..e3160b3 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastore.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,6 +1,6 @@ package de.johannes_rabauer.micromigration.integration; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.nio.file.Path; @@ -16,12 +16,12 @@ import one.microstream.storage.types.EmbeddedStorage; import one.microstream.storage.types.EmbeddedStorageManager; -class IntroduceMigrationOnExistingDatastore +class IntroduceMigrationOnExistingDatastoreTest { final static String ROOT = "OriginalRoot"; @Test - public void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException { try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) { diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java similarity index 91% rename from src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java rename to src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java index f1a52ef..e232f1a 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScript.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,6 +1,6 @@ package de.johannes_rabauer.micromigration.integration; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.nio.file.Path; @@ -20,10 +20,10 @@ import one.microstream.storage.configuration.Configuration; import one.microstream.storage.types.EmbeddedStorageManager; -class MigrationScriptAfterScript +class MigrationScriptAfterScriptTest { @Test - public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException { //First run without any migration script final ExplicitMigrater firstMigrater = new ExplicitMigrater(); @@ -63,7 +63,7 @@ public void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManag } @Test - public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException { //First run without any migration script try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) @@ -89,6 +89,7 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag storageManager ) .migrate(storageManager.root()); + @SuppressWarnings("unchecked") VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(1), currentRoot.getObject()); assertEquals(new MigrationVersion(1), currentRoot.getVersion()); @@ -108,6 +109,7 @@ public void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManag storageManager ) .migrate(storageManager.root()); + @SuppressWarnings("unchecked") VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(2), currentRoot.getObject()); assertEquals(new MigrationVersion(2), currentRoot.getVersion()); diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java similarity index 85% rename from src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java rename to src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 8f6e1cb..2f8b6ac 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManager.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,7 +1,7 @@ package de.johannes_rabauer.micromigration.integration; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.io.IOException; import java.nio.file.Path; @@ -16,7 +16,7 @@ import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; -public class StoreStuffInMigrationStorageManager +class StoreStuffInMigrationStorageManagerTest { private static class RootClass { @@ -29,11 +29,11 @@ private static class ChildClass } @Test - public void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException + void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { final MigrationScript script = new SimpleTypedMigrationScript<>( - new MigrationVersion(1), - (context) -> {} + new MigrationVersion(1), + (context) -> {} ); final ExplicitMigrater migrater = new ExplicitMigrater(script); //Create new store and change stored object diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java index 13e80c9..3bbad92 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java @@ -1,5 +1,6 @@ package de.johannes_rabauer.micromigration.migrater; + import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Path; @@ -46,7 +47,7 @@ void testGetSortedScripts_unsorted() assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); } - @Test + @Test void testWrongTypedVersionedScript(@TempDir Path storageFolder) { try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(storageFolder, new ExplicitMigrater())) diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index 51e40d2..b4cf253 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -1,6 +1,6 @@ package de.johannes_rabauer.micromigration.scripts; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; From 0be8b3f3b785ddb30dab63c11b2d6532dc080aa0 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 17 Feb 2021 06:30:34 +0100 Subject: [PATCH 031/306] ScriptExecutionNotification implemented --- .../migrater/AbstractMigrater.java | 32 ++++++++++ .../ScriptExecutionNotification.java | 63 +++++++++++++++++++ .../MigrationScriptAfterScriptTest.java | 26 ++++++++ 3 files changed, 121 insertions(+) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java index 2049eba..8e8b90a 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java @@ -1,8 +1,11 @@ package de.johannes_rabauer.micromigration.migrater; +import java.time.LocalDate; import java.util.Objects; import java.util.TreeSet; +import java.util.function.Consumer; +import de.johannes_rabauer.micromigration.notification.ScriptExecutionNotification; import de.johannes_rabauer.micromigration.scripts.Context; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; @@ -10,6 +13,17 @@ public abstract class AbstractMigrater implements MicroMigrater { + private Consumer notificationConsumer = null; + + /** + * Registers a callback to take action when a script is executed. + * @param notificationConsumer is executed when a script is used from this migrater. + */ + public void setNotificationConsumer(Consumer notificationConsumer) + { + this.notificationConsumer = notificationConsumer; + } + @Override public MigrationVersion migrateToNewest( MigrationVersion fromVersion , @@ -53,7 +67,25 @@ public MigrationVersion migrateToNewest( { if(MigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) { + LocalDate startDate = null; + MigrationVersion versionBeforeUpdate = updateVersionWhichWasExecuted; + if(this.notificationConsumer != null) + { + startDate = LocalDate.now(); + } updateVersionWhichWasExecuted = migrateWithScript(script, storageManager, objectToMigrate); + if(this.notificationConsumer != null) + { + this.notificationConsumer.accept( + new ScriptExecutionNotification( + script , + versionBeforeUpdate , + updateVersionWhichWasExecuted, + startDate , + LocalDate.now() + ) + ); + } } } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java b/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java new file mode 100644 index 0000000..9d7d37c --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java @@ -0,0 +1,63 @@ +package de.johannes_rabauer.micromigration.notification; + +import java.time.LocalDate; + +import de.johannes_rabauer.micromigration.migrater.MicroMigrater; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; + +/** + * Contains data about the execution of a script by a {@link MicroMigrater}. + * + * @author Johannes Rabauer + * + */ +public class ScriptExecutionNotification +{ + private MigrationScript executedScript; + private MigrationVersion sourceVersion ; + private MigrationVersion targetVersion ; + private LocalDate startDate ; + private LocalDate endDate ; + + public ScriptExecutionNotification( + MigrationScript executedScript, + MigrationVersion sourceVersion , + MigrationVersion targetVersion , + LocalDate startDate , + LocalDate endDate + ) + { + super(); + this.executedScript = executedScript; + this.sourceVersion = sourceVersion ; + this.targetVersion = targetVersion ; + this.startDate = startDate ; + this.endDate = endDate ; + } + + public MigrationScript getExecutedScript() + { + return executedScript; + } + + public MigrationVersion getSourceVersion() + { + return sourceVersion; + } + + public MigrationVersion getTargetVersion() + { + return targetVersion; + } + + public LocalDate getStartDate() + { + return startDate; + } + + public LocalDate getEndDate() + { + return endDate; + } +} diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java index e232f1a..20b0830 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,9 +1,11 @@ package de.johannes_rabauer.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -62,6 +64,30 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem } } + @Test + void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + final AtomicBoolean notificationReceived = new AtomicBoolean(false); + migrater.setNotificationConsumer( + notification -> + { + assertEquals(firstScript, notification.getExecutedScript()); + assertEquals(new MigrationVersion(0), notification.getSourceVersion()); + assertEquals(new MigrationVersion(1), notification.getTargetVersion()); + notificationReceived.set(true); + } + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertTrue(notificationReceived.get()); + } + } + @Test void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException { From 1f9be69b347d1bcb746e4f0c03fa0664dc80ca8c Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 17 Feb 2021 09:43:26 +0100 Subject: [PATCH 032/306] LocalDateTime for ScriptExecutionNotification implemented --- .../micromigration/migrater/AbstractMigrater.java | 8 ++++---- .../notification/ScriptExecutionNotification.java | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java index 8e8b90a..62aecdc 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java @@ -1,6 +1,6 @@ package de.johannes_rabauer.micromigration.migrater; -import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.Objects; import java.util.TreeSet; import java.util.function.Consumer; @@ -67,11 +67,11 @@ public MigrationVersion migrateToNewest( { if(MigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) { - LocalDate startDate = null; + LocalDateTime startDate = null; MigrationVersion versionBeforeUpdate = updateVersionWhichWasExecuted; if(this.notificationConsumer != null) { - startDate = LocalDate.now(); + startDate = LocalDateTime.now(); } updateVersionWhichWasExecuted = migrateWithScript(script, storageManager, objectToMigrate); if(this.notificationConsumer != null) @@ -82,7 +82,7 @@ public MigrationVersion migrateToNewest( versionBeforeUpdate , updateVersionWhichWasExecuted, startDate , - LocalDate.now() + LocalDateTime.now() ) ); } diff --git a/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java b/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java index 9d7d37c..af4947e 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java +++ b/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java @@ -1,6 +1,6 @@ package de.johannes_rabauer.micromigration.notification; -import java.time.LocalDate; +import java.time.LocalDateTime; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import de.johannes_rabauer.micromigration.scripts.MigrationScript; @@ -17,15 +17,15 @@ public class ScriptExecutionNotification private MigrationScript executedScript; private MigrationVersion sourceVersion ; private MigrationVersion targetVersion ; - private LocalDate startDate ; - private LocalDate endDate ; + private LocalDateTime startDate ; + private LocalDateTime endDate ; public ScriptExecutionNotification( MigrationScript executedScript, MigrationVersion sourceVersion , MigrationVersion targetVersion , - LocalDate startDate , - LocalDate endDate + LocalDateTime startDate , + LocalDateTime endDate ) { super(); @@ -51,12 +51,12 @@ public MigrationVersion getTargetVersion() return targetVersion; } - public LocalDate getStartDate() + public LocalDateTime getStartDate() { return startDate; } - public LocalDate getEndDate() + public LocalDateTime getEndDate() { return endDate; } From 791575adacf29fb27727698727676477417346a1 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 10 Mar 2021 22:33:22 +0100 Subject: [PATCH 033/306] Added better JavaDoc for ReflectiveVersionMigrationScript --- .../scripts/ReflectiveVersionMigrationScript.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java index 7a729c3..fcb657f 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -11,13 +11,16 @@ * * vM_Classname
* vM_m_Classname
- * vM_m_p_Classname
+ * vM_m_m_Classname
*
* Where v is short for version and is a constant (just a char),
* M is a integer for the major version,
- * m is a integer for the minor version,
- * p is a integer for the patch version and
- * Classname is a custom String that the user can choose. + * m is a integer for the minor version
+ * Classname is a custom String that the user can choose.
+ * This scheme can basically be extended infinetly. For example: v1_1_2_2_MyUpdateScript + *

+ * Therefore the character _ can only be used as a seperator of versions + * and may not be used for other purposes. *

* If the class name has the wrong format, an {@link Error} is thrown. * From 4c336bae3d2ee8b301019dba4dac5d6ad7ce671b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 10 Mar 2021 22:33:50 +0100 Subject: [PATCH 034/306] New Tests and Checks for same versions registered in one migrater --- .../migrater/ExplicitMigrater.java | 19 ++++- .../VersionAlreadyRegisteredException.java | 42 +++++++++++ .../integration/MultipleScriptsTest.java | 75 +++++++++++++++++++ 3 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java create mode 100644 src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 56562b3..6afe707 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -3,6 +3,7 @@ import java.util.TreeSet; import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; /** * Contains all the available scripts to migrate the datastore to a certain version. @@ -17,12 +18,26 @@ public class ExplicitMigrater extends AbstractMigrater private final TreeSet> sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); /** - * @param scripts are all the scripts that are executed, if the current version is lower than this of the script + * @param scripts are all the scripts that are executed, if the current version is lower than this of the script
+ * Versions of the scripts must be unique. That means that no version is allowed multiple times in the migrater. + * @throws VersionAlreadyRegisteredException */ - public ExplicitMigrater(MigrationScript ...scripts) + public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRegisteredException { for (MigrationScript script : scripts) { + for (MigrationScript alreadyRegisteredScript : this.sortedScripts) + { + if(MigrationVersion.COMPARATOR.compare(alreadyRegisteredScript.getTargetVersion(), script.getTargetVersion()) == 0) + { + //Two scripts with the same version are not allowed to get registered. + throw new VersionAlreadyRegisteredException( + alreadyRegisteredScript.getTargetVersion(), + alreadyRegisteredScript, + script + ); + } + } this.sortedScripts.add(script); } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java new file mode 100644 index 0000000..925ccef --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -0,0 +1,42 @@ +package de.johannes_rabauer.micromigration.migrater; + +import java.util.Objects; + +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; + +public class VersionAlreadyRegisteredException extends Error +{ + private static final long serialVersionUID = 2153008832167067975L; + + private MigrationVersion alreadyRegisteredVersion; + private MigrationScript alreadyRegisteredScript ; + private MigrationScript newScriptToRegister ; + + public VersionAlreadyRegisteredException( + MigrationVersion alreadyRegisteredVersion, + MigrationScript alreadyRegisteredScript , + MigrationScript newScriptToRegister + ) + { + super("Version " + alreadyRegisteredVersion.toString() + " is already registered. Versions must be unique within the migrater."); + this.alreadyRegisteredVersion = Objects.requireNonNull(alreadyRegisteredVersion); + this.alreadyRegisteredScript = Objects.requireNonNull(alreadyRegisteredScript) ; + this.newScriptToRegister = Objects.requireNonNull(newScriptToRegister) ; + } + + public MigrationVersion getAlreadyRegisteredVersion() + { + return alreadyRegisteredVersion; + } + + public MigrationScript getAlreadyRegisteredScript() + { + return alreadyRegisteredScript; + } + + public MigrationScript getNewScriptToRegister() + { + return newScriptToRegister; + } +} diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java new file mode 100644 index 0000000..b9dbd7a --- /dev/null +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java @@ -0,0 +1,75 @@ +package de.johannes_rabauer.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; +import de.johannes_rabauer.micromigration.migrater.VersionAlreadyRegisteredException; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; + +class MultipleScriptsTest +{ + @Test + void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(2, migrationStorageManager.root()); + assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(2) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript) + ); + } + + @Test + void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(3) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript, thirdScript) + ); + } +} From 5496c8e9cbf8451ca8e1e611703179b5067128cf Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Thu, 30 Sep 2021 12:54:17 +0200 Subject: [PATCH 035/306] Checking of duplicated entries of scripts for same version put in a method --- .../migrater/AbstractMigrater.java | 23 +++++++++++++++++++ .../migrater/ExplicitMigrater.java | 14 +---------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java index 62aecdc..2d222ac 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java @@ -103,5 +103,28 @@ private MigrationVersion migrateWithScript( script.migrate(new Context<>(castedObjectToMigrate, storageManager)); return script.getTargetVersion(); } + + /** + * Checks if the given {@link MigrationScript} is not already registered in the + * {@link #getSortedScripts()}. + * @throws {@link VersionAlreadyRegisteredException} if script is already registered. + * @param scriptToCheck. It's target version is checked, if it is not already registered. + */ + protected void checkIfVersionIsAlreadyRegistered(MigrationScript scriptToCheck) + { + //Check if same version is not already registered + for (MigrationScript alreadyRegisteredScript : this.getSortedScripts()) + { + if(MigrationVersion.COMPARATOR.compare(alreadyRegisteredScript.getTargetVersion(), scriptToCheck.getTargetVersion()) == 0) + { + //Two scripts with the same version are not allowed to get registered. + throw new VersionAlreadyRegisteredException( + alreadyRegisteredScript.getTargetVersion(), + alreadyRegisteredScript, + scriptToCheck + ); + } + } + } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 6afe707..3852113 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -3,7 +3,6 @@ import java.util.TreeSet; import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; /** * Contains all the available scripts to migrate the datastore to a certain version. @@ -26,18 +25,7 @@ public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRegi { for (MigrationScript script : scripts) { - for (MigrationScript alreadyRegisteredScript : this.sortedScripts) - { - if(MigrationVersion.COMPARATOR.compare(alreadyRegisteredScript.getTargetVersion(), script.getTargetVersion()) == 0) - { - //Two scripts with the same version are not allowed to get registered. - throw new VersionAlreadyRegisteredException( - alreadyRegisteredScript.getTargetVersion(), - alreadyRegisteredScript, - script - ); - } - } + checkIfVersionIsAlreadyRegistered(script); this.sortedScripts.add(script); } } From b84cb2b56c996c27d5b0bbadb3da3d9fae64afd7 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Thu, 30 Sep 2021 15:46:49 +0200 Subject: [PATCH 036/306] Updated to Version 5.0.2 of MicroStream. Updated own version to 0.0.2 --- pom.xml | 20 ++++---- .../MigrationEmbeddedStorage.java | 49 ++++++++++++++----- .../MigrationEmbeddedStorageManager.java | 11 ++++- .../micromigration/MigrationManager.java | 2 +- .../migrater/AbstractMigrater.java | 2 +- .../migrater/MicroMigrater.java | 2 +- .../micromigration/scripts/Context.java | 2 +- ...oduceMigrationOnExistingDatastoreTest.java | 4 +- .../MigrationScriptAfterScriptTest.java | 10 ++-- 9 files changed, 64 insertions(+), 38 deletions(-) diff --git a/pom.xml b/pom.xml index 7abd029..9504f9f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 de.johannes_rabauer micro-migration - 0.0.1-SNAPSHOT + 0.0.2 MicroMigration Migration Lib for MicroStream @@ -42,6 +42,10 @@ 9 UTF-8 false + + -Xdoclint:none + -Xdoclint:none + -Xdoclint:none @@ -66,22 +70,16 @@ - - - microstream-releases - https://repo.microstream.one/repository/maven-public/ - - one.microstream - storage.embedded - 04.00.00-MS-GA + microstream-storage-embedded + 05.00.02-MS-GA one.microstream - storage.embedded.configuration - 04.00.00-MS-GA + microstream-configuration + 05.00.02-MS-GA org.junit.jupiter diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java index 29242c2..f916542 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -4,9 +4,13 @@ import java.util.Objects; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import one.microstream.storage.configuration.Configuration; -import one.microstream.storage.types.EmbeddedStorage; -import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.afs.nio.types.NioFileSystem; +import one.microstream.configuration.types.Configuration; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.types.Storage; +import one.microstream.storage.types.StorageConfiguration; /** * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for @@ -19,7 +23,7 @@ public class MigrationEmbeddedStorage { /** * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. - * Uses the MicroStream {@link Configuration#Default()} configuration for the actual + * Uses the MicroStream {@link EmbeddedStorageFoundation.New()} configuration for the actual * {@link EmbeddedStorageManager}. *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. * @@ -31,16 +35,14 @@ public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater { Objects.requireNonNull(migrater); return new MigrationEmbeddedStorageManager( - Configuration.Default() - .createEmbeddedStorageFoundation() - .createEmbeddedStorageManager(), + createStorageManager(), migrater ).start(); } /** * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. - * Uses the MicroStream {@link Configuration#Default()} configuration for the actual + * Uses the MicroStream {@link EmbeddedStorageFoundation.New()} configuration for the actual * {@link EmbeddedStorageManager}. *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. * @@ -56,12 +58,35 @@ public static final MigrationEmbeddedStorageManager start( { Objects.requireNonNull(migrater); Objects.requireNonNull(storageDirectory); + return new MigrationEmbeddedStorageManager( - Configuration.Default() - .setBaseDirectory(storageDirectory.toAbsolutePath().toString()) - .createEmbeddedStorageFoundation() - .createEmbeddedStorageManager(), + createStorageManager(storageDirectory), migrater ).start(); } + + private static EmbeddedStorageManager createStorageManager(Path storageDirectory) + { + NioFileSystem fileSystem = NioFileSystem.New(); + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder() + .setStorageFileProvider( + Storage.FileProviderBuilder(fileSystem) + .setDirectory(fileSystem.ensureDirectoryPath(storageDirectory.toAbsolutePath().toString())) + .createFileProvider() + ) + .createConfiguration() + ) + .createEmbeddedStorageManager(); + } + + private static EmbeddedStorageManager createStorageManager() + { + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder().createConfiguration() + ) + .createEmbeddedStorageManager(); + } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index 67fe408..0eff016 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -7,15 +7,16 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; import de.johannes_rabauer.micromigration.version.VersionedRoot; -import one.microstream.afs.AFile; +import one.microstream.afs.types.AFile; import one.microstream.collections.types.XGettingEnum; import one.microstream.persistence.binary.types.Binary; import one.microstream.persistence.types.PersistenceManager; import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; import one.microstream.reference.Reference; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import one.microstream.storage.exceptions.StorageException; import one.microstream.storage.types.Database; -import one.microstream.storage.types.EmbeddedStorageManager; import one.microstream.storage.types.StorageConfiguration; import one.microstream.storage.types.StorageConnection; import one.microstream.storage.types.StorageEntityCacheEvaluator; @@ -265,4 +266,10 @@ public PersistenceManager persistenceManager() { return this.nativeManager.persistenceManager(); } + + @Override + public void issueFullBackup(StorageLiveFileProvider targetFileProvider, + PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); + } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java index ec03263..978eed7 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java @@ -8,7 +8,7 @@ import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; -import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** * Manages a given object and keeps the version for it. diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java index 2d222ac..ed97978 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java @@ -9,7 +9,7 @@ import de.johannes_rabauer.micromigration.scripts.Context; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; public abstract class AbstractMigrater implements MicroMigrater { diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index bf8ad98..8414340 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -4,7 +4,7 @@ import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** * Executes all the available scripts to migrate the datastore to a certain version. diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java index 8519d8e..6bfb613 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java @@ -1,6 +1,6 @@ package de.johannes_rabauer.micromigration.scripts; -import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** * Container that holds necessary information for the execution of an {@link MigrationScript} diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index e3160b3..90cf2fd 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -13,8 +13,8 @@ import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.types.EmbeddedStorage; -import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; class IntroduceMigrationOnExistingDatastoreTest { diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java index 20b0830..de5c2c2 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -19,8 +19,8 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; import de.johannes_rabauer.micromigration.version.VersionedObject; -import one.microstream.storage.configuration.Configuration; -import one.microstream.storage.types.EmbeddedStorageManager; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; class MigrationScriptAfterScriptTest { @@ -144,11 +144,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(Path storageFolder) { - return Configuration.Default() - .setBaseDirectory(storageFolder.toAbsolutePath().toString()) - .createEmbeddedStorageFoundation() - .createEmbeddedStorageManager() - .start(); + return EmbeddedStorage.start(storageFolder); } } From 86adaeb5f4d3166c8b72bc96a5219e82957856d3 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:12:57 +0200 Subject: [PATCH 037/306] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 109 ++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..91c0a0f --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,109 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '25 6 * * 6' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + +# - name: Perform CodeQL Analysis +# uses: github/codeql-action/analyze@v2 +# with: +# category: "/language:${{matrix.language}}" + + + - name: Setup Java JDK + uses: actions/setup-java@v3.5.0 + with: + # The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file + java-version: + # Java distribution. See the list of supported distributions in README file + distribution: + # The package type (jdk, jre, jdk+fx, jre+fx) + java-package: # optional, default is jdk + # The architecture of the package + architecture: # optional, default is x64 + # Path to where the compressed JDK is located + jdkFile: # optional + # Set this option if you want the action to check for the latest available version that satisfies the version spec + check-latest: # optional + # ID of the distributionManagement repository in the pom.xml file. Default is `github` + server-id: # optional, default is github + # Environment variable name for the username for authentication to the Apache Maven repository. Default is $GITHUB_ACTOR + server-username: # optional, default is GITHUB_ACTOR + # Environment variable name for password or token for authentication to the Apache Maven repository. Default is $GITHUB_TOKEN + server-password: # optional, default is GITHUB_TOKEN + # Path to where the settings.xml file will be written. Default is ~/.m2. + settings-path: # optional + # Overwrite the settings.xml file if it exists. Default is "true". + overwrite-settings: # optional, default is true + # GPG private key to import. Default is empty string. + gpg-private-key: # optional + # Environment variable name for the GPG private key passphrase. Default is $GPG_PASSPHRASE. + gpg-passphrase: # optional + # Name of the build platform to cache dependencies. It can be "maven", "gradle" or "sbt". + cache: # optional + # Workaround to pass job status to post job step. This variable is not intended for manual setting + job-status: # optional, default is ${{ job.status }} From e05275d20ae635a9d89dc188dfcd0fdd906e450b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:20:13 +0200 Subject: [PATCH 038/306] Update codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 42 +++------------------------ 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 91c0a0f..22becb1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -68,42 +68,8 @@ jobs: # echo "Run, Build Application using script" # ./location_of_script_within_repo/buildscript.sh -# - name: Perform CodeQL Analysis -# uses: github/codeql-action/analyze@v2 -# with: -# category: "/language:${{matrix.language}}" - + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" - - name: Setup Java JDK - uses: actions/setup-java@v3.5.0 - with: - # The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file - java-version: - # Java distribution. See the list of supported distributions in README file - distribution: - # The package type (jdk, jre, jdk+fx, jre+fx) - java-package: # optional, default is jdk - # The architecture of the package - architecture: # optional, default is x64 - # Path to where the compressed JDK is located - jdkFile: # optional - # Set this option if you want the action to check for the latest available version that satisfies the version spec - check-latest: # optional - # ID of the distributionManagement repository in the pom.xml file. Default is `github` - server-id: # optional, default is github - # Environment variable name for the username for authentication to the Apache Maven repository. Default is $GITHUB_ACTOR - server-username: # optional, default is GITHUB_ACTOR - # Environment variable name for password or token for authentication to the Apache Maven repository. Default is $GITHUB_TOKEN - server-password: # optional, default is GITHUB_TOKEN - # Path to where the settings.xml file will be written. Default is ~/.m2. - settings-path: # optional - # Overwrite the settings.xml file if it exists. Default is "true". - overwrite-settings: # optional, default is true - # GPG private key to import. Default is empty string. - gpg-private-key: # optional - # Environment variable name for the GPG private key passphrase. Default is $GPG_PASSPHRASE. - gpg-passphrase: # optional - # Name of the build platform to cache dependencies. It can be "maven", "gradle" or "sbt". - cache: # optional - # Workaround to pass job status to post job step. This variable is not intended for manual setting - job-status: # optional, default is ${{ job.status }} From 47193465d371a54f166cb40189fa5eaa14a65aa5 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:33:27 +0200 Subject: [PATCH 039/306] Create dependency-review.yml --- .github/workflows/dependency-review.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/dependency-review.yml diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 0000000..fe461b4 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,20 @@ +# Dependency Review Action +# +# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. +# +# Source repository: https://github.com/actions/dependency-review-action +# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement +name: 'Dependency Review' +on: [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: 'Checkout Repository' + uses: actions/checkout@v3 + - name: 'Dependency Review' + uses: actions/dependency-review-action@v2 From 1017d7ae1d60d7c5efb9f83e46c4f7e48fea4e43 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:33:44 +0200 Subject: [PATCH 040/306] Create codeql.yml --- .github/workflows/codeql.yml | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..781807e --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,74 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '26 21 * * 4' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From d80b481ba33feba7ae0498a65b45233414b84145 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 1 Dec 2022 10:07:13 +0100 Subject: [PATCH 041/306] Updated Classes with CodeFormatter --- .../MigrationEmbeddedStorage.java | 1 + .../MigrationEmbeddedStorageManager.java | 5 +++-- .../micromigration/MigrationManager.java | 3 ++- .../migrater/AbstractMigrater.java | 1 + .../migrater/MicroMigrater.java | 9 ++++---- .../VersionAlreadyRegisteredException.java | 5 +++-- .../scripts/MigrationScript.java | 3 ++- .../ReflectiveVersionMigrationScript.java | 1 + .../scripts/SimpleMigrationScript.java | 3 ++- .../scripts/SimpleTypedMigrationScript.java | 3 ++- ...oduceMigrationOnExistingDatastoreTest.java | 12 ++++++----- .../MigrationScriptAfterScriptTest.java | 21 ++++++++++--------- .../integration/MultipleScriptsTest.java | 16 +++++++------- ...oreStuffInMigrationStorageManagerTest.java | 10 ++++----- .../migrater/ExplicitMigraterTest.java | 5 +++-- 15 files changed, 56 insertions(+), 42 deletions(-) diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java index f916542..35cb654 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java @@ -12,6 +12,7 @@ import one.microstream.storage.types.Storage; import one.microstream.storage.types.StorageConfiguration; + /** * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java index 0eff016..710e211 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java @@ -27,6 +27,7 @@ import one.microstream.storage.types.StorageRawFileStatistics; import one.microstream.storage.types.StorageTypeDictionary; + /** * Wrapper class for the MicroStream {@link EmbeddedStorageManager} interface. *

@@ -40,8 +41,8 @@ public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager { private final EmbeddedStorageManager nativeManager; - private final MicroMigrater migrater ; - private VersionedRoot versionRoot ; + private final MicroMigrater migrater ; + private VersionedRoot versionRoot ; /** * @param nativeManager which will be used as the underlying storage manager. diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java index 978eed7..b9cec63 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java @@ -10,6 +10,7 @@ import de.johannes_rabauer.micromigration.version.Versioned; import one.microstream.storage.embedded.types.EmbeddedStorageManager; + /** * Manages a given object and keeps the version for it. *

@@ -25,7 +26,7 @@ public class MigrationManager private final Supplier currentVersionGetter; private final Consumer currentVersionSetter; private final Consumer currentVersionStorer; - private final MicroMigrater migrater ; + private final MicroMigrater migrater ; private final EmbeddedStorageManager storageManager ; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java index ed97978..abcec78 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java @@ -11,6 +11,7 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; + public abstract class AbstractMigrater implements MicroMigrater { private Consumer notificationConsumer = null; diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 8414340..8fc1f98 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -2,6 +2,7 @@ import java.util.TreeSet; +import de.johannes_rabauer.micromigration.scripts.Context; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -32,10 +33,10 @@ public interface MicroMigrater * @param fromVersion is the current version of the datastore. * Scripts for lower versions then the fromVersion are not executed. * - * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} + * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(Context)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param root is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} + * @param root is relayed to the scripts {@link MigrationScript#migrate(Context)} * method. This way the script can change something within the root object. * * @return the target version of the last executed script @@ -62,10 +63,10 @@ public MigrationVersion migrateToNewest( * @param targetVersion is the highest allowed script version. * Scripts which have a higher version won't be exectued. * - * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} + * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(Context)} * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param objectToMigrate is relayed to the scripts {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} + * @param objectToMigrate is relayed to the scripts {@link MigrationScript#migrate(Context)} * method. This way the script can change something within the object to migrate. * * @return the target version of the last executed script diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java index 925ccef..6b2ec11 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -2,14 +2,15 @@ import java.util.Objects; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; + public class VersionAlreadyRegisteredException extends Error { private static final long serialVersionUID = 2153008832167067975L; - private MigrationVersion alreadyRegisteredVersion; + private MigrationVersion alreadyRegisteredVersion; private MigrationScript alreadyRegisteredScript ; private MigrationScript newScriptToRegister ; diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java index 385e114..32dfa89 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java @@ -4,11 +4,12 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; + /** * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScript#migrate(de.johannes_rabauer.micromigration.scripts.Context)} method is called, + * After the {@link MigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java index fcb657f..03ab7a2 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -4,6 +4,7 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; + /** * Script which creates the target version of the script through the class name. *

diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java index 2629e91..1225039 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -4,6 +4,7 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; + /** * Provides a simple way to create a migration script with the necessary version * and {@link Consumer}. @@ -14,7 +15,7 @@ public class SimpleMigrationScript extends SimpleTypedMigrationScript { public SimpleMigrationScript( - final MigrationVersion version , + final MigrationVersion version , final Consumer> consumer ) { diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java index 733b764..649dc78 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java @@ -5,6 +5,7 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; + /** * Provides a simple way to create a migration script with the necessary version * and {@link Consumer}. @@ -14,7 +15,7 @@ */ public class SimpleTypedMigrationScript implements MigrationScript { - private final MigrationVersion version ; + private final MigrationVersion version ; private final Consumer> consumer; /** diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 90cf2fd..0318274 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -5,18 +5,20 @@ import java.io.IOException; import java.nio.file.Path; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; import de.johannes_rabauer.micromigration.version.MigrationVersion; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -class IntroduceMigrationOnExistingDatastoreTest + +class IntroduceMigrationOnExistingDatastoreTest { final static String ROOT = "OriginalRoot"; @@ -35,7 +37,7 @@ void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { assertEquals(ROOT, migrationStorageManager.root()); - assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); + Assertions.assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); } } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java index de5c2c2..0e786dd 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -7,9 +7,6 @@ import java.nio.file.Path; import java.util.concurrent.atomic.AtomicBoolean; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.MigrationManager; @@ -19,6 +16,10 @@ import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; import de.johannes_rabauer.micromigration.version.VersionedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -34,7 +35,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem migrationStorageManager.setRoot(0); migrationStorageManager.storeRoot(); assertEquals(0, migrationStorageManager.root()); - assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); + Assertions.assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); } @@ -47,7 +48,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) { assertEquals(1, migrationStorageManager.root()); - assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); + Assertions.assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); } @@ -60,7 +61,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) { assertEquals(2, migrationStorageManager.root()); - assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); } } @@ -76,9 +77,9 @@ void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) t migrater.setNotificationConsumer( notification -> { - assertEquals(firstScript, notification.getExecutedScript()); - assertEquals(new MigrationVersion(0), notification.getSourceVersion()); - assertEquals(new MigrationVersion(1), notification.getTargetVersion()); + Assertions.assertEquals(firstScript, notification.getExecutedScript()); + Assertions.assertEquals(new MigrationVersion(0), notification.getSourceVersion()); + Assertions.assertEquals(new MigrationVersion(1), notification.getTargetVersion()); notificationReceived.set(true); } ); @@ -110,7 +111,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { new MigrationManager( - (Versioned) storageManager.root(), + (Versioned) storageManager.root(), new ExplicitMigrater(firstScript), storageManager ) diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java index b9dbd7a..1675b7e 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java @@ -4,10 +4,6 @@ import java.nio.file.Path; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; @@ -15,14 +11,18 @@ import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + -class MultipleScriptsTest +class MultipleScriptsTest { @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { final MigrationScript firstScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(1), + new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); final MigrationScript secondScript = new SimpleTypedMigrationScript<>( @@ -33,7 +33,7 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { assertEquals(2, migrationStorageManager.root()); - assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); } } @@ -48,7 +48,7 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); - Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> new ExplicitMigrater(firstScript, secondScript) ); } diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 2f8b6ac..e98bca2 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -6,17 +6,17 @@ import java.io.IOException; import java.nio.file.Path; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + -class StoreStuffInMigrationStorageManagerTest +class StoreStuffInMigrationStorageManagerTest { private static class RootClass { @@ -32,7 +32,7 @@ private static class ChildClass void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { final MigrationScript script = new SimpleTypedMigrationScript<>( - new MigrationVersion(1), + new MigrationVersion(1), (context) -> {} ); final ExplicitMigrater migrater = new ExplicitMigrater(script); diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java index 3bbad92..b137291 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java @@ -5,6 +5,7 @@ import java.nio.file.Path; +import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -12,10 +13,10 @@ import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; -import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; import de.johannes_rabauer.micromigration.version.MigrationVersion; -class ExplicitMigraterTest + +class ExplicitMigraterTest { @Test From c5bdafbbc65d6240af18517f77cc47d5b6e6cea8 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 1 Dec 2022 13:43:28 +0100 Subject: [PATCH 042/306] Tried to seperate the MicroStream-Dependency --- .../micromigration/MigrationManager.java | 93 +---------- .../v5}/MigrationEmbeddedStorage.java | 8 +- .../v5/MigrationEmbeddedStorageManager.java | 100 +++++++++++ .../microstream/v5/MigrationManagerV5.java | 109 ++++++++++++ .../microstream/v5/MigrationScriptV5.java | 22 +++ .../v5/TunnelingEmbeddedStorageManager.java} | 155 ++++++++---------- ...VersionAgnosticEmbeddedStorageManager.java | 6 + .../migrater/AbstractMigrater.java | 31 ++-- .../migrater/ExplicitMigrater.java | 8 +- .../migrater/MicroMigrater.java | 19 ++- .../VersionAlreadyRegisteredException.java | 12 +- .../ScriptExecutionNotification.java | 22 +-- .../micromigration/scripts/Context.java | 15 +- .../scripts/MigrationScript.java | 8 +- .../ReflectiveVersionMigrationScript.java | 2 +- .../scripts/SimpleMigrationScript.java | 4 +- .../scripts/SimpleTypedMigrationScript.java | 8 +- .../micromigration/version/Versioned.java | 4 +- ...oduceMigrationOnExistingDatastoreTest.java | 4 +- .../MigrationScriptAfterScriptTest.java | 24 +-- .../integration/MultipleScriptsTest.java | 19 ++- ...oreStuffInMigrationStorageManagerTest.java | 7 +- .../migrater/ExplicitMigraterTest.java | 7 +- .../ReflectiveVersionMigrationScriptTest.java | 5 +- .../testUtil/MicroMigrationScriptDummy.java | 6 +- 25 files changed, 422 insertions(+), 276 deletions(-) rename src/main/java/de/johannes_rabauer/micromigration/{ => microstream/v5}/MigrationEmbeddedStorage.java (93%) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationManagerV5.java create mode 100644 src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationScriptV5.java rename src/main/java/de/johannes_rabauer/micromigration/{MigrationEmbeddedStorageManager.java => microstream/v5/TunnelingEmbeddedStorageManager.java} (57%) create mode 100644 src/main/java/de/johannes_rabauer/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java index b9cec63..a00379e 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java @@ -1,14 +1,15 @@ package de.johannes_rabauer.micromigration; -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Supplier; - +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Supplier; /** @@ -17,91 +18,15 @@ * Can be used to keep the version of the MicroStream-Root-Object to keep the whole * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} * multiple versioned objects can be used in one datastore. - * + * * @author Johannes Rabauer * */ -public class MigrationManager +public interface MigrationManager { - private final Supplier currentVersionGetter; - private final Consumer currentVersionSetter; - private final Consumer currentVersionStorer; - private final MicroMigrater migrater ; - private final EmbeddedStorageManager storageManager ; - - /** - * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. - * - * @param currentVersionGetter which supplies the current version of the object to update. - * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. - * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. - */ - public MigrationManager - ( - final Supplier currentVersionGetter, - final Consumer currentVersionSetter, - final Consumer currentVersionStorer, - final MicroMigrater migrater , - final EmbeddedStorageManager storageManager - ) - { - Objects.requireNonNull(currentVersionGetter); - Objects.requireNonNull(currentVersionSetter); - Objects.requireNonNull(currentVersionStorer); - Objects.requireNonNull(migrater); - Objects.requireNonNull(storageManager); - this.currentVersionGetter = currentVersionGetter; - this.currentVersionSetter = currentVersionSetter; - this.currentVersionStorer = currentVersionStorer; - this.migrater = migrater; - this.storageManager = storageManager; - } - - /** - * Simple Constructor. - * - * @param versionedObject which provides getter and setter for the current version. - * This object will be stored after the {@link MigrationScript}s are executed. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. - */ - public MigrationManager - ( - final Versioned versionedObject, - final MicroMigrater migrater , - final EmbeddedStorageManager storageManager - ) - { - this( - ( ) -> versionedObject.getVersion() , - (version) -> versionedObject.setVersion(version) , - (version) -> storageManager.store(versionedObject), - migrater , - storageManager - ); - Objects.requireNonNull(versionedObject); - } - /** * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon */ - public void migrate(Object objectToMigrate) - { - final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); - // Execute Updates - final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( - versionBeforeUpdate, - this.storageManager, - objectToMigrate - ); - //Update stored version, if needed - if(!versionAfterUpdate.equals(versionBeforeUpdate)) - { - currentVersionSetter.accept(versionAfterUpdate); - currentVersionStorer.accept(versionAfterUpdate); - } - } + public void migrate(Object objectToMigrate); } diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorage.java similarity index 93% rename from src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java rename to src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorage.java index 35cb654..a600234 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorage.java +++ b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorage.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration; +package de.johannes_rabauer.micromigration.microstream.v5; import java.nio.file.Path; import java.util.Objects; @@ -24,7 +24,7 @@ public class MigrationEmbeddedStorage { /** * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. - * Uses the MicroStream {@link EmbeddedStorageFoundation.New()} configuration for the actual + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual * {@link EmbeddedStorageManager}. *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. * @@ -43,11 +43,11 @@ public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater /** * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. - * Uses the MicroStream {@link EmbeddedStorageFoundation.New()} configuration for the actual + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual * {@link EmbeddedStorageManager}. *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. * - * @param storageDirectory is used as the base directory for the datastore {@link Configuration#setBaseDirectory(String)} + * @param storageDirectory is used as the base directory for the datastore * @param migrater which is used as source for the migration scripts * @return the created storage manager with the given migrater */ diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..4f271a5 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java @@ -0,0 +1,100 @@ +package de.johannes_rabauer.micromigration.microstream.v5; + +import java.util.Objects; +import java.util.function.Predicate; + +import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.migrater.MicroMigrater; +import de.johannes_rabauer.micromigration.version.MigrationVersion; +import de.johannes_rabauer.micromigration.version.Versioned; +import de.johannes_rabauer.micromigration.version.VersionedRoot; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager +{ + private final MicroMigrater migrater ; + private VersionedRoot versionRoot ; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * Almost all methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + * @param migrater which is used as source for the migration scripts + */ + public MigrationEmbeddedStorageManager( + EmbeddedStorageManager nativeManager, + MicroMigrater migrater + ) + { + super(nativeManager); + Objects.requireNonNull(migrater); + this.migrater = migrater; + } + + /** + * {@inheritDoc} + *

+ * Checks if the root object is of the instance of {@link Versioned}. + * If it is not, the root will be replaced with the versioned root and the actual root object + * will be put inside the versioned root. + *

+ * After starting the storage manager, all the available update scripts are executed in order + * until the newest version of the datastore is reached. + */ + @Override + public MigrationEmbeddedStorageManager start() + { + this.nativeManager.start(); + if(this.nativeManager.root() instanceof VersionedRoot) + { + this.versionRoot = (VersionedRoot)this.nativeManager.root(); + } + else + { + //Build VersionedRoot around actual root, set by user. + this.versionRoot = new VersionedRoot(this.nativeManager.root()); + nativeManager.setRoot(versionRoot); + nativeManager.storeRoot(); + } + new MigrationManagerV5( + this.versionRoot, + migrater, + this + ) + .migrate(this.versionRoot.getRoot()); + return this; + } + + public MigrationVersion getCurrentVersion() + { + return this.versionRoot.getVersion(); + } + + @Override + public Object root() { + return this.versionRoot.getRoot(); + } + + @Override + public Object setRoot(Object newRoot) { + this.versionRoot.setRoot(newRoot); + return newRoot; + } + + @Override + public long storeRoot() { + return this.nativeManager.store(this.versionRoot); + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationManagerV5.java b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationManagerV5.java new file mode 100644 index 0000000..7cf3896 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationManagerV5.java @@ -0,0 +1,109 @@ +package de.johannes_rabauer.micromigration.microstream.v5; + +import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import de.johannes_rabauer.micromigration.MigrationManager; +import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.migrater.MicroMigrater; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; +import de.johannes_rabauer.micromigration.version.Versioned; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Manages a given object and keeps the version for it. + *

+ * Can be used to keep the version of the MicroStream-Root-Object to keep the whole + * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * multiple versioned objects can be used in one datastore. + * + * @author Johannes Rabauer + * + */ +public class MigrationManagerV5 implements MigrationManager +{ + private final Supplier currentVersionGetter; + private final Consumer currentVersionSetter; + private final Consumer currentVersionStorer; + private final MicroMigrater migrater ; + private final EmbeddedStorageManager storageManager ; + + /** + * Much more complicated constructor than {@link MigrationManagerV5#MigrationManagerV5(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManagerV5 + ( + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + Objects.requireNonNull(currentVersionGetter); + Objects.requireNonNull(currentVersionSetter); + Objects.requireNonNull(currentVersionStorer); + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageManager); + this.currentVersionGetter = currentVersionGetter; + this.currentVersionSetter = currentVersionSetter; + this.currentVersionStorer = currentVersionStorer; + this.migrater = migrater; + this.storageManager = storageManager; + } + + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link MigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManagerV5 + ( + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + this( + ( ) -> versionedObject.getVersion() , + (version) -> versionedObject.setVersion(version) , + (version) -> storageManager.store(versionedObject), + migrater , + storageManager + ); + Objects.requireNonNull(versionedObject); + } + + /** + * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. + * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon + */ + public void migrate(Object objectToMigrate) + { + final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); + // Execute Updates + final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( + versionBeforeUpdate, + new TunnelingEmbeddedStorageManager(this.storageManager), + objectToMigrate + ); + //Update stored version, if needed + if(!versionAfterUpdate.equals(versionBeforeUpdate)) + { + currentVersionSetter.accept(versionAfterUpdate); + currentVersionStorer.accept(versionAfterUpdate); + } + } +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationScriptV5.java b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationScriptV5.java new file mode 100644 index 0000000..bc4a652 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationScriptV5.java @@ -0,0 +1,22 @@ +package de.johannes_rabauer.micromigration.microstream.v5; + +import de.johannes_rabauer.micromigration.scripts.Context; +import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import de.johannes_rabauer.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.Comparator; + + +/** + * Interface for scripts to migrate / update datastores. + *

+ * One script is supposed to bring a datastore from a lower version to the target version. + * After the {@link MigrationScriptV5#migrate(Context)} method is called, + * the target version is reached. + * + * @author Johannes Rabauer + * + */ +public interface MigrationScriptV5 extends MigrationScript +{} diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java similarity index 57% rename from src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java rename to src/main/java/de/johannes_rabauer/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java index 710e211..76c77ca 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationEmbeddedStorageManager.java +++ b/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java @@ -1,8 +1,6 @@ -package de.johannes_rabauer.micromigration; - -import java.util.Objects; -import java.util.function.Predicate; +package de.johannes_rabauer.micromigration.microstream.v5; +import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.MicroMigrater; import de.johannes_rabauer.micromigration.version.MigrationVersion; import de.johannes_rabauer.micromigration.version.Versioned; @@ -27,206 +25,170 @@ import one.microstream.storage.types.StorageRawFileStatistics; import one.microstream.storage.types.StorageTypeDictionary; +import java.util.Objects; +import java.util.function.Predicate; + /** - * Wrapper class for the MicroStream {@link EmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. + * Internally uses the {@link MigrationManagerV5} to do the actual migration. * * @author Johannes Rabauer * */ -public class MigrationEmbeddedStorageManager implements EmbeddedStorageManager +public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager { - private final EmbeddedStorageManager nativeManager; - private final MicroMigrater migrater ; - private VersionedRoot versionRoot ; - + protected final EmbeddedStorageManager nativeManager; + /** - * @param nativeManager which will be used as the underlying storage manager. - * Almost all methods are only rerouted to this native manager. - * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * @param nativeManager which will be used as the underlying storage manager. + * All methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted * and a {@link Versioned} is placed between the requests. - * @param migrater which is used as source for the migration scripts */ - public MigrationEmbeddedStorageManager( - EmbeddedStorageManager nativeManager, - MicroMigrater migrater + public TunnelingEmbeddedStorageManager( + EmbeddedStorageManager nativeManager ) { Objects.requireNonNull(nativeManager); - Objects.requireNonNull(migrater); this.nativeManager = nativeManager; - this.migrater = migrater ; } - /** - * {@inheritDoc} - *

- * Checks if the root object is of the instance of {@link Versioned}. - * If it is not, the root will be replaced with the versioned root and the actual root object - * will be put inside the versioned root. - *

- * After starting the storage manager, all the available update scripts are executed in order - * until the newest version of the datastore is reached. - */ + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// + @Override - public MigrationEmbeddedStorageManager start() + public TunnelingEmbeddedStorageManager start() { this.nativeManager.start(); - if(this.nativeManager.root() instanceof VersionedRoot) - { - this.versionRoot = (VersionedRoot)this.nativeManager.root(); - } - else - { - //Build VersionedRoot around actual root, set by user. - this.versionRoot = new VersionedRoot(this.nativeManager.root()); - nativeManager.setRoot(versionRoot); - nativeManager.storeRoot(); - } - new MigrationManager( - this.versionRoot, - migrater, - this - ) - .migrate(this.versionRoot.getRoot()); return this; } - - public MigrationVersion getCurrentVersion() - { - return this.versionRoot.getVersion(); - } @Override public Object root() { - return this.versionRoot.getRoot(); + return this.nativeManager.root(); } @Override public Object setRoot(Object newRoot) { - this.versionRoot.setRoot(newRoot); - return newRoot; + return this.nativeManager.setRoot(newRoot); } @Override public long storeRoot() { - return this.nativeManager.store(this.versionRoot); + return this.nativeManager.storeRoot(); } - - //////////////////////////////////////////////////////////////// - // Simply forward all the other methods - //////////////////////////////////////////////////////////////// - + @Override - public StorageConfiguration configuration() + public StorageConfiguration configuration() { return this.nativeManager.configuration(); } @Override - public StorageTypeDictionary typeDictionary() + public StorageTypeDictionary typeDictionary() { return this.nativeManager.typeDictionary(); } @Override - public boolean shutdown() + public boolean shutdown() { return this.nativeManager.shutdown(); } - @Override - public void close() throws StorageException + @Override + public void close() throws StorageException { this.nativeManager.close(); } @Override - public StorageConnection createConnection() + public StorageConnection createConnection() { return this.nativeManager.createConnection(); } - + @Override - public PersistenceRootsView viewRoots() + public PersistenceRootsView viewRoots() { return this.nativeManager.viewRoots(); } @Override @Deprecated - public Reference defaultRoot() + public Reference defaultRoot() { return this.nativeManager.defaultRoot(); } @Override - public Database database() + public Database database() { return this.nativeManager.database(); } @Override - public boolean isAcceptingTasks() + public boolean isAcceptingTasks() { return this.nativeManager.isAcceptingTasks(); } @Override - public boolean isRunning() + public boolean isRunning() { return this.nativeManager.isRunning(); } @Override - public boolean isStartingUp() + public boolean isStartingUp() { return this.nativeManager.isStartingUp(); } @Override - public boolean isShuttingDown() + public boolean isShuttingDown() { return this.nativeManager.isShuttingDown(); } @Override - public void checkAcceptingTasks() + public void checkAcceptingTasks() { this.nativeManager.checkAcceptingTasks(); } @Override - public long initializationTime() + public long initializationTime() { return this.nativeManager.initializationTime(); } @Override - public long operationModeTime() + public long operationModeTime() { return this.nativeManager.operationModeTime(); } @Override - public boolean isActive() + public boolean isActive() { return this.nativeManager.isActive(); } @Override - public boolean issueGarbageCollection(long nanoTimeBudget) + public boolean issueGarbageCollection(long nanoTimeBudget) { return this.nativeManager.issueGarbageCollection(nanoTimeBudget); } @Override - public boolean issueFileCheck(long nanoTimeBudget) + public boolean issueFileCheck(long nanoTimeBudget) { return this.nativeManager.issueFileCheck(nanoTimeBudget); } @@ -238,39 +200,52 @@ public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator } @Override - public StorageRawFileStatistics createStorageStatistics() + public StorageRawFileStatistics createStorageStatistics() { return this.nativeManager.createStorageStatistics(); } @Override - public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { this.nativeManager.exportChannels(fileProvider, performGarbageCollection); } @Override - public StorageEntityTypeExportStatistics exportTypes(StorageEntityTypeExportFileProvider exportFileProvider, - Predicate isExportType) + public StorageEntityTypeExportStatistics exportTypes( + StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) { return this.nativeManager.exportTypes(exportFileProvider, isExportType); } @Override - public void importFiles(XGettingEnum importFiles) + public void importFiles(XGettingEnum importFiles) { this.nativeManager.importFiles(importFiles); } @Override - public PersistenceManager persistenceManager() + public PersistenceManager persistenceManager() { return this.nativeManager.persistenceManager(); } + @Override + public long store(Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.nativeManager; + } + @Override public void issueFullBackup(StorageLiveFileProvider targetFileProvider, - PersistenceTypeDictionaryExporter typeDictionaryExporter) { + PersistenceTypeDictionaryExporter typeDictionaryExporter) { this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); } -} + + } diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java b/src/main/java/de/johannes_rabauer/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java new file mode 100644 index 0000000..c85d471 --- /dev/null +++ b/src/main/java/de/johannes_rabauer/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java @@ -0,0 +1,6 @@ +package de.johannes_rabauer.micromigration.microstream.versionagnostic; + +public interface VersionAgnosticEmbeddedStorageManager { + public long store(final Object instance); + public T getNativeStorageManager(); +} diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java index abcec78..cf007a4 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java @@ -5,6 +5,7 @@ import java.util.TreeSet; import java.util.function.Consumer; +import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import de.johannes_rabauer.micromigration.notification.ScriptExecutionNotification; import de.johannes_rabauer.micromigration.scripts.Context; import de.johannes_rabauer.micromigration.scripts.MigrationScript; @@ -27,15 +28,15 @@ public void setNotificationConsumer(Consumer notifi @Override public MigrationVersion migrateToNewest( - MigrationVersion fromVersion , - EmbeddedStorageManager storageManager, - Object root + MigrationVersion fromVersion , + VersionAgnosticEmbeddedStorageManager storageManager, + Object root ) { Objects.requireNonNull(fromVersion); Objects.requireNonNull(storageManager); - TreeSet> sortedScripts = getSortedScripts(); + TreeSet> sortedScripts = getSortedScripts(); if(sortedScripts.size() > 0) { return migrateToVersion( @@ -51,10 +52,10 @@ public MigrationVersion migrateToNewest( @Override public MigrationVersion migrateToVersion ( - MigrationVersion fromVersion , - MigrationVersion targetVersion , - EmbeddedStorageManager storageManager , - Object objectToMigrate + MigrationVersion fromVersion , + MigrationVersion targetVersion , + VersionAgnosticEmbeddedStorageManager storageManager , + Object objectToMigrate ) { Objects.requireNonNull(fromVersion); @@ -62,7 +63,7 @@ public MigrationVersion migrateToNewest( Objects.requireNonNull(storageManager); MigrationVersion updateVersionWhichWasExecuted = fromVersion; - for (MigrationScript script : this.getSortedScripts()) + for (MigrationScript script : this.getSortedScripts()) { if(MigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) { @@ -94,10 +95,10 @@ public MigrationVersion migrateToNewest( } @SuppressWarnings("unchecked") - private MigrationVersion migrateWithScript( - MigrationScript script , - EmbeddedStorageManager storageManager , - Object objectToMigrate + private MigrationVersion migrateWithScript( + MigrationScript script , + VersionAgnosticEmbeddedStorageManager storageManager , + Object objectToMigrate ) { T castedObjectToMigrate = (T) objectToMigrate; @@ -111,10 +112,10 @@ private MigrationVersion migrateWithScript( * @throws {@link VersionAlreadyRegisteredException} if script is already registered. * @param scriptToCheck. It's target version is checked, if it is not already registered. */ - protected void checkIfVersionIsAlreadyRegistered(MigrationScript scriptToCheck) + protected void checkIfVersionIsAlreadyRegistered(MigrationScript scriptToCheck) { //Check if same version is not already registered - for (MigrationScript alreadyRegisteredScript : this.getSortedScripts()) + for (MigrationScript alreadyRegisteredScript : this.getSortedScripts()) { if(MigrationVersion.COMPARATOR.compare(alreadyRegisteredScript.getTargetVersion(), scriptToCheck.getTargetVersion()) == 0) { diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java index 3852113..ff4dd39 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java @@ -14,16 +14,16 @@ */ public class ExplicitMigrater extends AbstractMigrater { - private final TreeSet> sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); + private final TreeSet> sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); /** * @param scripts are all the scripts that are executed, if the current version is lower than this of the script
* Versions of the scripts must be unique. That means that no version is allowed multiple times in the migrater. * @throws VersionAlreadyRegisteredException */ - public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRegisteredException + public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRegisteredException { - for (MigrationScript script : scripts) + for (MigrationScript script : scripts) { checkIfVersionIsAlreadyRegistered(script); this.sortedScripts.add(script); @@ -31,7 +31,7 @@ public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRegi } @Override - public TreeSet> getSortedScripts() { + public TreeSet> getSortedScripts() { return this.sortedScripts; } } diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java index 8fc1f98..641854a 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java @@ -2,6 +2,7 @@ import java.util.TreeSet; +import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import de.johannes_rabauer.micromigration.scripts.Context; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; @@ -18,7 +19,7 @@ public interface MicroMigrater /** * @return all the contained {@link MigrationScript}s, sorted by their {@link MigrationVersion} ascending. */ - public TreeSet> getSortedScripts(); + public TreeSet> getSortedScripts(); /** * Executes all the scripts that are available to the migrater. @@ -34,7 +35,7 @@ public interface MicroMigrater * Scripts for lower versions then the fromVersion are not executed. * * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(Context)} - * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. + * method. This way the script can call {@link VersionAgnosticEmbeddedStorageManager#store(Object)} or another method on the storage manager. * * @param root is relayed to the scripts {@link MigrationScript#migrate(Context)} * method. This way the script can change something within the root object. @@ -42,9 +43,9 @@ public interface MicroMigrater * @return the target version of the last executed script */ public MigrationVersion migrateToNewest( - MigrationVersion fromVersion , - EmbeddedStorageManager storageManager, - Object root + MigrationVersion fromVersion , + VersionAgnosticEmbeddedStorageManager storageManager, + Object root ); /** @@ -73,9 +74,9 @@ public MigrationVersion migrateToNewest( */ public MigrationVersion migrateToVersion ( - MigrationVersion fromVersion , - MigrationVersion targetVersion , - EmbeddedStorageManager storageManager , - Object objectToMigrate + MigrationVersion fromVersion , + MigrationVersion targetVersion , + VersionAgnosticEmbeddedStorageManager storageManager , + Object objectToMigrate ); } diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java b/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java index 6b2ec11..f8a5d0e 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -11,13 +11,13 @@ public class VersionAlreadyRegisteredException extends Error private static final long serialVersionUID = 2153008832167067975L; private MigrationVersion alreadyRegisteredVersion; - private MigrationScript alreadyRegisteredScript ; - private MigrationScript newScriptToRegister ; + private MigrationScript alreadyRegisteredScript ; + private MigrationScript newScriptToRegister ; public VersionAlreadyRegisteredException( MigrationVersion alreadyRegisteredVersion, - MigrationScript alreadyRegisteredScript , - MigrationScript newScriptToRegister + MigrationScript alreadyRegisteredScript , + MigrationScript newScriptToRegister ) { super("Version " + alreadyRegisteredVersion.toString() + " is already registered. Versions must be unique within the migrater."); @@ -31,12 +31,12 @@ public MigrationVersion getAlreadyRegisteredVersion() return alreadyRegisteredVersion; } - public MigrationScript getAlreadyRegisteredScript() + public MigrationScript getAlreadyRegisteredScript() { return alreadyRegisteredScript; } - public MigrationScript getNewScriptToRegister() + public MigrationScript getNewScriptToRegister() { return newScriptToRegister; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java b/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java index af4947e..4f8059a 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java +++ b/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java @@ -14,18 +14,18 @@ */ public class ScriptExecutionNotification { - private MigrationScript executedScript; - private MigrationVersion sourceVersion ; - private MigrationVersion targetVersion ; - private LocalDateTime startDate ; - private LocalDateTime endDate ; + private MigrationScript executedScript; + private MigrationVersion sourceVersion ; + private MigrationVersion targetVersion ; + private LocalDateTime startDate ; + private LocalDateTime endDate ; public ScriptExecutionNotification( - MigrationScript executedScript, - MigrationVersion sourceVersion , - MigrationVersion targetVersion , - LocalDateTime startDate , - LocalDateTime endDate + MigrationScript executedScript, + MigrationVersion sourceVersion , + MigrationVersion targetVersion , + LocalDateTime startDate , + LocalDateTime endDate ) { super(); @@ -36,7 +36,7 @@ public ScriptExecutionNotification( this.endDate = endDate ; } - public MigrationScript getExecutedScript() + public MigrationScript getExecutedScript() { return executedScript; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java index 6bfb613..c27afe2 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java @@ -1,5 +1,6 @@ package de.johannes_rabauer.micromigration.scripts; +import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** @@ -7,19 +8,19 @@ * * @author Johannes Rabauer */ -public class Context +public class Context { - private final T migratingObject; - private final EmbeddedStorageManager storageManager ; + private final T migratingObject; + private final E storageManager ; public Context( - final T migratingObject, - final EmbeddedStorageManager storageManager + final T migratingObject, + final VersionAgnosticEmbeddedStorageManager storageManager ) { super(); this.migratingObject = migratingObject; - this.storageManager = storageManager ; + this.storageManager = storageManager.getNativeStorageManager(); } /** @@ -33,7 +34,7 @@ public T getMigratingObject() /** * @return the responsible storage manager for the migrating object */ - public EmbeddedStorageManager getStorageManager() + public E getStorageManager() { return storageManager; } diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java index 32dfa89..b665a95 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java @@ -15,7 +15,7 @@ * @author Johannes Rabauer * */ -public interface MigrationScript +public interface MigrationScript { /** * @return the version of the datastore after this script is executed. @@ -28,12 +28,12 @@ public interface MigrationScript * * @param context that holds necessary data for the migration */ - public void migrate(Context context); + public void migrate(Context context); - public static Comparator> COMPARATOR = new Comparator>() + public static Comparator> COMPARATOR = new Comparator>() { @Override - public int compare(MigrationScript o1, MigrationScript o2) { + public int compare(MigrationScript o1, MigrationScript o2) { return MigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); } }; diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java index 03ab7a2..9eec6f2 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -28,7 +28,7 @@ * @author Johannes Rabauer * */ -public abstract class ReflectiveVersionMigrationScript implements MigrationScript +public abstract class ReflectiveVersionMigrationScript implements MigrationScript { private final static char PREFIX = 'v'; private final static String VERSION_SEPERATOR = "_"; diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java index 1225039..dee5138 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java @@ -12,11 +12,11 @@ * @author Johannes Rabauer * */ -public class SimpleMigrationScript extends SimpleTypedMigrationScript +public class SimpleMigrationScript extends SimpleTypedMigrationScript { public SimpleMigrationScript( final MigrationVersion version , - final Consumer> consumer + final Consumer> consumer ) { super(version, consumer); diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java index 649dc78..ea8994d 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java +++ b/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java @@ -13,10 +13,10 @@ * @author Johannes Rabauer * */ -public class SimpleTypedMigrationScript implements MigrationScript +public class SimpleTypedMigrationScript implements MigrationScript { private final MigrationVersion version ; - private final Consumer> consumer; + private final Consumer> consumer; /** * @param version of the datastore after this script is executed @@ -24,7 +24,7 @@ public class SimpleTypedMigrationScript implements MigrationScript */ public SimpleTypedMigrationScript( final MigrationVersion version , - final Consumer> consumer + final Consumer> consumer ) { Objects.requireNonNull(version ); @@ -40,7 +40,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { this.consumer.accept(context); } diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java b/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java index cf4e8d3..9399d43 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java +++ b/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java @@ -1,9 +1,9 @@ package de.johannes_rabauer.micromigration.version; -import de.johannes_rabauer.micromigration.MigrationManager; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationManagerV5; /** - * Interface used by the {@link MigrationManager} for easier versioning of objects. + * Interface used by the {@link MigrationManagerV5} for easier versioning of objects. * * @author Johannes Rabauer * diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 0318274..020a470 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -5,8 +5,8 @@ import java.io.IOException; import java.nio.file.Path; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; import de.johannes_rabauer.micromigration.version.MigrationVersion; diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java index 0e786dd..bec6e4a 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -7,9 +7,9 @@ import java.nio.file.Path; import java.util.concurrent.atomic.AtomicBoolean; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.MigrationManager; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationManagerV5; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; @@ -40,7 +40,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with one migration script - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -53,7 +53,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -68,7 +68,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem @Test void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -104,15 +104,15 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with one migration script - final MigrationScript> firstScript = new SimpleTypedMigrationScript<>( + final MigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManager( + new MigrationManagerV5( (Versioned) storageManager.root(), - new ExplicitMigrater(firstScript), + new ExplicitMigrater(firstScript), storageManager ) .migrate(storageManager.root()); @@ -124,15 +124,15 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with two migration scripts - final MigrationScript> secondScript = new SimpleTypedMigrationScript<>( + final MigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManager( + new MigrationManagerV5( (Versioned) storageManager.root(), - new ExplicitMigrater(firstScript, secondScript), + new ExplicitMigrater(firstScript, secondScript), storageManager ) .migrate(storageManager.root()); diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java index 1675b7e..09bb389 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java @@ -4,13 +4,14 @@ import java.nio.file.Path; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.migrater.VersionAlreadyRegisteredException; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -21,11 +22,11 @@ class MultipleScriptsTest @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -40,11 +41,11 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir @Test void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); @@ -56,15 +57,15 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) @Test void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); - final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( + final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(3) ); diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index e98bca2..548170b 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -6,12 +6,13 @@ import java.io.IOException; import java.nio.file.Path; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -31,7 +32,7 @@ private static class ChildClass @Test void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final MigrationScript script = new SimpleTypedMigrationScript<>( + final MigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> {} ); diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java index b137291..ec175ec 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java @@ -6,12 +6,13 @@ import java.nio.file.Path; import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.MigrationEmbeddedStorageManager; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; +import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; @@ -57,7 +58,7 @@ void testWrongTypedVersionedScript(@TempDir Path storageFolder) storageManager.storeRoot(); } final ExplicitMigrater migrater = new ExplicitMigrater( - new SimpleTypedMigrationScript( + new SimpleTypedMigrationScript( new MigrationVersion(1), (context) -> { context.getStorageManager().setRoot(context.getMigratingObject() + 1); diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index b4cf253..e1ce52b 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -2,6 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -125,10 +126,10 @@ void testInvalildName_v___InvalidClassName() } - public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript + public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript { @Override - public void migrate(Context context) { + public void migrate(Context context) { //Dummy } } diff --git a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java index 6805aa8..780419f 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -3,8 +3,10 @@ import de.johannes_rabauer.micromigration.scripts.Context; import de.johannes_rabauer.micromigration.scripts.MigrationScript; import de.johannes_rabauer.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class MicroMigrationScriptDummy implements MigrationScript + +public class MicroMigrationScriptDummy implements MigrationScript { private final MigrationVersion version; @@ -20,7 +22,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) { + public void migrate(Context context) { // Don't do anything. } } From 3cfbf6c4f29cb14de5abf5da5c07d67d7932c352 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 1 Dec 2022 13:49:49 +0100 Subject: [PATCH 043/306] Migrated to software.xdev --- README.md | 4 ++-- pom.xml | 4 ++-- .../micromigration/MigrationManager.java | 14 +++---------- .../v5/MigrationEmbeddedStorage.java | 5 ++--- .../v5/MigrationEmbeddedStorageManager.java | 13 ++++++------ .../microstream/v5/MigrationManagerV5.java | 15 +++++++------- .../microstream/v5/MigrationScriptV5.java | 9 +++------ .../v5/TunnelingEmbeddedStorageManager.java | 9 +++------ ...VersionAgnosticEmbeddedStorageManager.java | 2 +- .../migrater/AbstractMigrater.java | 13 ++++++------ .../migrater/ExplicitMigrater.java | 4 ++-- .../migrater/MicroMigrater.java | 11 +++++----- .../VersionAlreadyRegisteredException.java | 6 +++--- .../ScriptExecutionNotification.java | 8 ++++---- .../xdev}/micromigration/scripts/Context.java | 6 +++--- .../scripts/MigrationScript.java | 4 ++-- .../ReflectiveVersionMigrationScript.java | 4 ++-- .../scripts/SimpleMigrationScript.java | 4 ++-- .../scripts/SimpleTypedMigrationScript.java | 4 ++-- .../version/MigrationVersion.java | 2 +- .../micromigration/version/Versioned.java | 4 ++-- .../version/VersionedObject.java | 2 +- .../micromigration/version/VersionedRoot.java | 2 +- ...oduceMigrationOnExistingDatastoreTest.java | 12 +++++------ .../MigrationScriptAfterScriptTest.java | 20 +++++++++---------- .../integration/MultipleScriptsTest.java | 16 +++++++-------- ...oreStuffInMigrationStorageManagerTest.java | 14 ++++++------- .../migrater/ExplicitMigraterTest.java | 12 +++++------ .../ReflectiveVersionMigrationScriptTest.java | 4 ++-- .../testUtil/MicroMigrationScriptDummy.java | 8 ++++---- .../version/MigrationVersionTest.java | 2 +- 31 files changed, 110 insertions(+), 127 deletions(-) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/MigrationManager.java (51%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/microstream/v5/MigrationEmbeddedStorage.java (94%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java (84%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/microstream/v5/MigrationManagerV5.java (87%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/microstream/v5/MigrationScriptV5.java (62%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java (93%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java (66%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/migrater/AbstractMigrater.java (88%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/migrater/ExplicitMigrater.java (89%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/migrater/MicroMigrater.java (90%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/migrater/VersionAlreadyRegisteredException.java (86%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/notification/ScriptExecutionNotification.java (82%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/scripts/Context.java (77%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/scripts/MigrationScript.java (89%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/scripts/ReflectiveVersionMigrationScript.java (95%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/scripts/SimpleMigrationScript.java (78%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/scripts/SimpleTypedMigrationScript.java (89%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/version/MigrationVersion.java (97%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/version/Versioned.java (66%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/version/VersionedObject.java (94%) rename src/main/java/{de/johannes_rabauer => software/xdev}/micromigration/version/VersionedRoot.java (94%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java (72%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/integration/MigrationScriptAfterScriptTest.java (88%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/integration/MultipleScriptsTest.java (81%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java (77%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/migrater/ExplicitMigraterTest.java (81%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java (97%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/testUtil/MicroMigrationScriptDummy.java (67%) rename src/test/java/{de/johannes_rabauer => software/xdev}/micromigration/version/MigrationVersionTest.java (94%) diff --git a/README.md b/README.md index 5e4faf5..9130b61 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,6 @@ The `ReflectiveMigrater` will search for any implementations of `MicroMigrationS This way scripts can simply be placed in the same package and on startup of the application all scripts are loaded in. ```java -final ReflectiveMigrater migrater = new ReflectiveMigrater("de.johannes_rabauer.micromigration.examples.reflective.scripts"); +final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.examples.reflective.scripts"); ``` -Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own repository](https://github.com/JohannesRabauer/micro-migration-reflection). \ No newline at end of file +Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own repository](https://github.com/JohannesRabauer/micro-migration-reflection). diff --git a/pom.xml b/pom.xml index 9504f9f..3d645d3 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - de.johannes_rabauer + software.xdev micro-migration 0.0.2 MicroMigration @@ -94,4 +94,4 @@ test - \ No newline at end of file + diff --git a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java b/src/main/java/software/xdev/micromigration/MigrationManager.java similarity index 51% rename from src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java rename to src/main/java/software/xdev/micromigration/MigrationManager.java index a00379e..ec5b4e4 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/MigrationManager.java +++ b/src/main/java/software/xdev/micromigration/MigrationManager.java @@ -1,15 +1,7 @@ -package de.johannes_rabauer.micromigration; +package software.xdev.micromigration; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; -import de.johannes_rabauer.micromigration.version.Versioned; - -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Supplier; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.MicroMigrater; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java similarity index 94% rename from src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorage.java rename to src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java index a600234..230fba3 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorage.java +++ b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java @@ -1,11 +1,10 @@ -package de.johannes_rabauer.micromigration.microstream.v5; +package software.xdev.micromigration.microstream.v5; import java.nio.file.Path; import java.util.Objects; -import de.johannes_rabauer.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.migrater.MicroMigrater; import one.microstream.afs.nio.types.NioFileSystem; -import one.microstream.configuration.types.Configuration; import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; import one.microstream.storage.embedded.types.EmbeddedStorageManager; diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java similarity index 84% rename from src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java rename to src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java index 4f271a5..1b0ad43 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java +++ b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java @@ -1,13 +1,12 @@ -package de.johannes_rabauer.micromigration.microstream.v5; +package software.xdev.micromigration.microstream.v5; import java.util.Objects; -import java.util.function.Predicate; -import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import de.johannes_rabauer.micromigration.version.MigrationVersion; -import de.johannes_rabauer.micromigration.version.Versioned; -import de.johannes_rabauer.micromigration.version.VersionedRoot; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedRoot; import one.microstream.storage.embedded.types.EmbeddedStorageManager; diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationManagerV5.java b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java similarity index 87% rename from src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationManagerV5.java rename to src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java index 7cf3896..502b4cf 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationManagerV5.java +++ b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java @@ -1,15 +1,14 @@ -package de.johannes_rabauer.micromigration.microstream.v5; +package software.xdev.micromigration.microstream.v5; import java.util.Objects; import java.util.function.Consumer; import java.util.function.Supplier; -import de.johannes_rabauer.micromigration.MigrationManager; -import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; -import de.johannes_rabauer.micromigration.version.Versioned; +import software.xdev.micromigration.MigrationManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -28,7 +27,7 @@ public class MigrationManagerV5 implements MigrationManager private final Supplier currentVersionGetter; private final Consumer currentVersionSetter; private final Consumer currentVersionStorer; - private final MicroMigrater migrater ; + private final MicroMigrater migrater ; private final EmbeddedStorageManager storageManager ; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationScriptV5.java b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java similarity index 62% rename from src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationScriptV5.java rename to src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java index bc4a652..400e3a8 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/MigrationScriptV5.java +++ b/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java @@ -1,12 +1,9 @@ -package de.johannes_rabauer.micromigration.microstream.v5; +package software.xdev.micromigration.microstream.v5; -import de.johannes_rabauer.micromigration.scripts.Context; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import java.util.Comparator; - /** * Interface for scripts to migrate / update datastores. diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java similarity index 93% rename from src/main/java/de/johannes_rabauer/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java rename to src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java index 76c77ca..4de0540 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java +++ b/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java @@ -1,10 +1,7 @@ -package de.johannes_rabauer.micromigration.microstream.v5; +package software.xdev.micromigration.microstream.v5; -import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import de.johannes_rabauer.micromigration.version.MigrationVersion; -import de.johannes_rabauer.micromigration.version.Versioned; -import de.johannes_rabauer.micromigration.version.VersionedRoot; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; import one.microstream.afs.types.AFile; import one.microstream.collections.types.XGettingEnum; import one.microstream.persistence.binary.types.Binary; diff --git a/src/main/java/de/johannes_rabauer/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java b/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java similarity index 66% rename from src/main/java/de/johannes_rabauer/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java rename to src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java index c85d471..4d683f4 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java +++ b/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.microstream.versionagnostic; +package software.xdev.micromigration.microstream.versionagnostic; public interface VersionAgnosticEmbeddedStorageManager { public long store(final Object instance); diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java b/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java similarity index 88% rename from src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java rename to src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index cf007a4..6dfc5d6 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/AbstractMigrater.java +++ b/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -1,16 +1,15 @@ -package de.johannes_rabauer.micromigration.migrater; +package software.xdev.micromigration.migrater; import java.time.LocalDateTime; import java.util.Objects; import java.util.TreeSet; import java.util.function.Consumer; -import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.notification.ScriptExecutionNotification; -import de.johannes_rabauer.micromigration.scripts.Context; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.notification.ScriptExecutionNotification; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; public abstract class AbstractMigrater implements MicroMigrater diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java b/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java similarity index 89% rename from src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java rename to src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java index ff4dd39..a2220cf 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigrater.java +++ b/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java @@ -1,8 +1,8 @@ -package de.johannes_rabauer.micromigration.migrater; +package software.xdev.micromigration.migrater; import java.util.TreeSet; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.MigrationScript; /** * Contains all the available scripts to migrate the datastore to a certain version. diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java b/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java similarity index 90% rename from src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java rename to src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index 641854a..9f2641d 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/MicroMigrater.java +++ b/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -1,13 +1,14 @@ -package de.johannes_rabauer.micromigration.migrater; +package software.xdev.micromigration.migrater; import java.util.TreeSet; -import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.scripts.Context; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; + /** * Executes all the available scripts to migrate the datastore to a certain version. * diff --git a/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java b/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java similarity index 86% rename from src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java rename to src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java index f8a5d0e..6ce95ba 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -1,9 +1,9 @@ -package de.johannes_rabauer.micromigration.migrater; +package software.xdev.micromigration.migrater; import java.util.Objects; -import de.johannes_rabauer.micromigration.version.MigrationVersion; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.scripts.MigrationScript; public class VersionAlreadyRegisteredException extends Error diff --git a/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java b/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java similarity index 82% rename from src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java rename to src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java index 4f8059a..6fa1c05 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/notification/ScriptExecutionNotification.java +++ b/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java @@ -1,10 +1,10 @@ -package de.johannes_rabauer.micromigration.notification; +package software.xdev.micromigration.notification; import java.time.LocalDateTime; -import de.johannes_rabauer.micromigration.migrater.MicroMigrater; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; /** * Contains data about the execution of a script by a {@link MicroMigrater}. diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java b/src/main/java/software/xdev/micromigration/scripts/Context.java similarity index 77% rename from src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java rename to src/main/java/software/xdev/micromigration/scripts/Context.java index c27afe2..19ff732 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/Context.java +++ b/src/main/java/software/xdev/micromigration/scripts/Context.java @@ -1,7 +1,7 @@ -package de.johannes_rabauer.micromigration.scripts; +package software.xdev.micromigration.scripts; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** * Container that holds necessary information for the execution of an {@link MigrationScript} diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java b/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java similarity index 89% rename from src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java rename to src/main/java/software/xdev/micromigration/scripts/MigrationScript.java index b665a95..4f5794b 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/MigrationScript.java +++ b/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java @@ -1,8 +1,8 @@ -package de.johannes_rabauer.micromigration.scripts; +package software.xdev.micromigration.scripts; import java.util.Comparator; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.MigrationVersion; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java b/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java similarity index 95% rename from src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java rename to src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java index 9eec6f2..05606bf 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -1,8 +1,8 @@ -package de.johannes_rabauer.micromigration.scripts; +package software.xdev.micromigration.scripts; import java.util.ArrayList; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.MigrationVersion; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java b/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java similarity index 78% rename from src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java rename to src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java index dee5138..8cccc24 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleMigrationScript.java +++ b/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java @@ -1,8 +1,8 @@ -package de.johannes_rabauer.micromigration.scripts; +package software.xdev.micromigration.scripts; import java.util.function.Consumer; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.MigrationVersion; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java b/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java similarity index 89% rename from src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java rename to src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java index ea8994d..cbea800 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/scripts/SimpleTypedMigrationScript.java +++ b/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java @@ -1,9 +1,9 @@ -package de.johannes_rabauer.micromigration.scripts; +package software.xdev.micromigration.scripts; import java.util.Objects; import java.util.function.Consumer; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.MigrationVersion; /** diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java b/src/main/java/software/xdev/micromigration/version/MigrationVersion.java similarity index 97% rename from src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java rename to src/main/java/software/xdev/micromigration/version/MigrationVersion.java index 34d51f4..397a96a 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/MigrationVersion.java +++ b/src/main/java/software/xdev/micromigration/version/MigrationVersion.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.version; +package software.xdev.micromigration.version; import java.util.Arrays; import java.util.Comparator; diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java b/src/main/java/software/xdev/micromigration/version/Versioned.java similarity index 66% rename from src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java rename to src/main/java/software/xdev/micromigration/version/Versioned.java index 9399d43..e78a27d 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/Versioned.java +++ b/src/main/java/software/xdev/micromigration/version/Versioned.java @@ -1,6 +1,6 @@ -package de.johannes_rabauer.micromigration.version; +package software.xdev.micromigration.version; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.microstream.v5.MigrationManagerV5; /** * Interface used by the {@link MigrationManagerV5} for easier versioning of objects. diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java b/src/main/java/software/xdev/micromigration/version/VersionedObject.java similarity index 94% rename from src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java rename to src/main/java/software/xdev/micromigration/version/VersionedObject.java index ef33ece..d2594dc 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedObject.java +++ b/src/main/java/software/xdev/micromigration/version/VersionedObject.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.version; +package software.xdev.micromigration.version; import java.util.Objects; diff --git a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java b/src/main/java/software/xdev/micromigration/version/VersionedRoot.java similarity index 94% rename from src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java rename to src/main/java/software/xdev/micromigration/version/VersionedRoot.java index 7e0ced7..01162fe 100644 --- a/src/main/java/de/johannes_rabauer/micromigration/version/VersionedRoot.java +++ b/src/main/java/software/xdev/micromigration/version/VersionedRoot.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.version; +package software.xdev.micromigration.version; import java.util.Objects; diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java similarity index 72% rename from src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java rename to src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 020a470..91f41bf 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,15 +1,15 @@ -package de.johannes_rabauer.micromigration.integration; +package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.nio.file.Path; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; -import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java b/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java similarity index 88% rename from src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java rename to src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index bec6e4a..f437a06 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.integration; +package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -7,15 +7,15 @@ import java.nio.file.Path; import java.util.concurrent.atomic.AtomicBoolean; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationManagerV5; -import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; -import de.johannes_rabauer.micromigration.version.Versioned; -import de.johannes_rabauer.micromigration.version.VersionedObject; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedObject; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java b/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java similarity index 81% rename from src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java rename to src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 09bb389..e08c6d5 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/MultipleScriptsTest.java +++ b/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,16 +1,16 @@ -package de.johannes_rabauer.micromigration.integration; +package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Path; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; -import de.johannes_rabauer.micromigration.migrater.VersionAlreadyRegisteredException; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java similarity index 77% rename from src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java rename to src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 548170b..424b056 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.integration; +package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -6,12 +6,12 @@ import java.io.IOException; import java.nio.file.Path; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.migrater.ExplicitMigrater; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; diff --git a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java b/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java similarity index 81% rename from src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java rename to src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index ec175ec..808fd39 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/migrater/ExplicitMigraterTest.java +++ b/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,20 +1,20 @@ -package de.johannes_rabauer.micromigration.migrater; +package software.xdev.micromigration.migrater; import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.file.Path; -import de.johannes_rabauer.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorage; -import de.johannes_rabauer.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import de.johannes_rabauer.micromigration.scripts.SimpleTypedMigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; class ExplicitMigraterTest diff --git a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java similarity index 97% rename from src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java rename to src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index e1ce52b..0199d56 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.scripts; +package software.xdev.micromigration.scripts; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.MigrationVersion; class ReflectiveVersionMigrationScriptTest { diff --git a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java b/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java similarity index 67% rename from src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java rename to src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index 780419f..cf32f3a 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,8 +1,8 @@ -package de.johannes_rabauer.micromigration.testUtil; +package software.xdev.micromigration.testUtil; -import de.johannes_rabauer.micromigration.scripts.Context; -import de.johannes_rabauer.micromigration.scripts.MigrationScript; -import de.johannes_rabauer.micromigration.version.MigrationVersion; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; diff --git a/src/test/java/de/johannes_rabauer/micromigration/version/MigrationVersionTest.java b/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java similarity index 94% rename from src/test/java/de/johannes_rabauer/micromigration/version/MigrationVersionTest.java rename to src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java index fa37da2..1326903 100644 --- a/src/test/java/de/johannes_rabauer/micromigration/version/MigrationVersionTest.java +++ b/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java @@ -1,4 +1,4 @@ -package de.johannes_rabauer.micromigration.version; +package software.xdev.micromigration.version; import static org.junit.jupiter.api.Assertions.assertEquals; From 216a6b85df5626f62d9d1906789c1a94b0e9c893 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 1 Dec 2022 15:31:35 +0100 Subject: [PATCH 044/306] Needed Module-Infos added --- pom.xml | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/pom.xml b/pom.xml index 3d645d3..051ebae 100644 --- a/pom.xml +++ b/pom.xml @@ -6,6 +6,34 @@ micro-migration 0.0.2 MicroMigration + + https://github.com/xdev-software/micro-migration + + https://github.com/xdev-software/micro-migration + https://github.com/xdev-software/micro-migration.git + + + + XDEV Software GmbH + https://xdev.software + + + + + XDEV Software GmbH + XDEV Software GmbH + https://xdev.software + + + + + + Apache License 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + repo + + + Migration Lib for MicroStream @@ -94,4 +122,66 @@ test + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + From 124a8ed046930c328c5a8c27965f1c473ab158c0 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 2 Dec 2022 09:48:48 +0100 Subject: [PATCH 045/306] Merged the multiple repostiories --- .classpath | 39 ---- .github/workflows/codeql-analysis.yml | 75 ------- .github/workflows/codeql.yml | 74 ------- .github/workflows/dependency-review.yml | 20 -- .gitignore | 4 +- pom.xml => core/pom.xml | 0 .../xdev/micromigration/MigrationManager.java | 0 .../v5/MigrationEmbeddedStorage.java | 0 .../v5/MigrationEmbeddedStorageManager.java | 0 .../microstream/v5/MigrationManagerV5.java | 0 .../microstream/v5/MigrationScriptV5.java | 0 .../v5/TunnelingEmbeddedStorageManager.java | 0 ...VersionAgnosticEmbeddedStorageManager.java | 0 .../migrater/AbstractMigrater.java | 0 .../migrater/ExplicitMigrater.java | 0 .../migrater/MicroMigrater.java | 0 .../VersionAlreadyRegisteredException.java | 0 .../ScriptExecutionNotification.java | 0 .../xdev/micromigration/scripts/Context.java | 0 .../scripts/MigrationScript.java | 0 .../ReflectiveVersionMigrationScript.java | 0 .../scripts/SimpleMigrationScript.java | 0 .../scripts/SimpleTypedMigrationScript.java | 0 .../version/MigrationVersion.java | 0 .../micromigration/version/Versioned.java | 0 .../version/VersionedObject.java | 0 .../micromigration/version/VersionedRoot.java | 0 ...oduceMigrationOnExistingDatastoreTest.java | 0 .../MigrationScriptAfterScriptTest.java | 0 .../integration/MultipleScriptsTest.java | 0 ...oreStuffInMigrationStorageManagerTest.java | 0 .../migrater/ExplicitMigraterTest.java | 0 .../ReflectiveVersionMigrationScriptTest.java | 0 .../testUtil/MicroMigrationScriptDummy.java | 0 .../version/MigrationVersionTest.java | 0 examples/README.md | 23 +++ examples/pom.xml | 167 ++++++++++++++++ .../examples/explicit/MainExplicit.java | 29 +++ .../explicit/scripts/UpdateToV1_0.java | 25 +++ .../explicit/scripts/UpdateToV1_1.java | 25 +++ ...alWithMigrationEmbeddedStorageManager.java | 72 +++++++ .../practical/embedded/UpdateToV1_0.java | 42 ++++ .../practical/embedded/UpdateToV2_0.java | 33 ++++ .../MainPracticalWithMigrationManager.java | 81 ++++++++ .../migrationManager/UpdateToV1_0.java | 45 +++++ .../migrationManager/UpdateToV2_0.java | 35 ++++ .../examples/practical/v0/BusinessBranch.java | 18 ++ .../examples/practical/v0/Customer.java | 11 ++ .../practical/v1AndHigher/Address.java | 8 + .../practical/v1AndHigher/BusinessBranch.java | 19 ++ .../practical/v1AndHigher/Customer.java | 7 + .../examples/reflective/MainReflective.java | 31 +++ .../reflective/scripts/UpdateToV1_0.java | 25 +++ .../reflective/scripts/UpdateToV1_1.java | 25 +++ reflection/README.md | 8 + reflection/pom.xml | 184 ++++++++++++++++++ .../migrater/ReflectiveMigrater.java | 78 ++++++++ .../ScriptInstantiationException.java | 16 ++ .../migrater/ReflectiveMigraterTest.java | 104 ++++++++++ .../AbstractScript.java | 10 + .../v1_ValidScript.java | 14 ++ .../abstractSuperClass/AbstractScript.java | 15 ++ .../abstractSuperClass/ValidScript.java | 14 ++ .../errorThrowing/ErrorThrowingScript.java | 27 +++ .../ExceptionThrowingScript.java | 27 +++ .../includeSubPackages/ValidScript.java | 22 +++ .../subpackage/ValidScriptInSubpackage.java | 22 +++ .../IrrelevantClass.java | 5 + .../ValidScript.java | 22 +++ .../NoCorrectConstructorScript.java | 29 +++ .../reflectiveVersion/v1_ValidScript.java | 15 ++ .../migrater/scripts/valid/ValidScript.java | 22 +++ 72 files changed, 1358 insertions(+), 209 deletions(-) delete mode 100644 .classpath delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/codeql.yml delete mode 100644 .github/workflows/dependency-review.yml rename pom.xml => core/pom.xml (100%) rename {src => core/src}/main/java/software/xdev/micromigration/MigrationManager.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/migrater/MicroMigrater.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/scripts/Context.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/scripts/MigrationScript.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/version/MigrationVersion.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/version/Versioned.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/version/VersionedObject.java (100%) rename {src => core/src}/main/java/software/xdev/micromigration/version/VersionedRoot.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java (100%) rename {src => core/src}/test/java/software/xdev/micromigration/version/MigrationVersionTest.java (100%) create mode 100644 examples/README.md create mode 100644 examples/pom.xml create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java create mode 100644 reflection/README.md create mode 100644 reflection/pom.xml create mode 100644 reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java create mode 100644 reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java create mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java diff --git a/.classpath b/.classpath deleted file mode 100644 index 473188a..0000000 --- a/.classpath +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 22becb1..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,75 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '25 6 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" - diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 781807e..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,74 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '26 21 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml deleted file mode 100644 index fe461b4..0000000 --- a/.github/workflows/dependency-review.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Dependency Review Action -# -# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. -# -# Source repository: https://github.com/actions/dependency-review-action -# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement -name: 'Dependency Review' -on: [pull_request] - -permissions: - contents: read - -jobs: - dependency-review: - runs-on: ubuntu-latest - steps: - - name: 'Checkout Repository' - uses: actions/checkout@v3 - - name: 'Dependency Review' - uses: actions/dependency-review-action@v2 diff --git a/.gitignore b/.gitignore index b3314e0..fbf48d0 100644 --- a/.gitignore +++ b/.gitignore @@ -135,4 +135,6 @@ $RECYCLE.BIN/ # End of https://www.toptal.com/developers/gitignore/api/maven,java,eclipse,windows #MicroStream Datastore default directory -/storage/ \ No newline at end of file +/storage/ + +.idea \ No newline at end of file diff --git a/pom.xml b/core/pom.xml similarity index 100% rename from pom.xml rename to core/pom.xml diff --git a/src/main/java/software/xdev/micromigration/MigrationManager.java b/core/src/main/java/software/xdev/micromigration/MigrationManager.java similarity index 100% rename from src/main/java/software/xdev/micromigration/MigrationManager.java rename to core/src/main/java/software/xdev/micromigration/MigrationManager.java diff --git a/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java similarity index 100% rename from src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java rename to core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java diff --git a/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java similarity index 100% rename from src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java rename to core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java diff --git a/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java b/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java similarity index 100% rename from src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java rename to core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java diff --git a/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java b/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java similarity index 100% rename from src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java rename to core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java diff --git a/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java similarity index 100% rename from src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java rename to core/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java diff --git a/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java similarity index 100% rename from src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java rename to core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java diff --git a/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java similarity index 100% rename from src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java rename to core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java diff --git a/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java similarity index 100% rename from src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java rename to core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java diff --git a/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java similarity index 100% rename from src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java rename to core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java diff --git a/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java similarity index 100% rename from src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java rename to core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java diff --git a/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java similarity index 100% rename from src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java rename to core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java diff --git a/src/main/java/software/xdev/micromigration/scripts/Context.java b/core/src/main/java/software/xdev/micromigration/scripts/Context.java similarity index 100% rename from src/main/java/software/xdev/micromigration/scripts/Context.java rename to core/src/main/java/software/xdev/micromigration/scripts/Context.java diff --git a/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java similarity index 100% rename from src/main/java/software/xdev/micromigration/scripts/MigrationScript.java rename to core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java diff --git a/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java similarity index 100% rename from src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java rename to core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java diff --git a/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java similarity index 100% rename from src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java rename to core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java diff --git a/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java similarity index 100% rename from src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java rename to core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java diff --git a/src/main/java/software/xdev/micromigration/version/MigrationVersion.java b/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java similarity index 100% rename from src/main/java/software/xdev/micromigration/version/MigrationVersion.java rename to core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java diff --git a/src/main/java/software/xdev/micromigration/version/Versioned.java b/core/src/main/java/software/xdev/micromigration/version/Versioned.java similarity index 100% rename from src/main/java/software/xdev/micromigration/version/Versioned.java rename to core/src/main/java/software/xdev/micromigration/version/Versioned.java diff --git a/src/main/java/software/xdev/micromigration/version/VersionedObject.java b/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java similarity index 100% rename from src/main/java/software/xdev/micromigration/version/VersionedObject.java rename to core/src/main/java/software/xdev/micromigration/version/VersionedObject.java diff --git a/src/main/java/software/xdev/micromigration/version/VersionedRoot.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java similarity index 100% rename from src/main/java/software/xdev/micromigration/version/VersionedRoot.java rename to core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java diff --git a/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/core/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java similarity index 100% rename from src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java rename to core/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java diff --git a/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/core/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java similarity index 100% rename from src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java rename to core/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java diff --git a/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/core/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java similarity index 100% rename from src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java rename to core/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java diff --git a/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/core/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java similarity index 100% rename from src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java rename to core/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java diff --git a/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/core/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java similarity index 100% rename from src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java rename to core/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java diff --git a/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java similarity index 100% rename from src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java rename to core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java diff --git a/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/core/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java similarity index 100% rename from src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java rename to core/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java diff --git a/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java similarity index 100% rename from src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java rename to core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..38960b8 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,23 @@ +# micro-migration-examples +Examples for the MicroMigration-Library + +Currently contains four major examples: +## Example with `ExplicitMigrater` +In the package `software.xdev.micromigration.examples.explicit` there is a simple example with explicitly listed upgrade scripts. +This is the most straight forward approach to use migration scripts. + +## Example with `ReflectiveMigrater` +In package `software.xdev.micromigration.examples.reflective` a migrater which finds it's scripts through reflection is used. +So here all `MicroMigrationScript`s in the defined `software.xdev.micromigration.examples.reflective.scripts` package are used. + +Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own repository](https://github.com/JohannesRabauer/micro-migration-reflection). + +## Practical examples +The package `software.xdev.micromigration.examples.practical.embedded` contains examples +that are just a bit more complex than the other examples and should allow an insight about the usage in a +practical environment. + +There is one example implemented with the `MigrationEmbeddedStorageManager` and another with the +plain `MigrationManager`, so it is clear what the difference between these two approaches is. +In both implementations the first update migrates from version 0 to 1 and converts an "old" `BusinessBranch` +to a newer one. The second update only adds more `Customer`s to the existing `BusinessBranch`. diff --git a/examples/pom.xml b/examples/pom.xml new file mode 100644 index 0000000..9327ea2 --- /dev/null +++ b/examples/pom.xml @@ -0,0 +1,167 @@ + + 4.0.0 + software.xdev + micro-migration-examples + 0.0.2 + MicroMigration-Examples + + https://github.com/xdev-software/micro-migration + + https://github.com/xdev-software/micro-migration + https://github.com/xdev-software/micro-migration.git + + + + XDEV Software GmbH + https://xdev.software + + + + + XDEV Software GmbH + XDEV Software GmbH + https://xdev.software + + + + + + Apache License 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + repo + + + + Examples for the MicroMigration-Library + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 9 + 9 + UTF-8 + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + 9 + UTF-8 + + + + attach-javadocs + + jar + + + + + + maven-resources-plugin + 2.6 + + UTF-8 + + + + + + + + software.xdev + micro-migration + 0.0.2 + + + software.xdev + micro-migration-reflection + 0.0.2 + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + + diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java new file mode 100644 index 0000000..41320c8 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -0,0 +1,29 @@ +package software.xdev.micromigration.examples.explicit; + +import java.util.Date; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_0; +import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_1; +import software.xdev.micromigration.migrater.ExplicitMigrater; + + +public class MainExplicit +{ + public static void main(String[] args) + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new UpdateToV1_0(), + new UpdateToV1_1() + ); + final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); + System.out.println(storageManager.root()); + if(storageManager.root() == null) + { + storageManager.setRoot("Hello World! @ " + new Date()); + } + storageManager.storeRoot(); + storageManager.shutdown(); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java new file mode 100644 index 0000000..39a151d --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -0,0 +1,25 @@ +package software.xdev.micromigration.examples.explicit.scripts; + +import java.util.Date; + +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV1_0 implements MigrationScriptV5 +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1,0); + } + + @Override + public void migrate(Context context) + { + System.out.println("Update " + getTargetVersion().toString() + " executed."); + context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java new file mode 100644 index 0000000..0433b3f --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -0,0 +1,25 @@ +package software.xdev.micromigration.examples.explicit.scripts; + +import java.util.Date; + +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV1_1 implements MigrationScriptV5 +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1,1); + } + + @Override + public void migrate(Context context) + { + System.out.println("Update " + getTargetVersion().toString() + " executed."); + context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..ec0ee9e --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -0,0 +1,72 @@ +package software.xdev.micromigration.examples.practical.embedded; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.examples.practical.v0.BusinessBranch; +import software.xdev.micromigration.examples.practical.v0.Customer; +import software.xdev.micromigration.migrater.ExplicitMigrater; + + +/** + * A practical example of usage in a few steps: + *
    + *
  • v0.0: Storage is created without any updates. Only stores a new {@link BusinessBranch} + *
  • v1.0: The BusinessBranch has a new implementation {@link BusinessBranch}. + * The old branch is converted to the new implementation through the {@link UpdateToV1_0} script. + *
  • v2.0: A new customer is added through the {@link UpdateToV2_0} script. + *
+ * The storage is restarted after every update to simulate a complete lifecycle of the datastore. + * @author Johannes Rabauer + * + */ +public class MainPracticalWithMigrationEmbeddedStorageManager +{ + public static void main(String[] args) + { + //V0.0 + final ExplicitMigrater emptyMigrater = new ExplicitMigrater(); + try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(emptyMigrater)) + { + storageManager.setRoot(createDummyBranch()); + storageManager.storeRoot(); + System.out.println(storageManager.root().toString()); + } + + + //V1.0 + final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); + try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV1)) + { + System.out.println(storageManager.root().toString()); + } + + + //V2.0 + final ExplicitMigrater migraterWithV2 = new ExplicitMigrater( + new UpdateToV1_0(), + new UpdateToV2_0() + ); + try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV2)) + { + System.out.println(storageManager.root().toString()); + } + } + + private static BusinessBranch createDummyBranch() + { + BusinessBranch branch = new BusinessBranch(); + Customer customer1 = new Customer(); + customer1.name = "Mick Fleetwood"; + customer1.number = 1; + customer1.street = "Fleetwood Street"; + customer1.city = "Redruth"; + branch.customers.add(customer1); + Customer customer2 = new Customer(); + customer2.name = "Lindsey Buckingham"; + customer2.number = 2; + customer2.street = "Mac Street"; + customer2.city = "Palo Alto"; + branch.customers.add(customer2); + return branch; + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java new file mode 100644 index 0000000..a943e5b --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -0,0 +1,42 @@ +package software.xdev.micromigration.examples.practical.embedded; + +import software.xdev.micromigration.examples.practical.v1AndHigher.Address; +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; +import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV1_0 implements MigrationScriptV5 +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1,0); + } + + @Override + public void migrate(Context context) + { + System.out.println("Executing Script for v1.0..."); + software.xdev.micromigration.examples.practical.v0.BusinessBranch oldBranch = context.getMigratingObject(); + BusinessBranch newBranch = + new BusinessBranch(); + for (software.xdev.micromigration.examples.practical.v0.Customer oldCustomer : oldBranch.customers) + { + Customer newCustomer = + new Customer(); + newCustomer.name = oldCustomer.name; + newCustomer.address = new Address(); + newCustomer.address.number = oldCustomer.number; + newCustomer.address.street = oldCustomer.street; + newCustomer.address.city = oldCustomer.city ; + newBranch.customers.add(newCustomer); + } + context.getStorageManager().setRoot(newBranch); + context.getStorageManager().storeRoot(); + System.out.println("Done executing Script for v1.0"); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java new file mode 100644 index 0000000..e3dc29e --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -0,0 +1,33 @@ +package software.xdev.micromigration.examples.practical.embedded; + +import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; +import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV2_0 implements MigrationScriptV5 +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(2,0); + } + + @Override + public void migrate(Context context) + { + System.out.println("Executing Script for v2.0..."); + final BusinessBranch branch = context.getMigratingObject(); + Customer newCustomer = new Customer(); + newCustomer.name = "Stevie Nicks"; + newCustomer.address.number = 5; + newCustomer.address.street = "Fleetwood Street"; + newCustomer.address.city = "Phoenix"; + branch.customers.add(newCustomer); + context.getStorageManager().store(branch.customers); + System.out.println("Done executing Script for v2.0"); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java new file mode 100644 index 0000000..7a34139 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -0,0 +1,81 @@ +package software.xdev.micromigration.examples.practical.migrationManager; + +import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.examples.practical.v0.BusinessBranch; +import software.xdev.micromigration.examples.practical.v0.Customer; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.version.VersionedObject; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * A practical example of usage in a few steps: + *
    + *
  • v0.0: Storage is created without any updates. Only stores a new {@link BusinessBranch} + *
  • v1.0: The BusinessBranch has a new implementation {@link software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch}. + * The old branch is converted to the new implementation through the {@link UpdateToV1_0} script. + *
  • v2.0: A new customer is added through the {@link UpdateToV2_0} script. + *
+ * The storage is restarted after every update to simulate a complete lifecycle of the datastore. + * @author Johannes Rabauer + * + */ +public class MainPracticalWithMigrationManager +{ + /** + * Suppressed Warning "unchecked" because it is given, that the correct object is returned. + */ + @SuppressWarnings("unchecked") + public static void main(String[] args) + { + //V0.0 + try(EmbeddedStorageManager storageManager = EmbeddedStorage.start()) + { + VersionedObject versionedBranch = new VersionedObject<>(createDummyBranch()); + storageManager.setRoot(versionedBranch); + storageManager.storeRoot(); + System.out.println(storageManager.root().toString()); + } + + + //V1.0 + try(EmbeddedStorageManager storageManager = EmbeddedStorage.start()) + { + final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); + VersionedObject versionedBranch = (VersionedObject)storageManager.root(); + new MigrationManagerV5(versionedBranch, migraterWithV1, storageManager) + .migrate(versionedBranch); + System.out.println(storageManager.root().toString()); + } + + + //V2.0 + try(EmbeddedStorageManager storageManager = EmbeddedStorage.start()) + { + final ExplicitMigrater migraterWithV2 = new ExplicitMigrater(new UpdateToV1_0(), new UpdateToV2_0()); + VersionedObject versionedBranch = (VersionedObject)storageManager.root(); + new MigrationManagerV5(versionedBranch, migraterWithV2, storageManager) + .migrate(versionedBranch); + System.out.println(storageManager.root().toString()); + } + } + + private static BusinessBranch createDummyBranch() + { + BusinessBranch branch = new BusinessBranch(); + Customer customer1 = new Customer(); + customer1.name = "Mick Fleetwood"; + customer1.number = 1; + customer1.street = "Fleetwood Street"; + customer1.city = "Redruth"; + branch.customers.add(customer1); + Customer customer2 = new Customer(); + customer2.name = "Lindsey Buckingham"; + customer2.number = 2; + customer2.street = "Mac Street"; + customer2.city = "Palo Alto"; + branch.customers.add(customer2); + return branch; + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java new file mode 100644 index 0000000..f0711f1 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -0,0 +1,45 @@ +package software.xdev.micromigration.examples.practical.migrationManager; + +import software.xdev.micromigration.examples.practical.v0.BusinessBranch; +import software.xdev.micromigration.examples.practical.v0.Customer; +import software.xdev.micromigration.examples.practical.v1AndHigher.Address; +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.VersionedObject; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV1_0 implements MigrationScriptV5> +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1,0); + } + + @Override + public void migrate(Context, EmbeddedStorageManager> context) + { + System.out.println("Executing Script for v1.0..."); + VersionedObject versionedBranch = context.getMigratingObject(); + BusinessBranch oldBranch = + (BusinessBranch) versionedBranch.getObject(); + software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch newBranch = + new software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch(); + for (Customer oldCustomer : oldBranch.customers) + { + software.xdev.micromigration.examples.practical.v1AndHigher.Customer newCustomer = + new software.xdev.micromigration.examples.practical.v1AndHigher.Customer(); + newCustomer.name = oldCustomer.name; + newCustomer.address = new Address(); + newCustomer.address.number = oldCustomer.number; + newCustomer.address.street = oldCustomer.street; + newCustomer.address.city = oldCustomer.city ; + newBranch.customers.add(newCustomer); + } + versionedBranch.setObject(newBranch); + context.getStorageManager().store(versionedBranch); + System.out.println("Done executing Script for v1.0"); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java new file mode 100644 index 0000000..8a055ae --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -0,0 +1,35 @@ +package software.xdev.micromigration.examples.practical.migrationManager; + +import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; +import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.VersionedObject; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV2_0 implements MigrationScriptV5> +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(2,0); + } + + @Override + public void migrate(Context, EmbeddedStorageManager> context) + { + System.out.println("Executing Script for v2.0..."); + VersionedObject versionedBranch = context.getMigratingObject(); + final BusinessBranch branch = versionedBranch.getObject(); + Customer newCustomer = new Customer(); + newCustomer.name = "Stevie Nicks"; + newCustomer.address.number = 5; + newCustomer.address.street = "Fleetwood Street"; + newCustomer.address.city = "Phoenix"; + branch.customers.add(newCustomer); + context.getStorageManager().store(branch.customers); + System.out.println("Done executing Script for v2.0"); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java new file mode 100644 index 0000000..fcc8f7f --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java @@ -0,0 +1,18 @@ +package software.xdev.micromigration.examples.practical.v0; + +import java.util.ArrayList; +import java.util.List; + +public class BusinessBranch +{ + public final List customers = new ArrayList<>(); + + @Override + public String toString() { + String toString = "Branch v0\nCustomers:"; + for (Customer customer : customers) { + toString += "\n " + customer.name; + } + return toString; + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java new file mode 100644 index 0000000..7aba0cc --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java @@ -0,0 +1,11 @@ +package software.xdev.micromigration.examples.practical.v0; + +public class Customer +{ + public String name; + + //Oversimplified old address format + public int number; + public String street; + public String city ; +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java new file mode 100644 index 0000000..9494acc --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java @@ -0,0 +1,8 @@ +package software.xdev.micromigration.examples.practical.v1AndHigher; + +public class Address +{ + public int number; + public String street; + public String city ; +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java new file mode 100644 index 0000000..1937d38 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java @@ -0,0 +1,19 @@ +package software.xdev.micromigration.examples.practical.v1AndHigher; + +import java.util.ArrayList; +import java.util.List; + + +public class BusinessBranch +{ + public final List customers = new ArrayList<>(); + + @Override + public String toString() { + String toString = "Branch v1 and higher\nCustomers:"; + for (Customer customer : customers) { + toString += "\n " + customer.name; + } + return toString; + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java new file mode 100644 index 0000000..b8b7e60 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java @@ -0,0 +1,7 @@ +package software.xdev.micromigration.examples.practical.v1AndHigher; + +public class Customer +{ + public String name ; + public Address address = new Address(); +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java new file mode 100644 index 0000000..031a757 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -0,0 +1,31 @@ +package software.xdev.micromigration.examples.reflective; + +import java.util.Date; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ReflectiveMigrater; +import software.xdev.micromigration.migrater.ScriptInstantiationException; + + +public class MainReflective +{ + public static void main(String[] args) + { + try { + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.examples.reflective.scripts"); + final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); + System.out.println(storageManager.root()); + if(storageManager.root() == null) + { + storageManager.setRoot("Hello World! @ " + new Date()); + } + storageManager.storeRoot(); + storageManager.shutdown(); + } + catch (IllegalArgumentException | SecurityException | ScriptInstantiationException e) + { + throw new Error("Could not initiate migration script", e); + } + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java new file mode 100644 index 0000000..d22c1bf --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -0,0 +1,25 @@ +package software.xdev.micromigration.examples.reflective.scripts; + +import java.util.Date; + +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV1_0 implements MigrationScriptV5 +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1,0); + } + + @Override + public void migrate(Context context) + { + System.out.println("Update " + getTargetVersion().toString() + " executed."); + context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); + } +} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java new file mode 100644 index 0000000..6313b72 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -0,0 +1,25 @@ +package software.xdev.micromigration.examples.reflective.scripts; + +import java.util.Date; + +import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class UpdateToV1_1 implements MigrationScriptV5 +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1,1); + } + + @Override + public void migrate(Context context) + { + System.out.println("Update " + getTargetVersion().toString() + " executed."); + context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); + } +} diff --git a/reflection/README.md b/reflection/README.md new file mode 100644 index 0000000..f6db8af --- /dev/null +++ b/reflection/README.md @@ -0,0 +1,8 @@ +# micro-migration-reflection +Provides a migrater based on reflection + +Currently only holds one class `ReflectiveMigrater` which uses the [Reflections library](https://github.com/ronmamo/reflections) +to find all instances of the `MicroMigrationScript` in a defined package. + +Because it is using the additional dependency, this class is extracted in this own repository and can be added only if needed +to the [core repository](https://github.com/JohannesRabauer/micro-migration). \ No newline at end of file diff --git a/reflection/pom.xml b/reflection/pom.xml new file mode 100644 index 0000000..6ee7229 --- /dev/null +++ b/reflection/pom.xml @@ -0,0 +1,184 @@ + + 4.0.0 + software.xdev + micro-migration-reflection + 0.0.2 + MicroMigration-Reflection + + https://github.com/xdev-software/micro-migration + + https://github.com/xdev-software/micro-migration + https://github.com/xdev-software/micro-migration.git + + + + XDEV Software GmbH + https://xdev.software + + + + + XDEV Software GmbH + XDEV Software GmbH + https://xdev.software + + + + + + Apache License 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + repo + + + + Provides a migrater based on reflection + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 9 + 9 + UTF-8 + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + 9 + UTF-8 + false + + + + attach-javadocs + + jar + + + + + + maven-resources-plugin + 2.6 + + UTF-8 + + + + maven-surefire-plugin + 2.22.2 + + + + + + + software.xdev + micro-migration + 0.0.2 + + + org.reflections + reflections + 0.9.11 + + + org.junit.jupiter + junit-jupiter-api + 5.6.2 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.6.2 + test + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + + diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java new file mode 100644 index 0000000..4d7bb4d --- /dev/null +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java @@ -0,0 +1,78 @@ +package software.xdev.micromigration.migrater; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Modifier; +import java.util.TreeSet; + +import org.reflections.Reflections; +import org.reflections.scanners.SubTypesScanner; +import org.reflections.util.ClasspathHelper; +import org.reflections.util.ConfigurationBuilder; +import org.reflections.util.FilterBuilder; + +import software.xdev.micromigration.scripts.MigrationScript; + +/** + * Contains all the available scripts to migrate the datastore to a certain version. + *

+ * Searches all implementation of {@link MigrationScript} in the specified package + * and it's the sub packages. + * + * @author Johannes Rabauer + * + */ +public class ReflectiveMigrater extends AbstractMigrater +{ + private final TreeSet> sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); + + /** + * @param packagePath defines the package in which {@link MigrationScript}s will be searched. + * Also searches through all sub packages of packagePath + * @throws ScriptInstantiationException if a class in the given package could not be instantiated + */ + @SuppressWarnings("rawtypes") + public ReflectiveMigrater(final String packagePath) throws ScriptInstantiationException + { + Reflections reflections = new Reflections( + new ConfigurationBuilder() + .setUrls(ClasspathHelper.forPackage(packagePath)) + .setScanners(new SubTypesScanner()) + //I don't get why you have to filter again, but if you don't, super-packages will get included + .filterInputsBy(new FilterBuilder().includePackage(packagePath)) + ); + + for (Class scriptClass : reflections.getSubTypesOf(MigrationScript.class)) + { + //Only instanciate non abstract classes + if(!Modifier.isAbstract(scriptClass.getModifiers())) + { + MigrationScript instanciatedScript = instanciateClass(scriptClass); + checkIfVersionIsAlreadyRegistered(instanciatedScript); + this.sortedScripts.add(instanciatedScript); + } + } + } + + @SuppressWarnings("rawtypes") + private MigrationScript instanciateClass(Class scriptClass) throws ScriptInstantiationException + { + try { + return scriptClass.getDeclaredConstructor().newInstance(); + } catch ( + InstantiationException | + IllegalAccessException | + IllegalArgumentException | + InvocationTargetException | + NoSuchMethodException | + SecurityException e + ) { + throw new ScriptInstantiationException("Could not instanciate class " + scriptClass.getName(), e); + } + } + + @Override + public TreeSet> getSortedScripts() + { + return this.sortedScripts; + } +} diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java new file mode 100644 index 0000000..0e730a6 --- /dev/null +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java @@ -0,0 +1,16 @@ +package software.xdev.micromigration.migrater; + +/** + * Holds information about exceptions if a script class can not be instantiated. + * + * @author Johannes Rabauer + * + */ +public class ScriptInstantiationException extends Exception +{ + private static final long serialVersionUID = 7087560201226697433L; + + public ScriptInstantiationException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java b/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java new file mode 100644 index 0000000..306a143 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java @@ -0,0 +1,104 @@ +package software.xdev.micromigration.migrater; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass.v1_ValidScript; +import software.xdev.micromigration.migrater.scripts.includeSubPackages.subpackage.ValidScriptInSubpackage; +import software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid.ValidScript; + + +class ReflectiveMigraterTest +{ + @Test + void testValidScript() throws ScriptInstantiationException { + ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.valid"); + assertEquals(1, migrater.getSortedScripts().size()); + assertEquals( + software.xdev.micromigration.migrater.scripts.valid.ValidScript.class, + migrater.getSortedScripts().first().getClass() + ); + } + + @Test + void testValidScriptWithIrrelevantClasses() throws ScriptInstantiationException { + ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid"); + assertEquals(1, migrater.getSortedScripts().size()); + assertEquals( + ValidScript.class, + migrater.getSortedScripts().first().getClass() + ); + } + + @Test + void testValidScriptWithSubpackages() throws ScriptInstantiationException { + ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.includeSubPackages"); + assertEquals(2, migrater.getSortedScripts().size()); + assertEquals( + software.xdev.micromigration.migrater.scripts.includeSubPackages.ValidScript.class, + migrater.getSortedScripts().first().getClass() + ); + assertEquals( + ValidScriptInSubpackage.class, + migrater.getSortedScripts().last().getClass() + ); + } + + @Test + void testPackageWithNoScript() throws ScriptInstantiationException { + ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.packageNotExisting"); + assertEquals(0, migrater.getSortedScripts().size()); + } + + @Test + void testExceptionThrowingScript() throws ScriptInstantiationException { + Assertions.assertThrows(ScriptInstantiationException.class, () -> { + new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.exceptionThrowing"); + }); + } + + @Test + void testErrorThrowingScript() throws ScriptInstantiationException { + Assertions.assertThrows(ScriptInstantiationException.class, () -> { + new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.errorThrowing"); + }); + } + + @Test + void testNoCorrectConstructor() throws ScriptInstantiationException { + Assertions.assertThrows(ScriptInstantiationException.class, () -> { + new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.noCorrectConstructor"); + }); + } + + @Test + void testAbstractSuperClass() throws ScriptInstantiationException { + ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.abstractSuperClass"); + assertEquals(1, migrater.getSortedScripts().size()); + assertEquals( + software.xdev.micromigration.migrater.scripts.abstractSuperClass.ValidScript.class, + migrater.getSortedScripts().first().getClass() + ); + } + + @Test + void testReflectiveVersion() throws ScriptInstantiationException { + ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.reflectiveVersion"); + assertEquals(1, migrater.getSortedScripts().size()); + assertEquals( + software.xdev.micromigration.migrater.scripts.reflectiveVersion.v1_ValidScript.class, + migrater.getSortedScripts().first().getClass() + ); + } + + @Test + void testReflectiveSuperClass() throws ScriptInstantiationException { + ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass"); + assertEquals(1, migrater.getSortedScripts().size()); + assertEquals( + v1_ValidScript.class, + migrater.getSortedScripts().first().getClass() + ); + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java new file mode 100644 index 0000000..06f7a1b --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java @@ -0,0 +1,10 @@ +package software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass; + +import software.xdev.micromigration.scripts.ReflectiveVersionMigrationScript; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public abstract class AbstractScript extends ReflectiveVersionMigrationScript +{ + +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java new file mode 100644 index 0000000..a6075e0 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java @@ -0,0 +1,14 @@ +package software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass; + +import software.xdev.micromigration.scripts.Context; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class v1_ValidScript extends AbstractScript +{ + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java new file mode 100644 index 0000000..70f1eee --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java @@ -0,0 +1,15 @@ +package software.xdev.micromigration.migrater.scripts.abstractSuperClass; + +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public abstract class AbstractScript implements MigrationScript +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1); + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java new file mode 100644 index 0000000..1e0d47c --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java @@ -0,0 +1,14 @@ +package software.xdev.micromigration.migrater.scripts.abstractSuperClass; + +import software.xdev.micromigration.scripts.Context; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class ValidScript extends AbstractScript +{ + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java new file mode 100644 index 0000000..cf4fcf5 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java @@ -0,0 +1,27 @@ +package software.xdev.micromigration.migrater.scripts.errorThrowing; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class ErrorThrowingScript implements MigrationScript +{ + public ErrorThrowingScript() + { + throw new Error(); + } + + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1); + } + + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java new file mode 100644 index 0000000..4c72a3c --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java @@ -0,0 +1,27 @@ +package software.xdev.micromigration.migrater.scripts.exceptionThrowing; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class ExceptionThrowingScript implements MigrationScript +{ + public ExceptionThrowingScript() throws Exception + { + throw new Exception(); + } + + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1); + } + + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java new file mode 100644 index 0000000..33d28f6 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java @@ -0,0 +1,22 @@ +package software.xdev.micromigration.migrater.scripts.includeSubPackages; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class ValidScript implements MigrationScript +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1); + } + + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java new file mode 100644 index 0000000..16cf5d1 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java @@ -0,0 +1,22 @@ +package software.xdev.micromigration.migrater.scripts.includeSubPackages.subpackage; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class ValidScriptInSubpackage implements MigrationScript +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(2); + } + + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java new file mode 100644 index 0000000..5c49e7f --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java @@ -0,0 +1,5 @@ +package software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid; + +public class IrrelevantClass { + +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java new file mode 100644 index 0000000..72438d9 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java @@ -0,0 +1,22 @@ +package software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class ValidScript implements MigrationScript +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1); + } + + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java new file mode 100644 index 0000000..65603e3 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java @@ -0,0 +1,29 @@ +package software.xdev.micromigration.migrater.scripts.noCorrectConstructor; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class NoCorrectConstructorScript implements MigrationScript +{ + private final String argument; + + public NoCorrectConstructorScript(String argument) + { + this.argument = argument; + } + + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1); + } + + @Override + public void migrate(Context context) + { + System.out.println(this.argument); + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java new file mode 100644 index 0000000..303d176 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java @@ -0,0 +1,15 @@ +package software.xdev.micromigration.migrater.scripts.reflectiveVersion; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.ReflectiveVersionMigrationScript; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class v1_ValidScript extends ReflectiveVersionMigrationScript +{ + @Override + public void migrate(Context context) + { + //Do nothing + } +} diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java new file mode 100644 index 0000000..2ea5fe8 --- /dev/null +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java @@ -0,0 +1,22 @@ +package software.xdev.micromigration.migrater.scripts.valid; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class ValidScript implements MigrationScript +{ + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1); + } + + @Override + public void migrate(Context context) + { + //Do nothing + } +} From 70d0964a4761b51745a3dfdb916c8ec21c8e9099 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 2 Dec 2022 10:15:28 +0100 Subject: [PATCH 046/306] Fixed Module-Setup --- .gitignore | 4 +- core/pom.xml | 322 ++++++++++++++++++++------------------------- examples/pom.xml | 247 ++++++++++++---------------------- pom.xml | 74 +++++++++++ reflection/pom.xml | 256 +++++++++++------------------------ 5 files changed, 381 insertions(+), 522 deletions(-) create mode 100644 pom.xml diff --git a/.gitignore b/.gitignore index fbf48d0..71b513c 100644 --- a/.gitignore +++ b/.gitignore @@ -137,4 +137,6 @@ $RECYCLE.BIN/ #MicroStream Datastore default directory /storage/ -.idea \ No newline at end of file +#IntelliJ +.idea +*.iml \ No newline at end of file diff --git a/core/pom.xml b/core/pom.xml index 051ebae..8fa755a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1,187 +1,147 @@ - 4.0.0 - software.xdev - micro-migration - 0.0.2 - MicroMigration + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + software.xdev + micro-migration-core + 0.0.2 + MicroMigration-Core + Migration Lib for MicroStream - https://github.com/xdev-software/micro-migration - - https://github.com/xdev-software/micro-migration - https://github.com/xdev-software/micro-migration.git - + + software.xdev + 0.0.2 + micro-migration + - - XDEV Software GmbH - https://xdev.software - + + + one.microstream + microstream-storage-embedded + 05.00.02-MS-GA + + + one.microstream + microstream-configuration + 05.00.02-MS-GA + + - - - XDEV Software GmbH - XDEV Software GmbH - https://xdev.software - - + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 9 + 9 + UTF-8 + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + 9 + UTF-8 + false + + -Xdoclint:none + -Xdoclint:none + + + + attach-javadocs + + jar + + + + + + maven-resources-plugin + 2.6 + + UTF-8 + + + + - - - Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - repo - - - - Migration Lib for MicroStream - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 9 - 9 - UTF-8 - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - 9 - UTF-8 - false - - -Xdoclint:none - -Xdoclint:none - -Xdoclint:none - - - - attach-javadocs - - jar - - - - - - maven-resources-plugin - 2.6 - - UTF-8 - - - - maven-surefire-plugin - 2.22.2 - - - - - - - one.microstream - microstream-storage-embedded - 05.00.02-MS-GA - - - one.microstream - microstream-configuration - 05.00.02-MS-GA - - - org.junit.jupiter - junit-jupiter-api - 5.6.2 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.6.2 - test - - - - - - release - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - - - org.jreleaser - jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - - - - - - + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + diff --git a/examples/pom.xml b/examples/pom.xml index 9327ea2..5ea54ec 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -1,167 +1,92 @@ - 4.0.0 - software.xdev - micro-migration-examples - 0.0.2 - MicroMigration-Examples + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + software.xdev + micro-migration-examples + 0.0.2 + MicroMigration-Examples + Examples for the MicroMigration-Library - https://github.com/xdev-software/micro-migration - - https://github.com/xdev-software/micro-migration - https://github.com/xdev-software/micro-migration.git - + + software.xdev + 0.0.2 + micro-migration + - - XDEV Software GmbH - https://xdev.software - + + + software.xdev + micro-migration + 0.0.2 + + + software.xdev + micro-migration-reflection + 0.0.2 + + - - - XDEV Software GmbH - XDEV Software GmbH - https://xdev.software - - - - - Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - repo - - - - Examples for the MicroMigration-Library - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 9 - 9 - UTF-8 - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - 9 - UTF-8 - - - - attach-javadocs - - jar - - - - - - maven-resources-plugin - 2.6 - - UTF-8 - - - - - - - - software.xdev - micro-migration - 0.0.2 - - - software.xdev - micro-migration-reflection - 0.0.2 - - - - - - - release - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - - - org.jreleaser - jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - - - - - - + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..af0a089 --- /dev/null +++ b/pom.xml @@ -0,0 +1,74 @@ + + + + 4.0.0 + + 0.0.2 + software.xdev + micro-migration + MicroMigration + pom + + + https://github.com/xdev-software/micro-migration + + https://github.com/xdev-software/micro-migration + https://github.com/xdev-software/micro-migration.git + + + + XDEV Software GmbH + https://xdev.software + + + + + XDEV Software GmbH + XDEV Software GmbH + https://xdev.software + + + + + + Apache License 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + UTF-8 + + + + core + reflection + examples + + + + + org.junit.jupiter + junit-jupiter-api + 5.6.2 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.6.2 + test + + + + + + + maven-surefire-plugin + 2.22.2 + + + + diff --git a/reflection/pom.xml b/reflection/pom.xml index 6ee7229..e8d8d97 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -1,184 +1,82 @@ - 4.0.0 - software.xdev - micro-migration-reflection - 0.0.2 - MicroMigration-Reflection + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + software.xdev + micro-migration-reflection + 0.0.2 + MicroMigration-Reflection + Provides a migrater based on reflection - https://github.com/xdev-software/micro-migration - - https://github.com/xdev-software/micro-migration - https://github.com/xdev-software/micro-migration.git - + + software.xdev + 0.0.2 + micro-migration + - - XDEV Software GmbH - https://xdev.software - + + + software.xdev + micro-migration + 0.0.2 + + + org.reflections + reflections + 0.9.11 + + - - - XDEV Software GmbH - XDEV Software GmbH - https://xdev.software - - - - - - Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - repo - - - - Provides a migrater based on reflection - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 9 - 9 - UTF-8 - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.2.0 - - 9 - UTF-8 - false - - - - attach-javadocs - - jar - - - - - - maven-resources-plugin - 2.6 - - UTF-8 - - - - maven-surefire-plugin - 2.22.2 - - - - - - - software.xdev - micro-migration - 0.0.2 - - - org.reflections - reflections - 0.9.11 - - - org.junit.jupiter - junit-jupiter-api - 5.6.2 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.6.2 - test - - - - - - - release - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - - - org.jreleaser - jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - - - - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 9 + 9 + UTF-8 + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + 9 + UTF-8 + false + + + + attach-javadocs + + jar + + + + + + maven-resources-plugin + 2.6 + + UTF-8 + + + + From bbc1a1801593e3420ff518e2e9f987d01e5c01ff Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 2 Dec 2022 14:26:27 +0100 Subject: [PATCH 047/306] JReleaser implemented with GitHubAction for Release --- .github/workflows/release.yml | 23 +++++++++++++ examples/pom.xml | 65 +---------------------------------- reflection/pom.xml | 64 +++++++++++++++++++++++++++++++++- 3 files changed, 87 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5bb5d1d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Publish package to the Maven Central Repository +on: + push: + tags: + - core-v* + pull_request: + branches: [ main ] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '9' + distribution: 'adopt' + - name: Publish package + env: + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + run: ./mvnw -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::file:./target/staging-deploy \ No newline at end of file diff --git a/examples/pom.xml b/examples/pom.xml index 5ea54ec..f45bb7f 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -17,7 +17,7 @@ software.xdev - micro-migration + micro-migration-core 0.0.2 @@ -26,67 +26,4 @@ 0.0.2 - - - - - release - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - - - org.jreleaser - jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - - - - - - diff --git a/reflection/pom.xml b/reflection/pom.xml index e8d8d97..754aa34 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -17,7 +17,7 @@ software.xdev - micro-migration + micro-migration-core 0.0.2 @@ -79,4 +79,66 @@ + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + From f8d103c627facbbb490db9b67718d85f1985e505 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 2 Dec 2022 14:33:44 +0100 Subject: [PATCH 048/306] Tried to fix release-action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5bb5d1d..47e3055 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,4 +20,4 @@ jobs: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - run: ./mvnw -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::file:./target/staging-deploy \ No newline at end of file + run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::file:./target/staging-deploy \ No newline at end of file From 6763ddd1cfe600d768ef8ccbbbe02cfbe96b96ee Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 2 Dec 2022 15:26:27 +0100 Subject: [PATCH 049/306] Tried to fix release-action --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47e3055..59394b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,10 @@ jobs: - name: Publish package env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::file:./target/staging-deploy \ No newline at end of file + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + + run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From 55aacee621398368d91b5a3c96fcb7c61bbee756 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 2 Dec 2022 15:30:46 +0100 Subject: [PATCH 050/306] Tried to fix release-action --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59394b2..1a76788 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Java uses: actions/setup-java@v3 with: - java-version: '9' + java-version: '11' distribution: 'adopt' - name: Publish package env: @@ -24,4 +24,4 @@ jobs: JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: ./mvnw -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From d2ec9e1a239e3098a69737975d6238ff50780dc3 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 2 Dec 2022 15:34:33 +0100 Subject: [PATCH 051/306] Tried to fix release-action --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a76788..59394b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Java uses: actions/setup-java@v3 with: - java-version: '11' + java-version: '9' distribution: 'adopt' - name: Publish package env: @@ -24,4 +24,4 @@ jobs: JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: ./mvnw -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From a53bcdcd368b60c994d8ac54a892014616737ee6 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 08:18:04 +0100 Subject: [PATCH 052/306] Tried to fix release-action --- reflection/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reflection/pom.xml b/reflection/pom.xml index 754aa34..bff2c65 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -77,6 +77,11 @@ UTF-8 + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + From 7bf2c1bf48b9a765650c72c17f2acd45b4dc29ed Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 08:21:31 +0100 Subject: [PATCH 053/306] Tried to fix release-action --- pom.xml | 5 +++++ reflection/pom.xml | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index af0a089..f5ae3ed 100644 --- a/pom.xml +++ b/pom.xml @@ -69,6 +69,11 @@ maven-surefire-plugin 2.22.2 + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + diff --git a/reflection/pom.xml b/reflection/pom.xml index bff2c65..754aa34 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -77,11 +77,6 @@ UTF-8 - - org.jreleaser - jreleaser-maven-plugin - 1.3.1 - From 9ad99fa5b1cd2245edf9e6787f6d0a8c9bfbc675 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 10:57:51 +0100 Subject: [PATCH 054/306] Tried to fix release-action --- .github/workflows/release.yml | 62 +++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59394b2..85db29b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,23 +5,59 @@ on: - core-v* pull_request: branches: [ main ] +#jobs: +# publish: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - name: Set up Java +# uses: actions/setup-java@v3 +# with: +# java-version: '9' +# distribution: 'adopt' +# - name: Publish package +# env: +# JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} +# JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} +# JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} +# JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} +# JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} +# JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} +# +# run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy jobs: - publish: + release: + name: Release runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - name: Set up Java + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Configure build steps as you'd normally do + + - name: Setup Java uses: actions/setup-java@v3 with: - java-version: '9' + java-version: 9 distribution: 'adopt' - - name: Publish package - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + # Post JARs to Maven Central - run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + - name: Release to Maven Central + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + run: | + export GPG_TTY=$(tty) + git config user.name "${{ github.event.head_commit.committer.name }}" + git config user.email "${{ github.event.head_commit.committer.email }}" + mvn -B -pl core release:prepare release:perform \ No newline at end of file From 6739ed8e52d035bdee05c841ce4def8240b9222f Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 10:59:50 +0100 Subject: [PATCH 055/306] Tried to fix release-action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85db29b..3721cee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,4 +60,4 @@ jobs: export GPG_TTY=$(tty) git config user.name "${{ github.event.head_commit.committer.name }}" git config user.email "${{ github.event.head_commit.committer.email }}" - mvn -B -pl core release:prepare release:perform \ No newline at end of file + mvn -B -pl core -Prelease release:prepare release:perform \ No newline at end of file From 08a372036f56172a4658f0dd4bc1f22aa72826bd Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 11:29:53 +0100 Subject: [PATCH 056/306] Tried to fix release-action --- .github/workflows/release.yml | 98 +++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3721cee..5b75734 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,59 +5,59 @@ on: - core-v* pull_request: branches: [ main ] -#jobs: -# publish: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - name: Set up Java -# uses: actions/setup-java@v3 -# with: -# java-version: '9' -# distribution: 'adopt' -# - name: Publish package -# env: -# JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} -# JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} -# JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} -# JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} -# JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} -# JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} -# -# run: mvn -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy jobs: - release: - name: Release + publish: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Configure build steps as you'd normally do - - - name: Setup Java + - uses: actions/checkout@v3 + - name: Set up Java uses: actions/setup-java@v3 with: - java-version: 9 + java-version: '9' distribution: 'adopt' - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - # Post JARs to Maven Central - - - name: Release to Maven Central + - name: Publish package env: - MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - run: | - export GPG_TTY=$(tty) - git config user.name "${{ github.event.head_commit.committer.name }}" - git config user.email "${{ github.event.head_commit.committer.email }}" - mvn -B -pl core -Prelease release:prepare release:perform \ No newline at end of file + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + run: mvn -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + working-directory: core +#jobs: +# release: +# name: Release +# runs-on: ubuntu-latest +# +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# with: +# fetch-depth: 0 +# +# # Configure build steps as you'd normally do +# +# - name: Setup Java +# uses: actions/setup-java@v3 +# with: +# java-version: 9 +# distribution: 'adopt' +# server-id: central +# server-username: MAVEN_USERNAME +# server-password: MAVEN_CENTRAL_TOKEN +# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} +# gpg-passphrase: MAVEN_GPG_PASSPHRASE +# +# # Post JARs to Maven Central +# +# - name: Release to Maven Central +# env: +# MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} +# MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} +# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} +# run: | +# export GPG_TTY=$(tty) +# git config user.name "${{ github.event.head_commit.committer.name }}" +# git config user.email "${{ github.event.head_commit.committer.email }}" +# mvn -B -pl core -Prelease release:prepare release:perform \ No newline at end of file From 190df97fa8abf8e4860e42989af9bd01484a2f52 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 11:36:03 +0100 Subject: [PATCH 057/306] Tried to fix release-action --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b75734..4e85dda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,10 @@ jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Set up Java uses: actions/setup-java@v3 with: @@ -23,8 +26,7 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy - working-directory: core + run: mvn -B -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy #jobs: # release: # name: Release From 32f0a19171fa0413ae31506eb5f7daea96db7f46 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 11:57:49 +0100 Subject: [PATCH 058/306] Tried to fix release-action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e85dda..b504011 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl core -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy #jobs: # release: # name: Release From 471d9bcbdaa926005afec539cb48a7fe382528ff Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 12:02:04 +0100 Subject: [PATCH 059/306] Tried to fix release-action --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b504011..cb6eb9b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,8 @@ jobs: - name: Set up Java uses: actions/setup-java@v3 with: - java-version: '9' - distribution: 'adopt' + java-version: '11' + distribution: 'temurin' - name: Publish package env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} From e38d06149a8a53d1c8f9ba0d671ff27bfe07fd60 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 12:07:24 +0100 Subject: [PATCH 060/306] Tried to fix release-action --- .github/workflows/release.yml | 40 +---------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb6eb9b..9cd3532 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,6 @@ on: push: tags: - core-v* - pull_request: - branches: [ main ] jobs: publish: runs-on: ubuntu-latest @@ -26,40 +24,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy -#jobs: -# release: -# name: Release -# runs-on: ubuntu-latest -# -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# with: -# fetch-depth: 0 -# -# # Configure build steps as you'd normally do -# -# - name: Setup Java -# uses: actions/setup-java@v3 -# with: -# java-version: 9 -# distribution: 'adopt' -# server-id: central -# server-username: MAVEN_USERNAME -# server-password: MAVEN_CENTRAL_TOKEN -# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} -# gpg-passphrase: MAVEN_GPG_PASSPHRASE -# -# # Post JARs to Maven Central -# -# - name: Release to Maven Central -# env: -# MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} -# MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} -# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} -# run: | -# export GPG_TTY=$(tty) -# git config user.name "${{ github.event.head_commit.committer.name }}" -# git config user.email "${{ github.event.head_commit.committer.email }}" -# mvn -B -pl core -Prelease release:prepare release:perform \ No newline at end of file + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From 8a4d616eee133cc09a2b9a9a9bc657f2afc55ab0 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 13:13:31 +0100 Subject: [PATCH 061/306] Tried to fix release-action --- pom.xml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/pom.xml b/pom.xml index f5ae3ed..d610d40 100644 --- a/pom.xml +++ b/pom.xml @@ -76,4 +76,40 @@ + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + + + From 1e270e5698eaad4c9147840d596f176f0d4f0698 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 9 Dec 2022 13:20:40 +0100 Subject: [PATCH 062/306] Tried to fix release-action --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d610d40..fcbb8f2 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ attach-javadoc - jar + aggregate @@ -103,7 +103,7 @@ attach-source - jar + aggregate From df2159f4d69d9bcf4d9da681a2a799cfcd9b8f9b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 07:44:37 +0100 Subject: [PATCH 063/306] Tried to fix release-action --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cd3532..4fcc986 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,8 @@ jobs: with: java-version: '11' distribution: 'temurin' + - name: Build project + run: mvn -B -Prelease clean install - name: Publish package env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} @@ -24,4 +26,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From 55fbc6c8c47594d9677d7ee863c6dc87c44a38a2 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 08:20:48 +0100 Subject: [PATCH 064/306] Brought java version to parent pom --- core/pom.xml | 10 ---------- pom.xml | 10 ++++++++++ reflection/pom.xml | 10 ---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8fa755a..e9d78eb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -29,16 +29,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 9 - 9 - UTF-8 - - org.apache.maven.plugins maven-source-plugin diff --git a/pom.xml b/pom.xml index fcbb8f2..2471dfb 100644 --- a/pom.xml +++ b/pom.xml @@ -65,6 +65,16 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 9 + 9 + UTF-8 + + maven-surefire-plugin 2.22.2 diff --git a/reflection/pom.xml b/reflection/pom.xml index 754aa34..6929efc 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -29,16 +29,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 9 - 9 - UTF-8 - - org.apache.maven.plugins maven-source-plugin From 027834963d3f46910ba906e9ed6aa40c642a3afd Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 08:59:42 +0100 Subject: [PATCH 065/306] Tried to publish all modules at the same time --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fcc986..18e3999 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Publish package to the Maven Central Repository on: push: tags: - - core-v* + - v* jobs: publish: runs-on: ubuntu-latest @@ -26,4 +26,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From 6ddf98dbff41ae6b1635182761945969854877c1 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 09:03:12 +0100 Subject: [PATCH 066/306] Tried to publish all modules at the same time...again --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18e3999..eec56aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: distribution: 'temurin' - name: Build project run: mvn -B -Prelease clean install - - name: Publish package + - name: Publish 'core' env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} @@ -26,4 +26,13 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + - name: Publish 'reflection' + env: + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + run: mvn -B -pl reflection -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From d6a1de75aa7dc0c44a1bb048baf6f23a4e222d38 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 10:02:56 +0100 Subject: [PATCH 067/306] Java Version and Micro-Migration version is not set in one position --- core/pom.xml | 6 +++--- examples/pom.xml | 8 ++++---- pom.xml | 10 +++++++--- reflection/pom.xml | 10 +++++----- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index e9d78eb..fdb04e6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-core - 0.0.2 + ${revision} MicroMigration-Core Migration Lib for MicroStream software.xdev - 0.0.2 + ${revision} micro-migration @@ -47,7 +47,7 @@ maven-javadoc-plugin 3.2.0 - 9 + ${java.version} UTF-8 false diff --git a/examples/pom.xml b/examples/pom.xml index f45bb7f..51f3540 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.2 + ${revision} MicroMigration-Examples Examples for the MicroMigration-Library software.xdev - 0.0.2 + ${revision} micro-migration @@ -18,12 +18,12 @@ software.xdev micro-migration-core - 0.0.2 + ${revision} software.xdev micro-migration-reflection - 0.0.2 + ${revision} diff --git a/pom.xml b/pom.xml index 2471dfb..4cd4a0b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.2 + ${revision} software.xdev micro-migration MicroMigration @@ -40,6 +40,10 @@ UTF-8 + + 8 + 0.0.2 @@ -70,8 +74,8 @@ maven-compiler-plugin 3.8.0 - 9 - 9 + ${java.version} + ${java.version} UTF-8 diff --git a/reflection/pom.xml b/reflection/pom.xml index 6929efc..6da0283 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.2 + ${revision} MicroMigration-Reflection Provides a migrater based on reflection software.xdev - 0.0.2 + ${revision} micro-migration @@ -18,12 +18,12 @@ software.xdev micro-migration-core - 0.0.2 + ${revision} org.reflections reflections - 0.9.11 + 0.10.2 @@ -47,7 +47,7 @@ maven-javadoc-plugin 3.2.0 - 9 + ${java.version} UTF-8 false From b238ee1c0858a6554f6ce6f87a20f22415fe7f5d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 11:01:07 +0100 Subject: [PATCH 068/306] Added Badges and Check Build Action --- .github/workflows/checkBuild.yml | 59 ++++++++++++++++++++++++++++++++ README.md | 5 +++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/checkBuild.yml diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml new file mode 100644 index 0000000..49a491a --- /dev/null +++ b/.github/workflows/checkBuild.yml @@ -0,0 +1,59 @@ +name: Check Build + +on: + workflow_dispatch: + push: + branches: [ main ] + paths-ignore: + - '**.md' + pull_request: + branches: [ main ] + paths-ignore: + - '**.md' + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [8, 11, 17] + java-package: [jdk] + distribution: [temurin] + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + java-package: ${{ matrix.java-package }} + cache: 'maven' + + - name: Build with Maven + run: mvn -B clean verify + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" + exit 1 + fi + + - uses: actions/upload-artifact@v3 + with: + name: jars-java-${{ matrix.java }} + path: target/*.jar \ No newline at end of file diff --git a/README.md b/README.md index 9130b61..f76f3a9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +[![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration-core)](https://mvnrepository.com/artifact/software.xdev/micro-migration-core) +[![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/main)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Amain) +[![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) +[![javadoc reflection](https://javadoc.io/badge2/software.xdev/micro-migration-reflection/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-reflection) + # Micro migration When you think about default database setup, you probably imagine something like this: From cae2dbd72c8e4bbe17d942565beae464314051b0 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 11:50:29 +0100 Subject: [PATCH 069/306] Pushed Java Version to 9 --- .github/workflows/checkBuild.yml | 2 +- .../xdev/micromigration/version/MigrationVersion.java | 9 +-------- pom.xml | 5 +++-- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 49a491a..7789110 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - java: [8, 11, 17] + java: [9, 11, 17] java-package: [jdk] distribution: [temurin] diff --git a/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java b/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java index 397a96a..3005b35 100644 --- a/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java +++ b/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java @@ -84,12 +84,5 @@ public boolean equals(Object obj) return true; } - public static Comparator COMPARATOR = new Comparator() - { - @Override - public int compare(MigrationVersion o1, MigrationVersion o2) - { - return Arrays.compare(o1.versions, o2.versions); - } - }; + public static Comparator COMPARATOR = Comparator.comparing(MigrationVersion::getVersions, (o1, o2) -> Arrays.compare(o1,o2)); } diff --git a/pom.xml b/pom.xml index 4cd4a0b..17d64ec 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,10 @@ UTF-8 - - 8 + 9 0.0.2 From 67bce2bae7426df905cecd3524d7f9d82b89bc1f Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 11:53:26 +0100 Subject: [PATCH 070/306] Removed impossible test for Java 9 There is no major version for java 9 available in GitHub Actions --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 7789110..cc3f7b6 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - java: [9, 11, 17] + java: [11, 17] java-package: [jdk] distribution: [temurin] From 63be6480d1ca67eeb1b74549d144c70358db04e5 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 12:59:35 +0100 Subject: [PATCH 071/306] Fixed READMEs --- README.md | 35 ++++++++++++++++++++++++++++------- examples/README.md | 2 +- reflection/README.md | 17 +++++++++++++++-- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f76f3a9..3953c70 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ [![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration-core)](https://mvnrepository.com/artifact/software.xdev/micro-migration-core) [![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/main)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Amain) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) -[![javadoc reflection](https://javadoc.io/badge2/software.xdev/micro-migration-reflection/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-reflection) # Micro migration When you think about default database setup, you probably imagine something like this: @@ -29,6 +28,19 @@ the version, suited to the current code. ![Migrate datastore to new version](./docs/MigrationSequence_4.png "Migrate datastore to new version") +## Usage + +### Maven + +Simply add the dependency to your `pom.xml`: +``` + + software.xdev + micro-migration-core + 0.0.2 + +``` + ## Approaches There are two possible usages with the Micro migration library: @@ -37,8 +49,8 @@ It can be used on a brand new datastore or introduced later, after a MicroStream Only the storage manager (`MigrationEmbeddedStorageManager`) knows about the versioning. The rest of application does not know about the version and can have no regards about it. -### `MigrationEmbeddedStorageManager` -Extensive examples can be found in its [own repository](https://github.com/JohannesRabauer/micro-migration-examples). +### MigrationEmbeddedStorageManager +Extensive examples can be found in its own [own module](https://github.com/xdev-software/micro-migration/tree/main/examples). A simple example where scripts need to be registered in the `ExplicitMigrater`: ```java @@ -70,7 +82,7 @@ public class UpdateToV1_0 implements MigrationScript } ``` -### `MigrationManager` +### MigrationManager Although the approach with the `MigrationEmbeddedStorageManager` is pretty easy to handle, it is intrusive in the way, that it replaces the root entry point of the MicroStream datastore and inserts its own `VersionedRoot` as root. Some users might find this too entrusive. @@ -90,7 +102,7 @@ public static void main(String[] args) ``` ## Migrater -### `ExplicitMigrater` +### ExplicitMigrater Scripts for the migrations must be registered in a `MicroMigrater`. The simplest way for this is to use the `ExplicitMigrater` and just put the scripts in the constructor. A downside of this method is that you need to register all scripts (new or old) manually in the constructor. @@ -102,7 +114,7 @@ final ExplicitMigrater migrater = new ExplicitMigrater( ); ``` -### `ReflectiveMigrater` +### ReflectiveMigrater For a more convenient usage the `ReflectiveMigrater` was built. You simply instanciate a object of this class with the package name of your `MicroMigrationScript`s. The `ReflectiveMigrater` will search for any implementations of `MicroMigrationScript` in the given package. @@ -111,4 +123,13 @@ This way scripts can simply be placed in the same package and on startup of the ```java final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.examples.reflective.scripts"); ``` -Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own repository](https://github.com/JohannesRabauer/micro-migration-reflection). +Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own module](https://github.com/xdev-software/micro-migration/tree/main/reflection). + +To use this, you need to add the following dependency to your `pom.xml`: +``` + + software.xdev + micro-migration-reflection + 0.0.2 + +``` diff --git a/examples/README.md b/examples/README.md index 38960b8..d378ca0 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,7 +10,7 @@ This is the most straight forward approach to use migration scripts. In package `software.xdev.micromigration.examples.reflective` a migrater which finds it's scripts through reflection is used. So here all `MicroMigrationScript`s in the defined `software.xdev.micromigration.examples.reflective.scripts` package are used. -Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own repository](https://github.com/JohannesRabauer/micro-migration-reflection). +Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own module](https://github.com/xdev-software/micro-migration/tree/main/reflection). ## Practical examples The package `software.xdev.micromigration.examples.practical.embedded` contains examples diff --git a/reflection/README.md b/reflection/README.md index f6db8af..c2ad3b8 100644 --- a/reflection/README.md +++ b/reflection/README.md @@ -1,8 +1,21 @@ -# micro-migration-reflection +# Micro migration Reflection Provides a migrater based on reflection Currently only holds one class `ReflectiveMigrater` which uses the [Reflections library](https://github.com/ronmamo/reflections) to find all instances of the `MicroMigrationScript` in a defined package. Because it is using the additional dependency, this class is extracted in this own repository and can be added only if needed -to the [core repository](https://github.com/JohannesRabauer/micro-migration). \ No newline at end of file +to the [core module](https://github.com/xdev-software/micro-migration#maven). + +## Usage + +### Maven + +Simply add the dependency to your `pom.xml`: +``` + + software.xdev + micro-migration-reflection + 0.0.2 + +``` \ No newline at end of file From 7e0ad04580a830bda1eed3a8f66c39fb4c2e6d00 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 14:05:19 +0100 Subject: [PATCH 072/306] Added CODE_OF_CONDUCT --- CODE_OF_CONDUCT.md | 133 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..68226cd --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[info@xdev-software.de](info@xdev-software.de). +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations From fc07483d98a9ced68badb5de3795d2a77b90eb81 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 14:06:04 +0100 Subject: [PATCH 073/306] Corrected CODE_OF_CONDUCT --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 68226cd..d2bb5ac 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -61,7 +61,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -[info@xdev-software.de](info@xdev-software.de). +info@xdev-software.de. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the From 62a5a422ae3fb33237186eda620514f8ac747535 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 14:24:04 +0100 Subject: [PATCH 074/306] Added OpenSSF Best Practices --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3953c70..7b2da69 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration-core)](https://mvnrepository.com/artifact/software.xdev/micro-migration-core) [![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/main)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Amain) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) +[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) # Micro migration When you think about default database setup, you probably imagine something like this: From 036c08b2b44cd0f85f3c5b9b8bb1e61257fd7041 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 12 Dec 2022 15:32:07 +0100 Subject: [PATCH 075/306] Tweaked Readmes --- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 41 +++++++++++++++++++++++++++++++++++++++++ LICENSE.txt => LICENSE | 0 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md rename LICENSE.txt => LICENSE (100%) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d2bb5ac..3052937 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -61,7 +61,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -info@xdev-software.de. +opensource@xdev-software.de. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..cc6a854 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,41 @@ +# Contributing to Micro migration + +We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: + +- Reporting a bug +- Discussing the current state of the code +- Submitting a fix +- Proposing new features +- Becoming a maintainer + +## We Develop with Github + +We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. + +## All Code Changes Happen Through Pull Requests + +Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests: + +1. Fork the repo and create your branch from `master`. +2. If you've added code that should be tested, add tests. +3. If you've changed APIs, update the documentation. +4. Ensure the test suite passes. +5. Issue that pull request! + +All commits must be [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). + +## Any contributions you make will be under the Apache-2.0 license + +In short, when you submit code changes, your submissions are understood to be under the same [Apache-2.0 license](https://github.com/xdev-software/micro-migration/blob/main/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. + +## Report bugs using Github's [issues](https://github.com/xdev-software/micro-migration/issues) + +We use GitHub issues to track public bugs. Report a bug by opening a new issue, it's that easy! + +## License + +By contributing, you agree that your contributions will be licensed under its Apache-2.0 license. + +## Code of Conduct + +Please follow our [Code of Conduct](CODE_OF_CONDUCT.md). \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE similarity index 100% rename from LICENSE.txt rename to LICENSE From 95fa43e3118463ca8506ecd9e10f3c7634bcb58a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 13 Dec 2022 07:55:01 +0100 Subject: [PATCH 076/306] Updated Doc --- CHANGELOG.md | 2 ++ CONTRIBUTING.md | 20 +++++++++++++------- README.md | 7 +++++++ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a2594e8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +## 0.0.2 +* Updated MicroStream from v4 to v5. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc6a854..359c7e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,11 +2,14 @@ We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: -- Reporting a bug -- Discussing the current state of the code -- Submitting a fix -- Proposing new features -- Becoming a maintainer +- **Reporting a bug**: File issues on GitHub. +- **Send pull requests**: If you want to contribute code, check out the development instructions below. +- **Discussing the current state of the code** +- **Submitting a fix** +- **Proposing new features** +- **Becoming a maintainer** + +We encourage you to read the [contribution instructions by GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing) also. ## We Develop with Github @@ -22,8 +25,6 @@ Pull requests are the best way to propose changes to the codebase. We actively w 4. Ensure the test suite passes. 5. Issue that pull request! -All commits must be [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). - ## Any contributions you make will be under the Apache-2.0 license In short, when you submit code changes, your submissions are understood to be under the same [Apache-2.0 license](https://github.com/xdev-software/micro-migration/blob/main/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. @@ -32,6 +33,11 @@ In short, when you submit code changes, your submissions are understood to be un We use GitHub issues to track public bugs. Report a bug by opening a new issue, it's that easy! +### Get in touch with the team + +Twitter: https://twitter.com/xdevsoftware +Mail: opensource@xdev-software.de + ## License By contributing, you agree that your contributions will be licensed under its Apache-2.0 license. diff --git a/README.md b/README.md index 7b2da69..5602aa6 100644 --- a/README.md +++ b/README.md @@ -134,3 +134,10 @@ To use this, you need to add the following dependency to your `pom.xml`: 0.0.2 ``` + +# Links +- [Javadoc](https://javadoc.io/doc/software.xdev/micro-migration-core/latest/index.html) +- [MvnRepository](https://mvnrepository.com/artifact/software.xdev/micro-migration-core) + +# Contributing +We would love your input in any way. More about contributing: [CONTRIBUTING.md](CONTRIBUTING.md) \ No newline at end of file From 46714efde6ad2fa1be6e793f3bce68e9e521d4e6 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 13 Dec 2022 11:01:02 +0100 Subject: [PATCH 077/306] Restructured project for dynamic MicroStream Version --- core/pom.xml | 17 +-- .../xdev/micromigration/MigrationManager.java | 6 +- .../migrater/AbstractMigrater.java | 2 +- .../migrater/MicroMigrater.java | 3 +- .../micromigration/version/Versioned.java | 4 +- .../ReflectiveVersionMigrationScriptTest.java | 19 +-- .../version/MigrationVersionTest.java | 4 +- examples/pom.xml | 2 +- microstream-v5/pom.xml | 143 ++++++++++++++++++ .../v5/MigrationEmbeddedStorage.java | 0 .../v5/MigrationEmbeddedStorageManager.java | 0 .../microstream/v5/MigrationManagerV5.java | 0 .../microstream/v5/MigrationScriptV5.java | 0 .../v5/TunnelingEmbeddedStorageManager.java | 0 .../microstream/v5/package-info.java | 4 + ...oduceMigrationOnExistingDatastoreTest.java | 0 .../MigrationScriptAfterScriptTest.java | 0 .../integration/MultipleScriptsTest.java | 0 ...oreStuffInMigrationStorageManagerTest.java | 0 .../migrater/ExplicitMigraterTest.java | 0 .../testUtil/MicroMigrationScriptDummy.java | 0 pom.xml | 1 + reflection/pom.xml | 16 ++ .../ScriptInstantiationException.java | 6 +- 24 files changed, 189 insertions(+), 38 deletions(-) create mode 100644 microstream-v5/pom.xml rename {core => microstream-v5}/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java (100%) rename {core => microstream-v5}/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java (100%) rename {core => microstream-v5}/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java (100%) rename {core => microstream-v5}/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java (100%) rename {core => microstream-v5}/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java (100%) create mode 100644 microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java rename {core => microstream-v5}/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java (100%) rename {core => microstream-v5}/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java (100%) rename {core => microstream-v5}/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java (100%) rename {core => microstream-v5}/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java (100%) rename {core => microstream-v5}/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java (100%) rename {core => microstream-v5}/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java (100%) diff --git a/core/pom.xml b/core/pom.xml index fdb04e6..ca8a3c6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 software.xdev @@ -14,19 +14,6 @@ micro-migration - - - one.microstream - microstream-storage-embedded - 05.00.02-MS-GA - - - one.microstream - microstream-configuration - 05.00.02-MS-GA - - - diff --git a/core/src/main/java/software/xdev/micromigration/MigrationManager.java b/core/src/main/java/software/xdev/micromigration/MigrationManager.java index ec5b4e4..4f1ac22 100644 --- a/core/src/main/java/software/xdev/micromigration/MigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/MigrationManager.java @@ -1,14 +1,10 @@ package software.xdev.micromigration; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.migrater.MicroMigrater; - - /** * Manages a given object and keeps the version for it. *

* Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * datastore versioned. Since it is not integrated like the MigrationEmbeddedStorageManager * multiple versioned objects can be used in one datastore. * * @author Johannes Rabauer diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 6dfc5d6..6e4fa6d 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -109,7 +109,7 @@ private MigrationVersion migrateWithScript( * Checks if the given {@link MigrationScript} is not already registered in the * {@link #getSortedScripts()}. * @throws {@link VersionAlreadyRegisteredException} if script is already registered. - * @param scriptToCheck. It's target version is checked, if it is not already registered. + * @param scriptToCheck It's target version is checked, if it is not already registered. */ protected void checkIfVersionIsAlreadyRegistered(MigrationScript scriptToCheck) { diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index 9f2641d..6691a32 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -6,7 +6,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** @@ -66,7 +65,7 @@ public MigrationVersion migrateToNewest( * Scripts which have a higher version won't be exectued. * * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(Context)} - * method. This way the script can call {@link EmbeddedStorageManager#store(Object)} or another method on the storage manager. + * method. This way the script can call EmbeddedStorageManager#store or another method on the storage manager. * * @param objectToMigrate is relayed to the scripts {@link MigrationScript#migrate(Context)} * method. This way the script can change something within the object to migrate. diff --git a/core/src/main/java/software/xdev/micromigration/version/Versioned.java b/core/src/main/java/software/xdev/micromigration/version/Versioned.java index e78a27d..62349bd 100644 --- a/core/src/main/java/software/xdev/micromigration/version/Versioned.java +++ b/core/src/main/java/software/xdev/micromigration/version/Versioned.java @@ -1,9 +1,7 @@ package software.xdev.micromigration.version; -import software.xdev.micromigration.microstream.v5.MigrationManagerV5; - /** - * Interface used by the {@link MigrationManagerV5} for easier versioning of objects. + * Interface used by the MigrationManagers for easier versioning of objects. * * @author Johannes Rabauer * diff --git a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index 0199d56..83d50b1 100644 --- a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -2,10 +2,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.ReflectiveVersionMigrationScript; import software.xdev.micromigration.version.MigrationVersion; class ReflectiveVersionMigrationScriptTest @@ -15,42 +16,42 @@ public static class v1_CorrectClassName extends ReflectiveVersionMigrationScript @Test void testCorrectName_v1_CorrectClassName() { - assertEquals(new MigrationVersion(1), new v1_CorrectClassName().getTargetVersion()); + Assertions.assertEquals(new MigrationVersion(1), new v1_CorrectClassName().getTargetVersion()); } public static class v1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v1_1_CorrectClassName() { - assertEquals(new MigrationVersion(1, 1), new v1_1_CorrectClassName().getTargetVersion()); + Assertions.assertEquals(new MigrationVersion(1, 1), new v1_1_CorrectClassName().getTargetVersion()); } public static class v1_1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v1_1_1_CorrectClassName() { - assertEquals(new MigrationVersion(1, 1, 1), new v1_1_1_CorrectClassName().getTargetVersion()); + Assertions.assertEquals(new MigrationVersion(1, 1, 1), new v1_1_1_CorrectClassName().getTargetVersion()); } public static class v10_1_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v10_1_1_CorrectClassName() { - assertEquals(new MigrationVersion(10, 1, 1), new v10_1_1_CorrectClassName().getTargetVersion()); + Assertions.assertEquals(new MigrationVersion(10, 1, 1), new v10_1_1_CorrectClassName().getTargetVersion()); } public static class v10_10_1_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v10_10_1_CorrectClassName() { - assertEquals(new MigrationVersion(10, 10, 1), new v10_10_1_CorrectClassName().getTargetVersion()); + Assertions.assertEquals(new MigrationVersion(10, 10, 1), new v10_10_1_CorrectClassName().getTargetVersion()); } public static class v10_10_10_CorrectClassName extends ReflectiveVersionMigrationScriptDummy{} @Test void testCorrectName_v10_10_10_CorrectClassName() { - assertEquals(new MigrationVersion(10, 10, 10), new v10_10_10_CorrectClassName().getTargetVersion()); + Assertions.assertEquals(new MigrationVersion(10, 10, 10), new v10_10_10_CorrectClassName().getTargetVersion()); } public static class a1_InvalidClassName extends ReflectiveVersionMigrationScriptDummy { } @@ -126,10 +127,10 @@ void testInvalildName_v___InvalidClassName() } - public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript + public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript { @Override - public void migrate(Context context) { + public void migrate(Context context) { //Dummy } } diff --git a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java index 1326903..a4c502e 100644 --- a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java +++ b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java @@ -3,8 +3,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; +import software.xdev.micromigration.version.MigrationVersion; -class MigrationVersionTest + +class MigrationVersionTest { @Test diff --git a/examples/pom.xml b/examples/pom.xml index 51f3540..4a29ded 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -17,7 +17,7 @@ software.xdev - micro-migration-core + micro-migration-microstream-v5 ${revision} diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml new file mode 100644 index 0000000..95ea692 --- /dev/null +++ b/microstream-v5/pom.xml @@ -0,0 +1,143 @@ + + 4.0.0 + software.xdev + micro-migration-microstream-v5 + ${revision} + MicroMigration-for-MicroStreamV5 + Provides the micro migration support for MicroStream version 5 + + + 05.00.02-MS-GA + + + + software.xdev + ${revision} + micro-migration + + + + + software.xdev + micro-migration-core + ${revision} + + + one.microstream + microstream-storage-embedded + ${microstream.version} + + + one.microstream + microstream-configuration + ${microstream.version} + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + ${java.version} + UTF-8 + false + + + + attach-javadocs + + jar + + + + + + maven-resources-plugin + 2.6 + + UTF-8 + + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + + diff --git a/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java similarity index 100% rename from core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java diff --git a/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java similarity index 100% rename from core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java diff --git a/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java similarity index 100% rename from core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java diff --git a/core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java similarity index 100% rename from core/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java diff --git a/core/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java similarity index 100% rename from core/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java new file mode 100644 index 0000000..f152f60 --- /dev/null +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides classes to use micro migration for MicroStream v5 + */ + diff --git a/core/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java similarity index 100% rename from core/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java rename to microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java diff --git a/core/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java similarity index 100% rename from core/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java rename to microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java diff --git a/core/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java similarity index 100% rename from core/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java rename to microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java diff --git a/core/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java similarity index 100% rename from core/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java rename to microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java diff --git a/core/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java similarity index 100% rename from core/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java rename to microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java diff --git a/core/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java similarity index 100% rename from core/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java rename to microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java diff --git a/pom.xml b/pom.xml index 17d64ec..e406264 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,7 @@ core reflection examples + microstream-v5 diff --git a/reflection/pom.xml b/reflection/pom.xml index 6da0283..3f0502b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -8,6 +8,10 @@ MicroMigration-Reflection Provides a migrater based on reflection + + 05.00.02-MS-GA + + software.xdev ${revision} @@ -25,6 +29,18 @@ reflections 0.10.2 + + one.microstream + microstream-storage-embedded + ${microstream.version} + test + + + one.microstream + microstream-configuration + ${microstream.version} + test + diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java index 0e730a6..cf1c283 100644 --- a/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java @@ -9,7 +9,11 @@ public class ScriptInstantiationException extends Exception { private static final long serialVersionUID = 7087560201226697433L; - + + /** + * @param message for the exception + * @param cause of the exception + */ public ScriptInstantiationException(String message, Throwable cause) { super(message, cause); } From b41994e4cba61f96c3c3150731177a2b8f73cadf Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 13 Dec 2022 11:18:19 +0100 Subject: [PATCH 078/306] Implemented migration for MicroStream v6 and v7 --- .github/workflows/release.yml | 29 +- microstream-v6/pom.xml | 143 ++++++++++ .../v5/MigrationEmbeddedStorage.java | 92 +++++++ .../v5/MigrationEmbeddedStorageManager.java | 99 +++++++ .../microstream/v5/MigrationManagerV5.java | 108 ++++++++ .../microstream/v5/MigrationScriptV5.java | 19 ++ .../v5/TunnelingEmbeddedStorageManager.java | 248 ++++++++++++++++++ .../microstream/v5/package-info.java | 4 + ...oduceMigrationOnExistingDatastoreTest.java | 43 +++ .../MigrationScriptAfterScriptTest.java | 151 +++++++++++ .../integration/MultipleScriptsTest.java | 76 ++++++ ...oreStuffInMigrationStorageManagerTest.java | 60 +++++ .../migrater/ExplicitMigraterTest.java | 76 ++++++ .../testUtil/MicroMigrationScriptDummy.java | 28 ++ microstream-v7/pom.xml | 143 ++++++++++ .../v5/MigrationEmbeddedStorage.java | 92 +++++++ .../v5/MigrationEmbeddedStorageManager.java | 99 +++++++ .../microstream/v5/MigrationManagerV5.java | 108 ++++++++ .../microstream/v5/MigrationScriptV5.java | 19 ++ .../v5/TunnelingEmbeddedStorageManager.java | 248 ++++++++++++++++++ .../microstream/v5/package-info.java | 4 + ...oduceMigrationOnExistingDatastoreTest.java | 43 +++ .../MigrationScriptAfterScriptTest.java | 151 +++++++++++ .../integration/MultipleScriptsTest.java | 76 ++++++ ...oreStuffInMigrationStorageManagerTest.java | 60 +++++ .../migrater/ExplicitMigraterTest.java | 76 ++++++ .../testUtil/MicroMigrationScriptDummy.java | 28 ++ pom.xml | 4 +- 28 files changed, 2325 insertions(+), 2 deletions(-) create mode 100644 microstream-v6/pom.xml create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java create mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java create mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java create mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java create mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java create mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java create mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java create mode 100644 microstream-v7/pom.xml create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java create mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java create mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java create mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java create mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java create mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java create mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eec56aa..aa5d661 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,4 +35,31 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl reflection -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -pl reflection -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + - name: Publish 'micro-migration-microstream-v5' + env: + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + run: mvn -B -pl microstream-v5 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + - name: Publish 'micro-migration-microstream-v6' + env: + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + run: mvn -B -pl microstream-v6 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + - name: Publish 'micro-migration-microstream-v7' + env: + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + run: mvn -B -pl microstream-v7 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml new file mode 100644 index 0000000..8214776 --- /dev/null +++ b/microstream-v6/pom.xml @@ -0,0 +1,143 @@ + + 4.0.0 + software.xdev + micro-migration-microstream-v6 + ${revision} + MicroMigration-for-MicroStreamV6 + Provides the micro migration support for MicroStream version 6 + + + 06.01.00-MS-GA + + + + software.xdev + ${revision} + micro-migration + + + + + software.xdev + micro-migration-core + ${revision} + + + one.microstream + microstream-storage-embedded + ${microstream.version} + + + one.microstream + microstream-configuration + ${microstream.version} + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + ${java.version} + UTF-8 + false + + + + attach-javadocs + + jar + + + + + + maven-resources-plugin + 2.6 + + UTF-8 + + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + + diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java new file mode 100644 index 0000000..230fba3 --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java @@ -0,0 +1,92 @@ +package software.xdev.micromigration.microstream.v5; + +import java.nio.file.Path; +import java.util.Objects; + +import software.xdev.micromigration.migrater.MicroMigrater; +import one.microstream.afs.nio.types.NioFileSystem; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.types.Storage; +import one.microstream.storage.types.StorageConfiguration; + + +/** + * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorage +{ + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) + { + Objects.requireNonNull(migrater); + return new MigrationEmbeddedStorageManager( + createStorageManager(), + migrater + ).start(); + } + + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param storageDirectory is used as the base directory for the datastore + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start( + Path storageDirectory, + MicroMigrater migrater + ) + { + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageDirectory); + + return new MigrationEmbeddedStorageManager( + createStorageManager(storageDirectory), + migrater + ).start(); + } + + private static EmbeddedStorageManager createStorageManager(Path storageDirectory) + { + NioFileSystem fileSystem = NioFileSystem.New(); + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder() + .setStorageFileProvider( + Storage.FileProviderBuilder(fileSystem) + .setDirectory(fileSystem.ensureDirectoryPath(storageDirectory.toAbsolutePath().toString())) + .createFileProvider() + ) + .createConfiguration() + ) + .createEmbeddedStorageManager(); + } + + private static EmbeddedStorageManager createStorageManager() + { + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder().createConfiguration() + ) + .createEmbeddedStorageManager(); + } +} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..1b0ad43 --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java @@ -0,0 +1,99 @@ +package software.xdev.micromigration.microstream.v5; + +import java.util.Objects; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedRoot; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager +{ + private final MicroMigrater migrater ; + private VersionedRoot versionRoot ; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * Almost all methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + * @param migrater which is used as source for the migration scripts + */ + public MigrationEmbeddedStorageManager( + EmbeddedStorageManager nativeManager, + MicroMigrater migrater + ) + { + super(nativeManager); + Objects.requireNonNull(migrater); + this.migrater = migrater; + } + + /** + * {@inheritDoc} + *

+ * Checks if the root object is of the instance of {@link Versioned}. + * If it is not, the root will be replaced with the versioned root and the actual root object + * will be put inside the versioned root. + *

+ * After starting the storage manager, all the available update scripts are executed in order + * until the newest version of the datastore is reached. + */ + @Override + public MigrationEmbeddedStorageManager start() + { + this.nativeManager.start(); + if(this.nativeManager.root() instanceof VersionedRoot) + { + this.versionRoot = (VersionedRoot)this.nativeManager.root(); + } + else + { + //Build VersionedRoot around actual root, set by user. + this.versionRoot = new VersionedRoot(this.nativeManager.root()); + nativeManager.setRoot(versionRoot); + nativeManager.storeRoot(); + } + new MigrationManagerV5( + this.versionRoot, + migrater, + this + ) + .migrate(this.versionRoot.getRoot()); + return this; + } + + public MigrationVersion getCurrentVersion() + { + return this.versionRoot.getVersion(); + } + + @Override + public Object root() { + return this.versionRoot.getRoot(); + } + + @Override + public Object setRoot(Object newRoot) { + this.versionRoot.setRoot(newRoot); + return newRoot; + } + + @Override + public long storeRoot() { + return this.nativeManager.store(this.versionRoot); + } +} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java new file mode 100644 index 0000000..502b4cf --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java @@ -0,0 +1,108 @@ +package software.xdev.micromigration.microstream.v5; + +import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import software.xdev.micromigration.MigrationManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Manages a given object and keeps the version for it. + *

+ * Can be used to keep the version of the MicroStream-Root-Object to keep the whole + * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * multiple versioned objects can be used in one datastore. + * + * @author Johannes Rabauer + * + */ +public class MigrationManagerV5 implements MigrationManager +{ + private final Supplier currentVersionGetter; + private final Consumer currentVersionSetter; + private final Consumer currentVersionStorer; + private final MicroMigrater migrater ; + private final EmbeddedStorageManager storageManager ; + + /** + * Much more complicated constructor than {@link MigrationManagerV5#MigrationManagerV5(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManagerV5 + ( + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + Objects.requireNonNull(currentVersionGetter); + Objects.requireNonNull(currentVersionSetter); + Objects.requireNonNull(currentVersionStorer); + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageManager); + this.currentVersionGetter = currentVersionGetter; + this.currentVersionSetter = currentVersionSetter; + this.currentVersionStorer = currentVersionStorer; + this.migrater = migrater; + this.storageManager = storageManager; + } + + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link MigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManagerV5 + ( + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + this( + ( ) -> versionedObject.getVersion() , + (version) -> versionedObject.setVersion(version) , + (version) -> storageManager.store(versionedObject), + migrater , + storageManager + ); + Objects.requireNonNull(versionedObject); + } + + /** + * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. + * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon + */ + public void migrate(Object objectToMigrate) + { + final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); + // Execute Updates + final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( + versionBeforeUpdate, + new TunnelingEmbeddedStorageManager(this.storageManager), + objectToMigrate + ); + //Update stored version, if needed + if(!versionAfterUpdate.equals(versionBeforeUpdate)) + { + currentVersionSetter.accept(versionAfterUpdate); + currentVersionStorer.accept(versionAfterUpdate); + } + } +} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java new file mode 100644 index 0000000..400e3a8 --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java @@ -0,0 +1,19 @@ +package software.xdev.micromigration.microstream.v5; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Interface for scripts to migrate / update datastores. + *

+ * One script is supposed to bring a datastore from a lower version to the target version. + * After the {@link MigrationScriptV5#migrate(Context)} method is called, + * the target version is reached. + * + * @author Johannes Rabauer + * + */ +public interface MigrationScriptV5 extends MigrationScript +{} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java new file mode 100644 index 0000000..4de0540 --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java @@ -0,0 +1,248 @@ +package software.xdev.micromigration.microstream.v5; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; +import one.microstream.afs.types.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; +import one.microstream.reference.Reference; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.exceptions.StorageException; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; + +import java.util.Objects; +import java.util.function.Predicate; + + +/** + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager +{ + protected final EmbeddedStorageManager nativeManager; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * All methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + */ + public TunnelingEmbeddedStorageManager( + EmbeddedStorageManager nativeManager + ) + { + Objects.requireNonNull(nativeManager); + this.nativeManager = nativeManager; + } + + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// + + @Override + public TunnelingEmbeddedStorageManager start() + { + this.nativeManager.start(); + return this; + } + + @Override + public Object root() { + return this.nativeManager.root(); + } + + @Override + public Object setRoot(Object newRoot) { + return this.nativeManager.setRoot(newRoot); + } + + @Override + public long storeRoot() { + return this.nativeManager.storeRoot(); + } + + @Override + public StorageConfiguration configuration() + { + return this.nativeManager.configuration(); + } + + @Override + public StorageTypeDictionary typeDictionary() + { + return this.nativeManager.typeDictionary(); + } + + @Override + public boolean shutdown() + { + return this.nativeManager.shutdown(); + } + + @Override + public void close() throws StorageException + { + this.nativeManager.close(); + } + + @Override + public StorageConnection createConnection() + { + return this.nativeManager.createConnection(); + } + + + @Override + public PersistenceRootsView viewRoots() + { + return this.nativeManager.viewRoots(); + } + + @Override + @Deprecated + public Reference defaultRoot() + { + return this.nativeManager.defaultRoot(); + } + + @Override + public Database database() + { + return this.nativeManager.database(); + } + + @Override + public boolean isAcceptingTasks() + { + return this.nativeManager.isAcceptingTasks(); + } + + @Override + public boolean isRunning() + { + return this.nativeManager.isRunning(); + } + + @Override + public boolean isStartingUp() + { + return this.nativeManager.isStartingUp(); + } + + @Override + public boolean isShuttingDown() + { + return this.nativeManager.isShuttingDown(); + } + + @Override + public void checkAcceptingTasks() + { + this.nativeManager.checkAcceptingTasks(); + } + + @Override + public long initializationTime() + { + return this.nativeManager.initializationTime(); + } + + @Override + public long operationModeTime() + { + return this.nativeManager.operationModeTime(); + } + + @Override + public boolean isActive() + { + return this.nativeManager.isActive(); + } + + @Override + public boolean issueGarbageCollection(long nanoTimeBudget) + { + return this.nativeManager.issueGarbageCollection(nanoTimeBudget); + } + + @Override + public boolean issueFileCheck(long nanoTimeBudget) + { + return this.nativeManager.issueFileCheck(nanoTimeBudget); + } + + @Override + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) + { + return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.nativeManager.createStorageStatistics(); + } + + @Override + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + { + this.nativeManager.exportChannels(fileProvider, performGarbageCollection); + } + + @Override + public StorageEntityTypeExportStatistics exportTypes( + StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) + { + return this.nativeManager.exportTypes(exportFileProvider, isExportType); + } + + @Override + public void importFiles(XGettingEnum importFiles) + { + this.nativeManager.importFiles(importFiles); + } + + @Override + public PersistenceManager persistenceManager() + { + return this.nativeManager.persistenceManager(); + } + + @Override + public long store(Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.nativeManager; + } + + @Override + public void issueFullBackup(StorageLiveFileProvider targetFileProvider, + PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); + } + + } diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java new file mode 100644 index 0000000..f152f60 --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides classes to use micro migration for MicroStream v5 + */ + diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java new file mode 100644 index 0000000..91f41bf --- /dev/null +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -0,0 +1,43 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +class IntroduceMigrationOnExistingDatastoreTest +{ + final static String ROOT = "OriginalRoot"; + + @Test + void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + { + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) + { + storageManager.setRoot(ROOT); + storageManager.storeRoot(); + } + + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(ROOT, migrationStorageManager.root()); + Assertions.assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); + } + } +} diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java new file mode 100644 index 0000000..f437a06 --- /dev/null +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -0,0 +1,151 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +class MigrationScriptAfterScriptTest +{ + @Test + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + { + //First run without any migration script + final ExplicitMigrater firstMigrater = new ExplicitMigrater(); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, firstMigrater)) + { + migrationStorageManager.setRoot(0); + migrationStorageManager.storeRoot(); + assertEquals(0, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); + } + + + //Run with one migration script + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + { + assertEquals(1, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); + } + + + //Run with two migration scripts + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) + { + assertEquals(2, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + final AtomicBoolean notificationReceived = new AtomicBoolean(false); + migrater.setNotificationConsumer( + notification -> + { + Assertions.assertEquals(firstScript, notification.getExecutedScript()); + Assertions.assertEquals(new MigrationVersion(0), notification.getSourceVersion()); + Assertions.assertEquals(new MigrationVersion(1), notification.getTargetVersion()); + notificationReceived.set(true); + } + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertTrue(notificationReceived.get()); + } + } + + @Test + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + { + //First run without any migration script + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + VersionedObject firstRoot = new VersionedObject<>(0); + storageManager.setRoot(firstRoot); + storageManager.storeRoot(); + assertEquals(Integer.valueOf(0), firstRoot.getObject()); + assertEquals(new MigrationVersion(0), firstRoot.getVersion()); + } + + + //Run with one migration script + final MigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getMigratingObject().setObject(1) + ); + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManagerV5( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(1), currentRoot.getObject()); + assertEquals(new MigrationVersion(1), currentRoot.getVersion()); + } + + + //Run with two migration scripts + final MigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getMigratingObject().setObject(2) + ); + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManagerV5( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript, secondScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(2), currentRoot.getObject()); + assertEquals(new MigrationVersion(2), currentRoot.getVersion()); + } + } + + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(Path storageFolder) + { + return EmbeddedStorage.start(storageFolder); + } + +} diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java new file mode 100644 index 0000000..e08c6d5 --- /dev/null +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -0,0 +1,76 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + + +class MultipleScriptsTest +{ + @Test + void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(2, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(2) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript) + ); + } + + @Test + void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(3) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript, thirdScript) + ); + } +} diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java new file mode 100644 index 0000000..424b056 --- /dev/null +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -0,0 +1,60 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + + +class StoreStuffInMigrationStorageManagerTest +{ + private static class RootClass + { + private ChildClass child = new ChildClass(); + } + + private static class ChildClass + { + private int i = 0; + } + + @Test + void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException + { + final MigrationScript script = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> {} + ); + final ExplicitMigrater migrater = new ExplicitMigrater(script); + //Create new store and change stored object + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + migrationStorageManager.setRoot(new RootClass()); + migrationStorageManager.storeRoot(); + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertEquals(0, storedRoot.child.i); + ((RootClass)migrationStorageManager.root()).child.i = 1; + migrationStorageManager.store(storedRoot.child); + assertEquals(1, storedRoot.child.i); + } + //Check if stored object is correct + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertNotNull(storedRoot); + assertEquals(1, storedRoot.child.i); + } + } + +} diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java new file mode 100644 index 0000000..808fd39 --- /dev/null +++ b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -0,0 +1,76 @@ +package software.xdev.micromigration.migrater; + + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + + +class ExplicitMigraterTest +{ + + @Test + void testGetSortedScripts_empty() + { + final ExplicitMigrater migrater = new ExplicitMigrater(); + assertEquals(0,migrater.getSortedScripts().size()); + } + + @Test + void testGetSortedScripts_sorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)), + new MicroMigrationScriptDummy(new MigrationVersion(2)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testGetSortedScripts_unsorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(2)), + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testWrongTypedVersionedScript(@TempDir Path storageFolder) + { + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(storageFolder, new ExplicitMigrater())) + { + storageManager.setRoot("SomeString"); + storageManager.storeRoot(); + } + final ExplicitMigrater migrater = new ExplicitMigrater( + new SimpleTypedMigrationScript( + new MigrationVersion(1), + (context) -> { + context.getStorageManager().setRoot(context.getMigratingObject() + 1); + } + ) + ); + Assertions.assertThrows(ClassCastException.class, () -> + { + MigrationEmbeddedStorage.start(storageFolder, migrater); + } + ); + + } + +} diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java new file mode 100644 index 0000000..cf32f3a --- /dev/null +++ b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -0,0 +1,28 @@ +package software.xdev.micromigration.testUtil; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class MicroMigrationScriptDummy implements MigrationScript +{ + private final MigrationVersion version; + + public MicroMigrationScriptDummy(MigrationVersion version) + { + this.version = version; + } + + @Override + public MigrationVersion getTargetVersion() + { + return this.version; + } + + @Override + public void migrate(Context context) { + // Don't do anything. + } +} diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml new file mode 100644 index 0000000..e9ccbca --- /dev/null +++ b/microstream-v7/pom.xml @@ -0,0 +1,143 @@ + + 4.0.0 + software.xdev + micro-migration-microstream-v7 + ${revision} + MicroMigration-for-MicroStreamV7 + Provides the micro migration support for MicroStream version 7 + + + 07.01.00-MS-GA + + + + software.xdev + ${revision} + micro-migration + + + + + software.xdev + micro-migration-core + ${revision} + + + one.microstream + microstream-storage-embedded + ${microstream.version} + + + one.microstream + microstream-configuration + ${microstream.version} + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + ${java.version} + UTF-8 + false + + + + attach-javadocs + + jar + + + + + + maven-resources-plugin + 2.6 + + UTF-8 + + + + + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + + diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java new file mode 100644 index 0000000..230fba3 --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java @@ -0,0 +1,92 @@ +package software.xdev.micromigration.microstream.v5; + +import java.nio.file.Path; +import java.util.Objects; + +import software.xdev.micromigration.migrater.MicroMigrater; +import one.microstream.afs.nio.types.NioFileSystem; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.types.Storage; +import one.microstream.storage.types.StorageConfiguration; + + +/** + * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorage +{ + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) + { + Objects.requireNonNull(migrater); + return new MigrationEmbeddedStorageManager( + createStorageManager(), + migrater + ).start(); + } + + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param storageDirectory is used as the base directory for the datastore + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start( + Path storageDirectory, + MicroMigrater migrater + ) + { + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageDirectory); + + return new MigrationEmbeddedStorageManager( + createStorageManager(storageDirectory), + migrater + ).start(); + } + + private static EmbeddedStorageManager createStorageManager(Path storageDirectory) + { + NioFileSystem fileSystem = NioFileSystem.New(); + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder() + .setStorageFileProvider( + Storage.FileProviderBuilder(fileSystem) + .setDirectory(fileSystem.ensureDirectoryPath(storageDirectory.toAbsolutePath().toString())) + .createFileProvider() + ) + .createConfiguration() + ) + .createEmbeddedStorageManager(); + } + + private static EmbeddedStorageManager createStorageManager() + { + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder().createConfiguration() + ) + .createEmbeddedStorageManager(); + } +} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..1b0ad43 --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java @@ -0,0 +1,99 @@ +package software.xdev.micromigration.microstream.v5; + +import java.util.Objects; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedRoot; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager +{ + private final MicroMigrater migrater ; + private VersionedRoot versionRoot ; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * Almost all methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + * @param migrater which is used as source for the migration scripts + */ + public MigrationEmbeddedStorageManager( + EmbeddedStorageManager nativeManager, + MicroMigrater migrater + ) + { + super(nativeManager); + Objects.requireNonNull(migrater); + this.migrater = migrater; + } + + /** + * {@inheritDoc} + *

+ * Checks if the root object is of the instance of {@link Versioned}. + * If it is not, the root will be replaced with the versioned root and the actual root object + * will be put inside the versioned root. + *

+ * After starting the storage manager, all the available update scripts are executed in order + * until the newest version of the datastore is reached. + */ + @Override + public MigrationEmbeddedStorageManager start() + { + this.nativeManager.start(); + if(this.nativeManager.root() instanceof VersionedRoot) + { + this.versionRoot = (VersionedRoot)this.nativeManager.root(); + } + else + { + //Build VersionedRoot around actual root, set by user. + this.versionRoot = new VersionedRoot(this.nativeManager.root()); + nativeManager.setRoot(versionRoot); + nativeManager.storeRoot(); + } + new MigrationManagerV5( + this.versionRoot, + migrater, + this + ) + .migrate(this.versionRoot.getRoot()); + return this; + } + + public MigrationVersion getCurrentVersion() + { + return this.versionRoot.getVersion(); + } + + @Override + public Object root() { + return this.versionRoot.getRoot(); + } + + @Override + public Object setRoot(Object newRoot) { + this.versionRoot.setRoot(newRoot); + return newRoot; + } + + @Override + public long storeRoot() { + return this.nativeManager.store(this.versionRoot); + } +} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java new file mode 100644 index 0000000..502b4cf --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java @@ -0,0 +1,108 @@ +package software.xdev.micromigration.microstream.v5; + +import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import software.xdev.micromigration.MigrationManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Manages a given object and keeps the version for it. + *

+ * Can be used to keep the version of the MicroStream-Root-Object to keep the whole + * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * multiple versioned objects can be used in one datastore. + * + * @author Johannes Rabauer + * + */ +public class MigrationManagerV5 implements MigrationManager +{ + private final Supplier currentVersionGetter; + private final Consumer currentVersionSetter; + private final Consumer currentVersionStorer; + private final MicroMigrater migrater ; + private final EmbeddedStorageManager storageManager ; + + /** + * Much more complicated constructor than {@link MigrationManagerV5#MigrationManagerV5(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManagerV5 + ( + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + Objects.requireNonNull(currentVersionGetter); + Objects.requireNonNull(currentVersionSetter); + Objects.requireNonNull(currentVersionStorer); + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageManager); + this.currentVersionGetter = currentVersionGetter; + this.currentVersionSetter = currentVersionSetter; + this.currentVersionStorer = currentVersionStorer; + this.migrater = migrater; + this.storageManager = storageManager; + } + + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link MigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link MigrationScript} + * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManagerV5 + ( + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + this( + ( ) -> versionedObject.getVersion() , + (version) -> versionedObject.setVersion(version) , + (version) -> storageManager.store(versionedObject), + migrater , + storageManager + ); + Objects.requireNonNull(versionedObject); + } + + /** + * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. + * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon + */ + public void migrate(Object objectToMigrate) + { + final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); + // Execute Updates + final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( + versionBeforeUpdate, + new TunnelingEmbeddedStorageManager(this.storageManager), + objectToMigrate + ); + //Update stored version, if needed + if(!versionAfterUpdate.equals(versionBeforeUpdate)) + { + currentVersionSetter.accept(versionAfterUpdate); + currentVersionStorer.accept(versionAfterUpdate); + } + } +} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java new file mode 100644 index 0000000..400e3a8 --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java @@ -0,0 +1,19 @@ +package software.xdev.micromigration.microstream.v5; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +/** + * Interface for scripts to migrate / update datastores. + *

+ * One script is supposed to bring a datastore from a lower version to the target version. + * After the {@link MigrationScriptV5#migrate(Context)} method is called, + * the target version is reached. + * + * @author Johannes Rabauer + * + */ +public interface MigrationScriptV5 extends MigrationScript +{} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java new file mode 100644 index 0000000..4de0540 --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java @@ -0,0 +1,248 @@ +package software.xdev.micromigration.microstream.v5; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; +import one.microstream.afs.types.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; +import one.microstream.reference.Reference; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.exceptions.StorageException; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; + +import java.util.Objects; +import java.util.function.Predicate; + + +/** + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager +{ + protected final EmbeddedStorageManager nativeManager; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * All methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + */ + public TunnelingEmbeddedStorageManager( + EmbeddedStorageManager nativeManager + ) + { + Objects.requireNonNull(nativeManager); + this.nativeManager = nativeManager; + } + + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// + + @Override + public TunnelingEmbeddedStorageManager start() + { + this.nativeManager.start(); + return this; + } + + @Override + public Object root() { + return this.nativeManager.root(); + } + + @Override + public Object setRoot(Object newRoot) { + return this.nativeManager.setRoot(newRoot); + } + + @Override + public long storeRoot() { + return this.nativeManager.storeRoot(); + } + + @Override + public StorageConfiguration configuration() + { + return this.nativeManager.configuration(); + } + + @Override + public StorageTypeDictionary typeDictionary() + { + return this.nativeManager.typeDictionary(); + } + + @Override + public boolean shutdown() + { + return this.nativeManager.shutdown(); + } + + @Override + public void close() throws StorageException + { + this.nativeManager.close(); + } + + @Override + public StorageConnection createConnection() + { + return this.nativeManager.createConnection(); + } + + + @Override + public PersistenceRootsView viewRoots() + { + return this.nativeManager.viewRoots(); + } + + @Override + @Deprecated + public Reference defaultRoot() + { + return this.nativeManager.defaultRoot(); + } + + @Override + public Database database() + { + return this.nativeManager.database(); + } + + @Override + public boolean isAcceptingTasks() + { + return this.nativeManager.isAcceptingTasks(); + } + + @Override + public boolean isRunning() + { + return this.nativeManager.isRunning(); + } + + @Override + public boolean isStartingUp() + { + return this.nativeManager.isStartingUp(); + } + + @Override + public boolean isShuttingDown() + { + return this.nativeManager.isShuttingDown(); + } + + @Override + public void checkAcceptingTasks() + { + this.nativeManager.checkAcceptingTasks(); + } + + @Override + public long initializationTime() + { + return this.nativeManager.initializationTime(); + } + + @Override + public long operationModeTime() + { + return this.nativeManager.operationModeTime(); + } + + @Override + public boolean isActive() + { + return this.nativeManager.isActive(); + } + + @Override + public boolean issueGarbageCollection(long nanoTimeBudget) + { + return this.nativeManager.issueGarbageCollection(nanoTimeBudget); + } + + @Override + public boolean issueFileCheck(long nanoTimeBudget) + { + return this.nativeManager.issueFileCheck(nanoTimeBudget); + } + + @Override + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) + { + return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.nativeManager.createStorageStatistics(); + } + + @Override + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + { + this.nativeManager.exportChannels(fileProvider, performGarbageCollection); + } + + @Override + public StorageEntityTypeExportStatistics exportTypes( + StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) + { + return this.nativeManager.exportTypes(exportFileProvider, isExportType); + } + + @Override + public void importFiles(XGettingEnum importFiles) + { + this.nativeManager.importFiles(importFiles); + } + + @Override + public PersistenceManager persistenceManager() + { + return this.nativeManager.persistenceManager(); + } + + @Override + public long store(Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.nativeManager; + } + + @Override + public void issueFullBackup(StorageLiveFileProvider targetFileProvider, + PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); + } + + } diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java new file mode 100644 index 0000000..f152f60 --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides classes to use micro migration for MicroStream v5 + */ + diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java new file mode 100644 index 0000000..91f41bf --- /dev/null +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -0,0 +1,43 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +class IntroduceMigrationOnExistingDatastoreTest +{ + final static String ROOT = "OriginalRoot"; + + @Test + void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + { + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) + { + storageManager.setRoot(ROOT); + storageManager.storeRoot(); + } + + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(ROOT, migrationStorageManager.root()); + Assertions.assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); + } + } +} diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java new file mode 100644 index 0000000..f437a06 --- /dev/null +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -0,0 +1,151 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedObject; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +class MigrationScriptAfterScriptTest +{ + @Test + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + { + //First run without any migration script + final ExplicitMigrater firstMigrater = new ExplicitMigrater(); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, firstMigrater)) + { + migrationStorageManager.setRoot(0); + migrationStorageManager.storeRoot(); + assertEquals(0, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); + } + + + //Run with one migration script + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + { + assertEquals(1, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); + } + + + //Run with two migration scripts + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) + { + assertEquals(2, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + final AtomicBoolean notificationReceived = new AtomicBoolean(false); + migrater.setNotificationConsumer( + notification -> + { + Assertions.assertEquals(firstScript, notification.getExecutedScript()); + Assertions.assertEquals(new MigrationVersion(0), notification.getSourceVersion()); + Assertions.assertEquals(new MigrationVersion(1), notification.getTargetVersion()); + notificationReceived.set(true); + } + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertTrue(notificationReceived.get()); + } + } + + @Test + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + { + //First run without any migration script + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + VersionedObject firstRoot = new VersionedObject<>(0); + storageManager.setRoot(firstRoot); + storageManager.storeRoot(); + assertEquals(Integer.valueOf(0), firstRoot.getObject()); + assertEquals(new MigrationVersion(0), firstRoot.getVersion()); + } + + + //Run with one migration script + final MigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getMigratingObject().setObject(1) + ); + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManagerV5( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(1), currentRoot.getObject()); + assertEquals(new MigrationVersion(1), currentRoot.getVersion()); + } + + + //Run with two migration scripts + final MigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getMigratingObject().setObject(2) + ); + try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManagerV5( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript, secondScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(2), currentRoot.getObject()); + assertEquals(new MigrationVersion(2), currentRoot.getVersion()); + } + } + + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(Path storageFolder) + { + return EmbeddedStorage.start(storageFolder); + } + +} diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java new file mode 100644 index 0000000..e08c6d5 --- /dev/null +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -0,0 +1,76 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + + +class MultipleScriptsTest +{ + @Test + void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(2, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(2) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript) + ); + } + + @Test + void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) + { + final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(3) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript, thirdScript) + ); + } +} diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java new file mode 100644 index 0000000..424b056 --- /dev/null +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -0,0 +1,60 @@ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + + +class StoreStuffInMigrationStorageManagerTest +{ + private static class RootClass + { + private ChildClass child = new ChildClass(); + } + + private static class ChildClass + { + private int i = 0; + } + + @Test + void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException + { + final MigrationScript script = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> {} + ); + final ExplicitMigrater migrater = new ExplicitMigrater(script); + //Create new store and change stored object + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + migrationStorageManager.setRoot(new RootClass()); + migrationStorageManager.storeRoot(); + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertEquals(0, storedRoot.child.i); + ((RootClass)migrationStorageManager.root()).child.i = 1; + migrationStorageManager.store(storedRoot.child); + assertEquals(1, storedRoot.child.i); + } + //Check if stored object is correct + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertNotNull(storedRoot); + assertEquals(1, storedRoot.child.i); + } + } + +} diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java new file mode 100644 index 0000000..808fd39 --- /dev/null +++ b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -0,0 +1,76 @@ +package software.xdev.micromigration.migrater; + + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + + +class ExplicitMigraterTest +{ + + @Test + void testGetSortedScripts_empty() + { + final ExplicitMigrater migrater = new ExplicitMigrater(); + assertEquals(0,migrater.getSortedScripts().size()); + } + + @Test + void testGetSortedScripts_sorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)), + new MicroMigrationScriptDummy(new MigrationVersion(2)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testGetSortedScripts_unsorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(2)), + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testWrongTypedVersionedScript(@TempDir Path storageFolder) + { + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(storageFolder, new ExplicitMigrater())) + { + storageManager.setRoot("SomeString"); + storageManager.storeRoot(); + } + final ExplicitMigrater migrater = new ExplicitMigrater( + new SimpleTypedMigrationScript( + new MigrationVersion(1), + (context) -> { + context.getStorageManager().setRoot(context.getMigratingObject() + 1); + } + ) + ); + Assertions.assertThrows(ClassCastException.class, () -> + { + MigrationEmbeddedStorage.start(storageFolder, migrater); + } + ); + + } + +} diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java new file mode 100644 index 0000000..cf32f3a --- /dev/null +++ b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -0,0 +1,28 @@ +package software.xdev.micromigration.testUtil; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; + + +public class MicroMigrationScriptDummy implements MigrationScript +{ + private final MigrationVersion version; + + public MicroMigrationScriptDummy(MigrationVersion version) + { + this.version = version; + } + + @Override + public MigrationVersion getTargetVersion() + { + return this.version; + } + + @Override + public void migrate(Context context) { + // Don't do anything. + } +} diff --git a/pom.xml b/pom.xml index e406264..19fac1a 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ but we are using some functionality from Java 9: https://docs.microstream.one/manual/intro/system-requirements.html --> 9 - 0.0.2 + 0.0.3 @@ -52,6 +52,8 @@ reflection examples microstream-v5 + microstream-v6 + microstream-v7 From 5bcf40d43f6b83f5c0753615878d2aab8ad0ff44 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 13 Dec 2022 16:02:05 +0100 Subject: [PATCH 079/306] Fixed Setup with multiple MicroStream versions --- examples/pom.xml | 4 ++-- .../examples/explicit/MainExplicit.java | 4 ++-- .../examples/explicit/scripts/UpdateToV1_0.java | 4 ++-- .../examples/explicit/scripts/UpdateToV1_1.java | 4 ++-- ...nPracticalWithMigrationEmbeddedStorageManager.java | 4 ++-- .../examples/practical/embedded/UpdateToV1_0.java | 4 ++-- .../examples/practical/embedded/UpdateToV2_0.java | 4 ++-- .../MainPracticalWithMigrationManager.java | 6 +++--- .../practical/migrationManager/UpdateToV1_0.java | 4 ++-- .../practical/migrationManager/UpdateToV2_0.java | 4 ++-- .../examples/reflective/MainReflective.java | 4 ++-- .../examples/reflective/scripts/UpdateToV1_0.java | 4 ++-- .../examples/reflective/scripts/UpdateToV1_1.java | 4 ++-- .../{v5 => }/MigrationEmbeddedStorage.java | 2 +- .../microstream}/MigrationEmbeddedStorageManager.java | 6 +++--- .../micromigration/microstream/MigrationManager.java | 11 +++++------ .../micromigration/microstream/MigrationScript.java | 7 +++---- .../microstream}/TunnelingEmbeddedStorageManager.java | 4 ++-- .../microstream/{v5 => }/package-info.java | 0 .../IntroduceMigrationOnExistingDatastoreTest.java | 4 ++-- .../integration/MigrationScriptAfterScriptTest.java | 10 +++++----- .../integration/MultipleScriptsTest.java | 4 ++-- .../StoreStuffInMigrationStorageManagerTest.java | 4 ++-- .../micromigration/migrater/ExplicitMigraterTest.java | 4 ++-- .../microstream}/MigrationEmbeddedStorage.java | 2 +- .../microstream}/MigrationEmbeddedStorageManager.java | 6 +++--- .../micromigration/microstream/MigrationManager.java | 11 +++++------ .../micromigration/microstream/MigrationScript.java | 7 +++---- .../microstream}/TunnelingEmbeddedStorageManager.java | 4 ++-- .../xdev/micromigration/microstream/package-info.java | 4 ++++ .../micromigration/microstream/v5/package-info.java | 4 ---- .../IntroduceMigrationOnExistingDatastoreTest.java | 4 ++-- .../integration/MigrationScriptAfterScriptTest.java | 10 +++++----- .../integration/MultipleScriptsTest.java | 4 ++-- .../StoreStuffInMigrationStorageManagerTest.java | 4 ++-- .../micromigration/migrater/ExplicitMigraterTest.java | 4 ++-- .../microstream}/MigrationEmbeddedStorage.java | 2 +- .../microstream}/MigrationEmbeddedStorageManager.java | 6 +++--- .../micromigration/microstream/MigrationManager.java | 11 +++++------ .../micromigration/microstream/MigrationScript.java | 7 +++---- .../microstream}/TunnelingEmbeddedStorageManager.java | 4 ++-- .../xdev/micromigration/microstream/package-info.java | 4 ++++ .../micromigration/microstream/v5/package-info.java | 4 ---- .../IntroduceMigrationOnExistingDatastoreTest.java | 4 ++-- .../integration/MigrationScriptAfterScriptTest.java | 10 +++++----- .../integration/MultipleScriptsTest.java | 4 ++-- .../StoreStuffInMigrationStorageManagerTest.java | 4 ++-- .../micromigration/migrater/ExplicitMigraterTest.java | 4 ++-- 48 files changed, 116 insertions(+), 122 deletions(-) rename microstream-v5/src/main/java/software/xdev/micromigration/microstream/{v5 => }/MigrationEmbeddedStorage.java (98%) rename {microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v5/src/main/java/software/xdev/micromigration/microstream}/MigrationEmbeddedStorageManager.java (94%) rename microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java => microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java (93%) rename microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java => microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java (56%) rename {microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v5/src/main/java/software/xdev/micromigration/microstream}/TunnelingEmbeddedStorageManager.java (97%) rename microstream-v5/src/main/java/software/xdev/micromigration/microstream/{v5 => }/package-info.java (100%) rename {microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v6/src/main/java/software/xdev/micromigration/microstream}/MigrationEmbeddedStorage.java (98%) rename {microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v6/src/main/java/software/xdev/micromigration/microstream}/MigrationEmbeddedStorageManager.java (94%) rename microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java => microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java (93%) rename microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java => microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java (56%) rename {microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v6/src/main/java/software/xdev/micromigration/microstream}/TunnelingEmbeddedStorageManager.java (97%) create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java rename {microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v7/src/main/java/software/xdev/micromigration/microstream}/MigrationEmbeddedStorage.java (98%) rename {microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v7/src/main/java/software/xdev/micromigration/microstream}/MigrationEmbeddedStorageManager.java (94%) rename microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java => microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java (93%) rename microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java => microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java (56%) rename {microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5 => microstream-v7/src/main/java/software/xdev/micromigration/microstream}/TunnelingEmbeddedStorageManager.java (97%) create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java delete mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java diff --git a/examples/pom.xml b/examples/pom.xml index 4a29ded..50a395c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -6,7 +6,7 @@ micro-migration-examples ${revision} MicroMigration-Examples - Examples for the MicroMigration-Library + Examples for the MicroMigration-Library with MicroStream v7 software.xdev @@ -17,7 +17,7 @@ software.xdev - micro-migration-microstream-v5 + micro-migration-microstream-v7 ${revision} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index 41320c8..ea5d079 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -2,8 +2,8 @@ import java.util.Date; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_0; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_1; import software.xdev.micromigration.migrater.ExplicitMigrater; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 39a151d..2d65e9b 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -2,13 +2,13 @@ import java.util.Date; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV1_0 implements MigrationScriptV5 +public class UpdateToV1_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index 0433b3f..78b2f15 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -2,13 +2,13 @@ import java.util.Date; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV1_1 implements MigrationScriptV5 +public class UpdateToV1_1 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index ec0ee9e..2ce7611 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -1,7 +1,7 @@ package software.xdev.micromigration.examples.practical.embedded; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.migrater.ExplicitMigrater; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index a943e5b..e3785e4 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -1,7 +1,7 @@ package software.xdev.micromigration.examples.practical.embedded; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; @@ -9,7 +9,7 @@ import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV1_0 implements MigrationScriptV5 +public class UpdateToV1_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index e3dc29e..3d7911d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -2,13 +2,13 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV2_0 implements MigrationScriptV5 +public class UpdateToV2_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index 7a34139..abd9f57 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -1,6 +1,6 @@ package software.xdev.micromigration.examples.practical.migrationManager; -import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -44,7 +44,7 @@ public static void main(String[] args) { final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); VersionedObject versionedBranch = (VersionedObject)storageManager.root(); - new MigrationManagerV5(versionedBranch, migraterWithV1, storageManager) + new MigrationManager(versionedBranch, migraterWithV1, storageManager) .migrate(versionedBranch); System.out.println(storageManager.root().toString()); } @@ -55,7 +55,7 @@ public static void main(String[] args) { final ExplicitMigrater migraterWithV2 = new ExplicitMigrater(new UpdateToV1_0(), new UpdateToV2_0()); VersionedObject versionedBranch = (VersionedObject)storageManager.root(); - new MigrationManagerV5(versionedBranch, migraterWithV2, storageManager) + new MigrationManager(versionedBranch, migraterWithV2, storageManager) .migrate(versionedBranch); System.out.println(storageManager.root().toString()); } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index f0711f1..b2e4dbf 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -3,14 +3,14 @@ import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV1_0 implements MigrationScriptV5> +public class UpdateToV1_0 implements MigrationScript> { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 8a055ae..155558b 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -2,14 +2,14 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV2_0 implements MigrationScriptV5> +public class UpdateToV2_0 implements MigrationScript> { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index 031a757..1e87e99 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -2,8 +2,8 @@ import java.util.Date; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ReflectiveMigrater; import software.xdev.micromigration.migrater.ScriptInstantiationException; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index d22c1bf..79f2caa 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -2,13 +2,13 @@ import java.util.Date; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV1_0 implements MigrationScriptV5 +public class UpdateToV1_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index 6313b72..273354f 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -2,13 +2,13 @@ import java.util.Date; -import software.xdev.micromigration.microstream.v5.MigrationScriptV5; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class UpdateToV1_1 implements MigrationScriptV5 +public class UpdateToV1_1 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java similarity index 98% rename from microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 230fba3..cc4be8f 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.nio.file.Path; import java.util.Objects; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java similarity index 94% rename from microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 1b0ad43..b73e0a9 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.util.Objects; @@ -15,7 +15,7 @@ *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * Internally uses the {@link MigrationManager} to do the actual migration. * * @author Johannes Rabauer * @@ -67,7 +67,7 @@ public MigrationEmbeddedStorageManager start() nativeManager.setRoot(versionRoot); nativeManager.storeRoot(); } - new MigrationManagerV5( + new MigrationManager( this.versionRoot, migrater, this diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java similarity index 93% rename from microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 502b4cf..11dea89 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,10 +1,9 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.util.Objects; import java.util.function.Consumer; import java.util.function.Supplier; -import software.xdev.micromigration.MigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; @@ -22,7 +21,7 @@ * @author Johannes Rabauer * */ -public class MigrationManagerV5 implements MigrationManager +public class MigrationManager implements software.xdev.micromigration.MigrationManager { private final Supplier currentVersionGetter; private final Consumer currentVersionSetter; @@ -31,7 +30,7 @@ public class MigrationManagerV5 implements MigrationManager private final EmbeddedStorageManager storageManager ; /** - * Much more complicated constructor than {@link MigrationManagerV5#MigrationManagerV5(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. * * @param currentVersionGetter which supplies the current version of the object to update. * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. @@ -39,7 +38,7 @@ public class MigrationManagerV5 implements MigrationManager * @param migrater does the actual migration with the given {@link MigrationScript} * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManagerV5 + public MigrationManager ( final Supplier currentVersionGetter, final Consumer currentVersionSetter, @@ -68,7 +67,7 @@ public class MigrationManagerV5 implements MigrationManager * @param migrater does the actual migration with the given {@link MigrationScript} * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManagerV5 + public MigrationManager ( final Versioned versionedObject, final MicroMigrater migrater , diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java similarity index 56% rename from microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 400e3a8..17f5ae7 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,7 +1,6 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -9,11 +8,11 @@ * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScriptV5#migrate(Context)} method is called, + * After the {@link MigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MigrationScriptV5 extends MigrationScript +public interface MigrationScript extends software.xdev.micromigration.scripts.MigrationScript {} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java similarity index 97% rename from microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 4de0540..9988dec 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; @@ -31,7 +31,7 @@ *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * Internally uses the {@link MigrationManager} to do the actual migration. * * @author Johannes Rabauer * diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/package-info.java similarity index 100% rename from microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java rename to microstream-v5/src/main/java/software/xdev/micromigration/microstream/package-info.java diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 91f41bf..9651585 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -5,8 +5,8 @@ import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index f437a06..7224e0a 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -7,9 +7,9 @@ import java.nio.file.Path; import java.util.concurrent.atomic.AtomicBoolean; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; @@ -110,7 +110,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManagerV5( + new MigrationManager( (Versioned) storageManager.root(), new ExplicitMigrater(firstScript), storageManager @@ -130,7 +130,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManagerV5( + new MigrationManager( (Versioned) storageManager.root(), new ExplicitMigrater(firstScript, secondScript), storageManager diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index e08c6d5..8bc4f52 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -4,8 +4,8 @@ import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; import software.xdev.micromigration.scripts.MigrationScript; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 424b056..d41bd81 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -6,8 +6,8 @@ import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 808fd39..badc98f 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -11,8 +11,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.version.MigrationVersion; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java similarity index 98% rename from microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java rename to microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 230fba3..cc4be8f 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.nio.file.Path; import java.util.Objects; diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java similarity index 94% rename from microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java rename to microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 1b0ad43..b73e0a9 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.util.Objects; @@ -15,7 +15,7 @@ *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * Internally uses the {@link MigrationManager} to do the actual migration. * * @author Johannes Rabauer * @@ -67,7 +67,7 @@ public MigrationEmbeddedStorageManager start() nativeManager.setRoot(versionRoot); nativeManager.storeRoot(); } - new MigrationManagerV5( + new MigrationManager( this.versionRoot, migrater, this diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java similarity index 93% rename from microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java rename to microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 502b4cf..11dea89 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,10 +1,9 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.util.Objects; import java.util.function.Consumer; import java.util.function.Supplier; -import software.xdev.micromigration.MigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; @@ -22,7 +21,7 @@ * @author Johannes Rabauer * */ -public class MigrationManagerV5 implements MigrationManager +public class MigrationManager implements software.xdev.micromigration.MigrationManager { private final Supplier currentVersionGetter; private final Consumer currentVersionSetter; @@ -31,7 +30,7 @@ public class MigrationManagerV5 implements MigrationManager private final EmbeddedStorageManager storageManager ; /** - * Much more complicated constructor than {@link MigrationManagerV5#MigrationManagerV5(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. * * @param currentVersionGetter which supplies the current version of the object to update. * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. @@ -39,7 +38,7 @@ public class MigrationManagerV5 implements MigrationManager * @param migrater does the actual migration with the given {@link MigrationScript} * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManagerV5 + public MigrationManager ( final Supplier currentVersionGetter, final Consumer currentVersionSetter, @@ -68,7 +67,7 @@ public class MigrationManagerV5 implements MigrationManager * @param migrater does the actual migration with the given {@link MigrationScript} * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManagerV5 + public MigrationManager ( final Versioned versionedObject, final MicroMigrater migrater , diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java similarity index 56% rename from microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java rename to microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 400e3a8..17f5ae7 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,7 +1,6 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -9,11 +8,11 @@ * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScriptV5#migrate(Context)} method is called, + * After the {@link MigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MigrationScriptV5 extends MigrationScript +public interface MigrationScript extends software.xdev.micromigration.scripts.MigrationScript {} diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java similarity index 97% rename from microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java rename to microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 4de0540..9988dec 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; @@ -31,7 +31,7 @@ *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * Internally uses the {@link MigrationManager} to do the actual migration. * * @author Johannes Rabauer * diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java new file mode 100644 index 0000000..e6ed3ba --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides classes to use micro migration for MicroStream v6 + */ + diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java deleted file mode 100644 index f152f60..0000000 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Provides classes to use micro migration for MicroStream v5 - */ - diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 91f41bf..9651585 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -5,8 +5,8 @@ import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index f437a06..7224e0a 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -7,9 +7,9 @@ import java.nio.file.Path; import java.util.concurrent.atomic.AtomicBoolean; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; @@ -110,7 +110,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManagerV5( + new MigrationManager( (Versioned) storageManager.root(), new ExplicitMigrater(firstScript), storageManager @@ -130,7 +130,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManagerV5( + new MigrationManager( (Versioned) storageManager.root(), new ExplicitMigrater(firstScript, secondScript), storageManager diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index e08c6d5..8bc4f52 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -4,8 +4,8 @@ import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; import software.xdev.micromigration.scripts.MigrationScript; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 424b056..d41bd81 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -6,8 +6,8 @@ import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 808fd39..badc98f 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -11,8 +11,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.version.MigrationVersion; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java similarity index 98% rename from microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java rename to microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 230fba3..cc4be8f 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorage.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.nio.file.Path; import java.util.Objects; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java similarity index 94% rename from microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java rename to microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 1b0ad43..b73e0a9 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.util.Objects; @@ -15,7 +15,7 @@ *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * Internally uses the {@link MigrationManager} to do the actual migration. * * @author Johannes Rabauer * @@ -67,7 +67,7 @@ public MigrationEmbeddedStorageManager start() nativeManager.setRoot(versionRoot); nativeManager.storeRoot(); } - new MigrationManagerV5( + new MigrationManager( this.versionRoot, migrater, this diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java similarity index 93% rename from microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java rename to microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 502b4cf..11dea89 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/MigrationManagerV5.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,10 +1,9 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import java.util.Objects; import java.util.function.Consumer; import java.util.function.Supplier; -import software.xdev.micromigration.MigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; @@ -22,7 +21,7 @@ * @author Johannes Rabauer * */ -public class MigrationManagerV5 implements MigrationManager +public class MigrationManager implements software.xdev.micromigration.MigrationManager { private final Supplier currentVersionGetter; private final Consumer currentVersionSetter; @@ -31,7 +30,7 @@ public class MigrationManagerV5 implements MigrationManager private final EmbeddedStorageManager storageManager ; /** - * Much more complicated constructor than {@link MigrationManagerV5#MigrationManagerV5(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. * * @param currentVersionGetter which supplies the current version of the object to update. * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. @@ -39,7 +38,7 @@ public class MigrationManagerV5 implements MigrationManager * @param migrater does the actual migration with the given {@link MigrationScript} * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManagerV5 + public MigrationManager ( final Supplier currentVersionGetter, final Consumer currentVersionSetter, @@ -68,7 +67,7 @@ public class MigrationManagerV5 implements MigrationManager * @param migrater does the actual migration with the given {@link MigrationScript} * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManagerV5 + public MigrationManager ( final Versioned versionedObject, final MicroMigrater migrater , diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java similarity index 56% rename from microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java rename to microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 400e3a8..17f5ae7 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/v5/MigrationScriptV5.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,7 +1,6 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -9,11 +8,11 @@ * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScriptV5#migrate(Context)} method is called, + * After the {@link MigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MigrationScriptV5 extends MigrationScript +public interface MigrationScript extends software.xdev.micromigration.scripts.MigrationScript {} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java similarity index 97% rename from microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java rename to microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 4de0540..9988dec 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/v5/TunnelingEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,4 +1,4 @@ -package software.xdev.micromigration.microstream.v5; +package software.xdev.micromigration.microstream; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; @@ -31,7 +31,7 @@ *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManagerV5} to do the actual migration. + * Internally uses the {@link MigrationManager} to do the actual migration. * * @author Johannes Rabauer * diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java new file mode 100644 index 0000000..0d32617 --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java @@ -0,0 +1,4 @@ +/** + * Provides classes to use micro migration for MicroStream v7 + */ + diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java deleted file mode 100644 index f152f60..0000000 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/v5/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Provides classes to use micro migration for MicroStream v5 - */ - diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 91f41bf..9651585 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -5,8 +5,8 @@ import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index f437a06..7224e0a 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -7,9 +7,9 @@ import java.nio.file.Path; import java.util.concurrent.atomic.AtomicBoolean; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.v5.MigrationManagerV5; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; @@ -110,7 +110,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManagerV5( + new MigrationManager( (Versioned) storageManager.root(), new ExplicitMigrater(firstScript), storageManager @@ -130,7 +130,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ); try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) { - new MigrationManagerV5( + new MigrationManager( (Versioned) storageManager.root(), new ExplicitMigrater(firstScript, secondScript), storageManager diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index e08c6d5..8bc4f52 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -4,8 +4,8 @@ import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; import software.xdev.micromigration.scripts.MigrationScript; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 424b056..d41bd81 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -6,8 +6,8 @@ import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 808fd39..badc98f 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -11,8 +11,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.v5.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.version.MigrationVersion; From 1dc4a7520495fb823e0f242771e37f917aff9695 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 09:28:54 +0100 Subject: [PATCH 080/306] Updated README --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5602aa6..0eeb255 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,9 @@ the version, suited to the current code. Simply add the dependency to your `pom.xml`: ``` - software.xdev - micro-migration-core - 0.0.2 + software.xdev + micro-migration-microstream-v7 + 0.0.3 ``` @@ -57,10 +57,10 @@ A simple example where scripts need to be registered in the `ExplicitMigrater`: ```java public static void main(String[] args) { - ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); - MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); - //Do some business logic - storageManager.shutdown(); + ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); + MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); + //Do some business logic + storageManager.shutdown(); } ``` @@ -110,8 +110,8 @@ A downside of this method is that you need to register all scripts (new or old) ```java final ExplicitMigrater migrater = new ExplicitMigrater( - new UpdateToV1_0(), - new UpdateToV1_1() + new UpdateToV1_0(), + new UpdateToV1_1() ); ``` @@ -129,11 +129,41 @@ Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com To use this, you need to add the following dependency to your `pom.xml`: ``` - software.xdev - micro-migration-reflection - 0.0.2 + software.xdev + micro-migration-reflection + 0.0.3 + +``` + +## Supported MicroStream versions +Micro migration currently supports the following MicroStream versions: +| MicroStream Version | Micro migration artifact Id | +| --- | --- | +| 05.00.02-MS-GA | micro-migration-microstream-v5 | +| 06.01.00-MS-GA | micro-migration-microstream-v6 | +| 07.01.00-MS-GA | micro-migration-microstream-v7 | + +If you are using a different, not listed version of MicroStream, this shouldn't be a problem. +Usually you can simply use the closest Micro migration version (f.e. you are using MicroStream `07.00.00-MS-GA`, +then use `micro-migration-microstream-v7`) and exclude the dependent version of MicroStream vom Micro migration: +``` + + software.xdev + micro-migration-microstream-v7 + 0.0.3 + + + one.microstream + microstream-storage-embedded + + + one.microstream + microstream-configuration + + ``` +Since there is rarely a breaking change, this works 90% of times. # Links - [Javadoc](https://javadoc.io/doc/software.xdev/micro-migration-core/latest/index.html) From 2c599d0229abd428cc515f6979eadf8c1fb84a13 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 09:42:20 +0100 Subject: [PATCH 081/306] First try for implementing dependabot --- .github/dependabot.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d9e20ca --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +version: 1 +updates: +- package-ecosystem: maven + directory: "/core" +- package-ecosystem: maven + directory: "/examples" +- package-ecosystem: maven + directory: "/reflection" + # Ignore the version, because it is only used for testing + ignore: + - dependency-name: "one.microstream:microstream-storage-embedded" + - dependency-name: "one.microstream:microstream-storage-configuration" +- package-ecosystem: maven + directory: "/microstream-v5" + # Ignore the version, because this is supposed to be for old MicroStream versions + ignore: + - dependency-name: "one.microstream:microstream-storage-embedded" + - dependency-name: "one.microstream:microstream-storage-configuration" +- package-ecosystem: maven + directory: "/microstream-v6" + # Ignore the version, because this is supposed to be for old MicroStream versions + ignore: + - dependency-name: "one.microstream:microstream-storage-embedded" + - dependency-name: "one.microstream:microstream-storage-configuration" \ No newline at end of file From b7e8c388293840b458f131b5895cedfcb1a94c11 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 09:46:13 +0100 Subject: [PATCH 082/306] Updated dependabot schedule --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d9e20ca..89093e8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,22 +2,32 @@ version: 1 updates: - package-ecosystem: maven directory: "/core" + schedule: + interval: "weekly" - package-ecosystem: maven directory: "/examples" + schedule: + interval: "weekly" - package-ecosystem: maven directory: "/reflection" + schedule: + interval: "weekly" # Ignore the version, because it is only used for testing ignore: - dependency-name: "one.microstream:microstream-storage-embedded" - dependency-name: "one.microstream:microstream-storage-configuration" - package-ecosystem: maven directory: "/microstream-v5" + schedule: + interval: "weekly" # Ignore the version, because this is supposed to be for old MicroStream versions ignore: - dependency-name: "one.microstream:microstream-storage-embedded" - dependency-name: "one.microstream:microstream-storage-configuration" - package-ecosystem: maven directory: "/microstream-v6" + schedule: + interval: "weekly" # Ignore the version, because this is supposed to be for old MicroStream versions ignore: - dependency-name: "one.microstream:microstream-storage-embedded" From 8b32b6881a52b65d3afe8889b667f4458921e11a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 10:58:48 +0100 Subject: [PATCH 083/306] Fixed dependabot-config-version --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 89093e8..07f9291 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,4 +1,4 @@ -version: 1 +version: 2 updates: - package-ecosystem: maven directory: "/core" From 629fc1846e26fd9b5660194c1d886599818f0ee2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:11 +0000 Subject: [PATCH 084/306] Bump maven-resources-plugin from 2.6 to 3.3.0 in /microstream-v5 Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 2.6 to 3.3.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-2.6...maven-resources-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- microstream-v5/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 95ea692..4c76be8 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -71,7 +71,7 @@ maven-resources-plugin - 2.6 + 3.3.0 UTF-8 From eb291f3f954f69e9b32000eea3f7a54a8e764b9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:12 +0000 Subject: [PATCH 085/306] Bump maven-javadoc-plugin from 3.2.0 to 3.4.1 in /core Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.2.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.2.0...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index ca8a3c6..91e51dd 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -32,7 +32,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.4.1 ${java.version} UTF-8 From 55e93c084a32f4dd8352c7b66c3c42013060638d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:12 +0000 Subject: [PATCH 086/306] Bump maven-resources-plugin from 2.6 to 3.3.0 in /microstream-v6 Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 2.6 to 3.3.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-2.6...maven-resources-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- microstream-v6/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 8214776..2771e8c 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -71,7 +71,7 @@ maven-resources-plugin - 2.6 + 3.3.0 UTF-8 From 06ec01c70cae3e37ec94e1a44afc753cd120cc7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:14 +0000 Subject: [PATCH 087/306] Bump maven-resources-plugin from 2.6 to 3.3.0 in /reflection Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 2.6 to 3.3.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-2.6...maven-resources-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- reflection/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflection/pom.xml b/reflection/pom.xml index 3f0502b..0c2ad79 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -78,7 +78,7 @@ maven-resources-plugin - 2.6 + 3.3.0 UTF-8 From 77b2e5baf1837dc4296100eca9e810adcd1a5555 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:15 +0000 Subject: [PATCH 088/306] Bump maven-resources-plugin from 2.6 to 3.3.0 in /core Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 2.6 to 3.3.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-2.6...maven-resources-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index ca8a3c6..d65d9fd 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -52,7 +52,7 @@ maven-resources-plugin - 2.6 + 3.3.0 UTF-8 From 05537014a0f022096812a07b0e792ae40dd9d06e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:16 +0000 Subject: [PATCH 089/306] Bump maven-javadoc-plugin from 3.2.0 to 3.4.1 in /microstream-v6 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.2.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.2.0...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- microstream-v6/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 8214776..35db7ff 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -54,7 +54,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.4.1 ${java.version} UTF-8 From 349e87f1d5880b7769069687f6774dadd60dca32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:16 +0000 Subject: [PATCH 090/306] Bump maven-javadoc-plugin from 3.2.0 to 3.4.1 in /microstream-v5 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.2.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.2.0...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- microstream-v5/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 95ea692..5197adb 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -54,7 +54,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.4.1 ${java.version} UTF-8 From 930c3d797607a8bf39bacdf254c66347a30c2263 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:59:17 +0000 Subject: [PATCH 091/306] Bump maven-javadoc-plugin from 3.2.0 to 3.4.1 in /reflection Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.2.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.2.0...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- reflection/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflection/pom.xml b/reflection/pom.xml index 3f0502b..b73ab84 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -61,7 +61,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.4.1 ${java.version} UTF-8 From 50e27a5821df441207d98ba1c6b9422755b54b6d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 11:04:33 +0100 Subject: [PATCH 092/306] Added microstream-v7 to dependabot --- .github/dependabot.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 07f9291..9c7f53a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -31,4 +31,8 @@ updates: # Ignore the version, because this is supposed to be for old MicroStream versions ignore: - dependency-name: "one.microstream:microstream-storage-embedded" - - dependency-name: "one.microstream:microstream-storage-configuration" \ No newline at end of file + - dependency-name: "one.microstream:microstream-storage-configuration" +- package-ecosystem: maven + directory: "/microstream-v7" + schedule: + interval: "weekly" \ No newline at end of file From 1aa82ce00dd5cfe0b24a2f3db30d0bed8c71b67e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:05:38 +0000 Subject: [PATCH 093/306] Bump maven-resources-plugin from 2.6 to 3.3.0 in /microstream-v7 Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 2.6 to 3.3.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-2.6...maven-resources-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- microstream-v7/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index e9ccbca..2160684 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -71,7 +71,7 @@ maven-resources-plugin - 2.6 + 3.3.0 UTF-8 From 553ccb9dba7790d4d96e0860fc195473034da79b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:05:42 +0000 Subject: [PATCH 094/306] Bump maven-javadoc-plugin from 3.2.0 to 3.4.1 in /microstream-v7 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.2.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.2.0...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- microstream-v7/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index e9ccbca..d8e1691 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -54,7 +54,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.4.1 ${java.version} UTF-8 From c32d50111ffb421403a0a43589b6910d02f95319 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 11:20:51 +0100 Subject: [PATCH 095/306] Updated Readme --- README.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0eeb255..0c5cc98 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ the version, suited to the current code. ### Maven Simply add the dependency to your `pom.xml`: -``` +```xml software.xdev micro-migration-microstream-v7 @@ -55,8 +55,7 @@ Extensive examples can be found in its own [own module](https://github.com/xdev- A simple example where scripts need to be registered in the `ExplicitMigrater`: ```java -public static void main(String[] args) -{ +public static void main(String[] args){ ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); //Do some business logic @@ -75,8 +74,7 @@ public class UpdateToV1_0 implements MigrationScript } @Override - public void migrate(Context context) - { + public void migrate(Context context){ //Logic of the update context.getStorageManager().setRoot("Update 1.0"); } @@ -91,8 +89,7 @@ That's why a second approach can be used, where the `MigrationManager` is used. the `MigrationEmbeddedStorageManager`. ```java -public static void main(String[] args) -{ +public static void main(String[] args){ ExplicitMigrater migrater = new ExplicitMigrater(new UpdateToV1_0()); EmbeddedStorageManager storageManager = EmbeddedStorage.start(); VersionedObject versionedRoot =(VersionedObject)storageManager.root(); @@ -127,7 +124,7 @@ final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.microm Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own module](https://github.com/xdev-software/micro-migration/tree/main/reflection). To use this, you need to add the following dependency to your `pom.xml`: -``` +```xml software.xdev micro-migration-reflection @@ -146,7 +143,7 @@ Micro migration currently supports the following MicroStream versions: If you are using a different, not listed version of MicroStream, this shouldn't be a problem. Usually you can simply use the closest Micro migration version (f.e. you are using MicroStream `07.00.00-MS-GA`, then use `micro-migration-microstream-v7`) and exclude the dependent version of MicroStream vom Micro migration: -``` +```xml software.xdev micro-migration-microstream-v7 From 2d991a0bc3e465dd8402de2731443ec5e4b2727b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 11:51:02 +0100 Subject: [PATCH 096/306] Fixed missing JavaDoc --- .../java/software/xdev/micromigration/MigrationManager.java | 4 ++-- .../microstream/MigrationEmbeddedStorageManager.java | 5 ++++- .../microstream/TunnelingEmbeddedStorageManager.java | 6 ++++-- .../microstream/MigrationEmbeddedStorageManager.java | 5 ++++- .../microstream/TunnelingEmbeddedStorageManager.java | 3 +++ .../microstream/MigrationEmbeddedStorageManager.java | 5 ++++- .../microstream/TunnelingEmbeddedStorageManager.java | 3 +++ 7 files changed, 24 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/software/xdev/micromigration/MigrationManager.java b/core/src/main/java/software/xdev/micromigration/MigrationManager.java index 4f1ac22..380faf9 100644 --- a/core/src/main/java/software/xdev/micromigration/MigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/MigrationManager.java @@ -13,8 +13,8 @@ public interface MigrationManager { /** - * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. - * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon + * Migrates the given object to the newest possible version, defined by the {@link software.xdev.micromigration.migrater.MicroMigrater}. + * @param objectToMigrate is given to the {@link software.xdev.micromigration.migrater.MicroMigrater} for migrating upon */ public void migrate(Object objectToMigrate); } diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index b73e0a9..0ca5cd6 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -75,7 +75,10 @@ public MigrationEmbeddedStorageManager start() .migrate(this.versionRoot.getRoot()); return this; } - + + /** + * @return current version that's managed + */ public MigrationVersion getCurrentVersion() { return this.versionRoot.getVersion(); diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 9988dec..81505d8 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -38,6 +38,9 @@ */ public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager { + /** + * The underlying, actual MicroStream EmbeddedStorageManager + */ protected final EmbeddedStorageManager nativeManager; /** @@ -244,5 +247,4 @@ public void issueFullBackup(StorageLiveFileProvider targetFileProvider, PersistenceTypeDictionaryExporter typeDictionaryExporter) { this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); } - - } +} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index b73e0a9..0ca5cd6 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -75,7 +75,10 @@ public MigrationEmbeddedStorageManager start() .migrate(this.versionRoot.getRoot()); return this; } - + + /** + * @return current version that's managed + */ public MigrationVersion getCurrentVersion() { return this.versionRoot.getVersion(); diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 9988dec..da48bc8 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -38,6 +38,9 @@ */ public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager { + /** + * The underlying, actual MicroStream EmbeddedStorageManager + */ protected final EmbeddedStorageManager nativeManager; /** diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index b73e0a9..0ca5cd6 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -75,7 +75,10 @@ public MigrationEmbeddedStorageManager start() .migrate(this.versionRoot.getRoot()); return this; } - + + /** + * @return current version that's managed + */ public MigrationVersion getCurrentVersion() { return this.versionRoot.getVersion(); diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 9988dec..da48bc8 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -38,6 +38,9 @@ */ public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager { + /** + * The underlying, actual MicroStream EmbeddedStorageManager + */ protected final EmbeddedStorageManager nativeManager; /** From 928688536473c5e8344a39063e90b6a13b556969 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 13:07:40 +0100 Subject: [PATCH 097/306] Cleaned up poms --- core/pom.xml | 79 +----------------------------------------- microstream-v5/pom.xml | 76 +--------------------------------------- microstream-v7/pom.xml | 76 +--------------------------------------- pom.xml | 75 +++++++++++++++++++++++++++++++++++++++ reflection/pom.xml | 76 +--------------------------------------- 5 files changed, 79 insertions(+), 303 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8bc2bd6..cfae503 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -19,43 +19,14 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 - - ${java.version} - UTF-8 - false - - -Xdoclint:none - -Xdoclint:none - - - - attach-javadocs - - jar - - - + org.apache.maven.plugins maven-resources-plugin - 3.3.0 - - UTF-8 - @@ -65,57 +36,9 @@ release - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - org.jreleaser jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 31387d7..0f819c5 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -41,40 +41,14 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 - - ${java.version} - UTF-8 - false - - - - attach-javadocs - - jar - - - + org.apache.maven.plugins maven-resources-plugin - 3.3.0 - - UTF-8 - @@ -84,57 +58,9 @@ release - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - org.jreleaser jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 75bcd21..b9343b5 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -41,40 +41,14 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 - - ${java.version} - UTF-8 - false - - - - attach-javadocs - - jar - - - + org.apache.maven.plugins maven-resources-plugin - 3.3.0 - - UTF-8 - @@ -84,57 +58,9 @@ release - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - org.jreleaser jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - diff --git a/pom.xml b/pom.xml index 19fac1a..cae7049 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,81 @@ + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.0 + + UTF-8 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.1 + + ${java.version} + UTF-8 + false + + -Xdoclint:none + -Xdoclint:none + + + + attach-javadoc + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.1 + + + attach-source + + jar + + + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local; + false + false + target/staging-deploy + + + + + + + + + + + org.apache.maven.plugins diff --git a/reflection/pom.xml b/reflection/pom.xml index daacddc..973eb0c 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -48,40 +48,14 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 - - ${java.version} - UTF-8 - false - - - - attach-javadocs - - jar - - - + org.apache.maven.plugins maven-resources-plugin - 3.3.0 - - UTF-8 - @@ -91,57 +65,9 @@ release - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - org.jreleaser jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - From 441394c626e9ccfa885ecd2c01146a0f50307b98 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 13:11:46 +0100 Subject: [PATCH 098/306] Fixed JavaDoc --- .../xdev/micromigration/migrater/AbstractMigrater.java | 2 +- pom.xml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 6e4fa6d..384aa04 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -108,7 +108,7 @@ private MigrationVersion migrateWithScript( /** * Checks if the given {@link MigrationScript} is not already registered in the * {@link #getSortedScripts()}. - * @throws {@link VersionAlreadyRegisteredException} if script is already registered. + * @throws VersionAlreadyRegisteredException if script is already registered. * @param scriptToCheck It's target version is checked, if it is not already registered. */ protected void checkIfVersionIsAlreadyRegistered(MigrationScript scriptToCheck) diff --git a/pom.xml b/pom.xml index cae7049..19c83c0 100644 --- a/pom.xml +++ b/pom.xml @@ -91,9 +91,6 @@ ${java.version} UTF-8 false - - -Xdoclint:none - -Xdoclint:none From d48db769619afae7df9e07716e14ba60ff8ec9ae Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 13:13:03 +0100 Subject: [PATCH 099/306] Fixed Check Build-Workflow for new develop branch --- .github/workflows/checkBuild.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index cc3f7b6..05e0b46 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -3,13 +3,17 @@ name: Check Build on: workflow_dispatch: push: - branches: [ main ] + branches: [ develop ] paths-ignore: - '**.md' pull_request: branches: [ main ] paths-ignore: - '**.md' + pull_request: + branches: [ develop ] + paths-ignore: + - '**.md' jobs: build: From 8bd7a410947d445e1ff4dc709f2009abec7f5625 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 13:14:30 +0100 Subject: [PATCH 100/306] Fixed Check Build-Workflow for new develop branch --- .github/workflows/checkBuild.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 05e0b46..719fddb 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -7,11 +7,7 @@ on: paths-ignore: - '**.md' pull_request: - branches: [ main ] - paths-ignore: - - '**.md' - pull_request: - branches: [ develop ] + branches: [ main, develop ] paths-ignore: - '**.md' From 8257349f7d178fe423fff16a29265f77e04c75cc Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 14:57:33 +0100 Subject: [PATCH 101/306] Expanded JavaDoc --- .../xdev/micromigration/MigrationManager.java | 2 +- ...VersionAgnosticEmbeddedStorageManager.java | 25 +++++++++-- .../migrater/AbstractMigrater.java | 6 +++ .../migrater/ExplicitMigrater.java | 2 +- .../migrater/MicroMigrater.java | 6 +-- .../VersionAlreadyRegisteredException.java | 42 ++++++++++++++++--- .../ScriptExecutionNotification.java | 35 ++++++++++++---- .../xdev/micromigration/scripts/Context.java | 8 +++- .../scripts/MigrationScript.java | 18 ++++---- .../scripts/SimpleMigrationScript.java | 8 +++- .../version/MigrationVersion.java | 25 +++++++---- .../micromigration/version/Versioned.java | 12 +++++- .../version/VersionedObject.java | 15 +++++-- .../micromigration/version/VersionedRoot.java | 15 +++++-- ...oreStuffInMigrationStorageManagerTest.java | 2 +- ...oreStuffInMigrationStorageManagerTest.java | 2 +- ...oreStuffInMigrationStorageManagerTest.java | 2 +- 17 files changed, 172 insertions(+), 53 deletions(-) diff --git a/core/src/main/java/software/xdev/micromigration/MigrationManager.java b/core/src/main/java/software/xdev/micromigration/MigrationManager.java index 380faf9..06ab6b0 100644 --- a/core/src/main/java/software/xdev/micromigration/MigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/MigrationManager.java @@ -16,5 +16,5 @@ public interface MigrationManager * Migrates the given object to the newest possible version, defined by the {@link software.xdev.micromigration.migrater.MicroMigrater}. * @param objectToMigrate is given to the {@link software.xdev.micromigration.migrater.MicroMigrater} for migrating upon */ - public void migrate(Object objectToMigrate); + void migrate(Object objectToMigrate); } diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java index 4d683f4..2ab88a6 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java @@ -1,6 +1,25 @@ package software.xdev.micromigration.microstream.versionagnostic; -public interface VersionAgnosticEmbeddedStorageManager { - public long store(final Object instance); - public T getNativeStorageManager(); +/** + * To keep MicroStream from being directly referenced, this is a abstraction to keep the + * actual EmbeddedStorageManager concealed. + * + * @param is usually the one.microstream.storage.embedded.types.EmbeddedStorageManager, + * but to keep it version agnostic, this is dynamically typed. + * + * @author Johannes Rabauer + */ +public interface VersionAgnosticEmbeddedStorageManager +{ + /** + * Stores the given object instance + * @param instance to store + * @return the object id representing the passed instance + */ + long store(final Object instance); + + /** + * @return the actual EmbeddedStorageManager + */ + T getNativeStorageManager(); } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 384aa04..bc02bb8 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -12,6 +12,12 @@ import software.xdev.micromigration.version.MigrationVersion; +/** + * Provides the basic functionality to apply {@link MigrationScript}s to + * a datastore. + * + * @author Johannes Rabauer + */ public abstract class AbstractMigrater implements MicroMigrater { private Consumer notificationConsumer = null; diff --git a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java index a2220cf..17a6416 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java @@ -19,7 +19,7 @@ public class ExplicitMigrater extends AbstractMigrater /** * @param scripts are all the scripts that are executed, if the current version is lower than this of the script
* Versions of the scripts must be unique. That means that no version is allowed multiple times in the migrater. - * @throws VersionAlreadyRegisteredException + * @throws VersionAlreadyRegisteredException if two scripts have the same version */ public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRegisteredException { diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index 6691a32..466d989 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -19,7 +19,7 @@ public interface MicroMigrater /** * @return all the contained {@link MigrationScript}s, sorted by their {@link MigrationVersion} ascending. */ - public TreeSet> getSortedScripts(); + TreeSet> getSortedScripts(); /** * Executes all the scripts that are available to the migrater. @@ -42,7 +42,7 @@ public interface MicroMigrater * * @return the target version of the last executed script */ - public MigrationVersion migrateToNewest( + MigrationVersion migrateToNewest( MigrationVersion fromVersion , VersionAgnosticEmbeddedStorageManager storageManager, Object root @@ -72,7 +72,7 @@ public MigrationVersion migrateToNewest( * * @return the target version of the last executed script */ - public MigrationVersion migrateToVersion + MigrationVersion migrateToVersion ( MigrationVersion fromVersion , MigrationVersion targetVersion , diff --git a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java index 6ce95ba..108ec97 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -6,16 +6,36 @@ import software.xdev.micromigration.scripts.MigrationScript; +/** + * Exception that should be used if two scripts with the same version exist. + * @author Johannes Rabauer + */ public class VersionAlreadyRegisteredException extends Error { private static final long serialVersionUID = 2153008832167067975L; - - private MigrationVersion alreadyRegisteredVersion; - private MigrationScript alreadyRegisteredScript ; - private MigrationScript newScriptToRegister ; - + + /** + * The already registered script with the same version + */ + private final MigrationVersion alreadyRegisteredVersion; + /** + * The version of the already registered script + */ + private final MigrationScript alreadyRegisteredScript ; + /** + * The script with the same version as {@link #alreadyRegisteredScript}, + * which should be registered as well + */ + private final MigrationScript newScriptToRegister ; + + /** + * @param alreadyRegisteredVersion The version of the already registered script + * @param alreadyRegisteredScript The already registered script with the same version + * @param newScriptToRegister The script with the same version as alreadyRegisteredScript, + * which should be registered as well + */ public VersionAlreadyRegisteredException( - MigrationVersion alreadyRegisteredVersion, + MigrationVersion alreadyRegisteredVersion, MigrationScript alreadyRegisteredScript , MigrationScript newScriptToRegister ) @@ -26,16 +46,26 @@ public VersionAlreadyRegisteredException( this.newScriptToRegister = Objects.requireNonNull(newScriptToRegister) ; } + /** + * @return the version of the already registered script + */ public MigrationVersion getAlreadyRegisteredVersion() { return alreadyRegisteredVersion; } + /** + * @return the already registered script with the same version + */ public MigrationScript getAlreadyRegisteredScript() { return alreadyRegisteredScript; } + /** + * @return the script with the same version as {@link #getAlreadyRegisteredScript()}, + * which should be registered as well + */ public MigrationScript getNewScriptToRegister() { return newScriptToRegister; diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java index 6fa1c05..beaa653 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java @@ -10,16 +10,22 @@ * Contains data about the execution of a script by a {@link MicroMigrater}. * * @author Johannes Rabauer - * */ public class ScriptExecutionNotification { - private MigrationScript executedScript; - private MigrationVersion sourceVersion ; - private MigrationVersion targetVersion ; - private LocalDateTime startDate ; - private LocalDateTime endDate ; - + private final MigrationScript executedScript; + private final MigrationVersion sourceVersion ; + private final MigrationVersion targetVersion ; + private final LocalDateTime startDate ; + private final LocalDateTime endDate ; + + /** + * @param executedScript script that was executed + * @param sourceVersion original version of the object before executing the script + * @param targetVersion version of the object after executing the script + * @param startDate time when the script was started + * @param endDate time when the script has finished + */ public ScriptExecutionNotification( MigrationScript executedScript, MigrationVersion sourceVersion , @@ -36,26 +42,41 @@ public ScriptExecutionNotification( this.endDate = endDate ; } + /** + * @return the script that was executed + */ public MigrationScript getExecutedScript() { return executedScript; } + /** + * @return the original version of the object before executing the script + */ public MigrationVersion getSourceVersion() { return sourceVersion; } + /** + * @return the version of the object after executing the script + */ public MigrationVersion getTargetVersion() { return targetVersion; } + /** + * @return the time when the script was started + */ public LocalDateTime getStartDate() { return startDate; } + /** + * @return time when the script has finished + */ public LocalDateTime getEndDate() { return endDate; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/Context.java b/core/src/main/java/software/xdev/micromigration/scripts/Context.java index 19ff732..8cc87aa 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/Context.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/Context.java @@ -12,9 +12,13 @@ public class Context { private final T migratingObject; private final E storageManager ; - + + /** + * @param migratingObject that must be migrated to a new version + * @param storageManager where the migratingObject is stored + */ public Context( - final T migratingObject, + final T migratingObject, final VersionAgnosticEmbeddedStorageManager storageManager ) { diff --git a/core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java index 4f5794b..2ec732d 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java @@ -20,7 +20,7 @@ public interface MigrationScript /** * @return the version of the datastore after this script is executed. */ - public MigrationVersion getTargetVersion(); + MigrationVersion getTargetVersion(); /** * Execute logic to migrate the given datastore to a newer version of the store. @@ -28,13 +28,11 @@ public interface MigrationScript * * @param context that holds necessary data for the migration */ - public void migrate(Context context); - - public static Comparator> COMPARATOR = new Comparator>() - { - @Override - public int compare(MigrationScript o1, MigrationScript o2) { - return MigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); - } - }; + void migrate(Context context); + + /** + * Provides a {@link Comparator} that compares the {@link #getTargetVersion()} of the given scripts + */ + Comparator> COMPARATOR = + (o1, o2) -> MigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); } diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java index 8cccc24..2cf9714 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java @@ -14,11 +14,15 @@ */ public class SimpleMigrationScript extends SimpleTypedMigrationScript { + /** + * @param targetVersion to which the script is updating the object + * @param consumer which consumes the object and updates it to the target version + */ public SimpleMigrationScript( - final MigrationVersion version , + final MigrationVersion targetVersion , final Consumer> consumer ) { - super(version, consumer); + super(targetVersion, consumer); } } diff --git a/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java b/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java index 3005b35..a6389ad 100644 --- a/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java +++ b/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java @@ -13,7 +13,10 @@ public class MigrationVersion { private final int[] versions; - + + /** + * @param versions as integers. For example 1.0.2 would be an array of [1,0,2] + */ public MigrationVersion(int... versions) { if(versions == null || versions.length == 0) @@ -24,8 +27,11 @@ public MigrationVersion(int... versions) { this.versions = versions; } - } - + } + + /** + * @param versionsAsList as integers. For example 1.0.2 would be a list of [1,0,2] + */ public MigrationVersion(List versionsAsList) { if(versionsAsList == null || versionsAsList.size() == 0) @@ -43,6 +49,9 @@ public MigrationVersion(List versionsAsList) } } + /** + * @return versions as an array of integers. For example 1.0.2 would be an array of [1,0,2] + */ public int[] getVersions() { return this.versions; @@ -79,10 +88,12 @@ public boolean equals(Object obj) if (getClass() != obj.getClass()) return false; MigrationVersion other = (MigrationVersion) obj; - if (!Arrays.equals(versions, other.versions)) - return false; - return true; + return Arrays.equals(versions, other.versions); } - public static Comparator COMPARATOR = Comparator.comparing(MigrationVersion::getVersions, (o1, o2) -> Arrays.compare(o1,o2)); + /** + * Provides a {@link Comparator} that compares the {@link #getVersions()} of the given versions + */ + public static Comparator COMPARATOR = + Comparator.comparing(MigrationVersion::getVersions, (o1, o2) -> Arrays.compare(o1,o2)); } diff --git a/core/src/main/java/software/xdev/micromigration/version/Versioned.java b/core/src/main/java/software/xdev/micromigration/version/Versioned.java index 62349bd..fa098ce 100644 --- a/core/src/main/java/software/xdev/micromigration/version/Versioned.java +++ b/core/src/main/java/software/xdev/micromigration/version/Versioned.java @@ -8,6 +8,14 @@ */ public interface Versioned { - public void setVersion(MigrationVersion version); - public MigrationVersion getVersion(); + /** + * @param version to set the current version of the object + */ + void setVersion(MigrationVersion version); + + /** + * + * @return the current version of the object + */ + MigrationVersion getVersion(); } diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java b/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java index d2594dc..777ac01 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java @@ -14,7 +14,10 @@ public class VersionedObject implements Versioned { private MigrationVersion currentVersion; private T actualObject ; - + + /** + * @param actualObject set the actual object which is versioned + */ public VersionedObject(T actualObject) { this.actualObject = actualObject ; @@ -33,12 +36,18 @@ public MigrationVersion getVersion() { return this.currentVersion; } - + + /** + * @param actualObject which is versioned + */ public void setObject(T actualObject) { this.actualObject = actualObject; } - + + /** + * @return the actual object which is versioned + */ public T getObject() { return this.actualObject; diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java index 01162fe..a0eee3f 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java @@ -13,7 +13,10 @@ public class VersionedRoot implements Versioned { private MigrationVersion currentVersion; private Object actualRoot ; - + + /** + * @param actualRoot which is stored in the datastore and defined by the user + */ public VersionedRoot(Object actualRoot) { this.actualRoot = actualRoot ; @@ -32,12 +35,18 @@ public MigrationVersion getVersion() { return this.currentVersion; } - + + /** + * @param actualRoot which is stored in the datastore and defined by the user + */ public void setRoot(Object actualRoot) { this.actualRoot = actualRoot; } - + + /** + * @return the actual root, that's defined by the user + */ public Object getRoot() { return this.actualRoot; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index d41bd81..51b1ccc 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -21,7 +21,7 @@ class StoreStuffInMigrationStorageManagerTest { private static class RootClass { - private ChildClass child = new ChildClass(); + private final ChildClass child = new ChildClass(); } private static class ChildClass diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index d41bd81..51b1ccc 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -21,7 +21,7 @@ class StoreStuffInMigrationStorageManagerTest { private static class RootClass { - private ChildClass child = new ChildClass(); + private final ChildClass child = new ChildClass(); } private static class ChildClass diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index d41bd81..51b1ccc 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -21,7 +21,7 @@ class StoreStuffInMigrationStorageManagerTest { private static class RootClass { - private ChildClass child = new ChildClass(); + private final ChildClass child = new ChildClass(); } private static class ChildClass From c4d6cacad14baf3df2e4925f33c48365550966c5 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 15:00:59 +0100 Subject: [PATCH 102/306] Added Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2594e8..77174b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,6 @@ +## 0.0.3 +* Restructured the complete maven modules. Multiple MicroStream-Versions are now supported. +* Added plenty of documentation + ## 0.0.2 * Updated MicroStream from v4 to v5. \ No newline at end of file From 9d5abc62edbbe217c25c3af47074c84053a51f4d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 14 Dec 2022 15:28:27 +0100 Subject: [PATCH 103/306] Extended Check Build for dry run release --- .github/workflows/checkBuild.yml | 26 +++++++++++++++++++++++++- core/pom.xml | 2 +- pom.xml | 22 ++-------------------- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 719fddb..8303309 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -56,4 +56,28 @@ jobs: - uses: actions/upload-artifact@v3 with: name: jars-java-${{ matrix.java }} - path: target/*.jar \ No newline at end of file + path: target/*.jar + + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Build project + run: mvn -B -Prelease clean install + - name: Publish 'core' + env: + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file diff --git a/core/pom.xml b/core/pom.xml index cfae503..5c341ef 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -10,8 +10,8 @@ software.xdev - ${revision} micro-migration + ${revision} diff --git a/pom.xml b/pom.xml index 19c83c0..984f845 100644 --- a/pom.xml +++ b/pom.xml @@ -60,13 +60,13 @@ org.junit.jupiter junit-jupiter-api - 5.6.2 + 5.9.0 test org.junit.jupiter junit-jupiter-engine - 5.6.2 + 5.9.0 test @@ -175,28 +175,10 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - aggregate - - - org.apache.maven.plugins maven-source-plugin - 3.2.1 - - - attach-source - - aggregate - - - From 2f5365364a67985e26326b36c149fd5deaa9dae6 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 07:22:49 +0100 Subject: [PATCH 104/306] Updated pom.xml --- pom.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pom.xml b/pom.xml index 984f845..0f136be 100644 --- a/pom.xml +++ b/pom.xml @@ -175,10 +175,26 @@ org.apache.maven.plugins maven-javadoc-plugin + + + attach-javadoc + + aggregate + + + org.apache.maven.plugins maven-source-plugin + + + attach-source + + aggregate + + + From 9a84296e2368489a98bcd5d47898a120949ede1d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 07:25:57 +0100 Subject: [PATCH 105/306] Update pom.xml --- pom.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pom.xml b/pom.xml index 0f136be..8a6dccf 100644 --- a/pom.xml +++ b/pom.xml @@ -172,18 +172,6 @@ release - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadoc - - aggregate - - - - org.apache.maven.plugins maven-source-plugin From ba381929d017ef635f9535a2394039136d4038ff Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 07:28:04 +0100 Subject: [PATCH 106/306] Update pom.xml --- pom.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pom.xml b/pom.xml index 8a6dccf..43266f0 100644 --- a/pom.xml +++ b/pom.xml @@ -172,6 +172,18 @@ release + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadoc + + jar + + + + org.apache.maven.plugins maven-source-plugin From 10cf62a0e15b220f7d859fa620d5ae0dffe40a59 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 07:56:39 +0100 Subject: [PATCH 107/306] Update pom.xml --- pom.xml | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/pom.xml b/pom.xml index 43266f0..4a8d667 100644 --- a/pom.xml +++ b/pom.xml @@ -166,38 +166,4 @@ - - - - release - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-source - - aggregate - - - - - - - - From 194b2ca5d3175119e4186861da5a704442a7d4ef Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 07:59:59 +0100 Subject: [PATCH 108/306] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 8303309..8f9cb49 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -80,4 +80,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -pl microstream-v7 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From 7f04a13faf97e81d03dd549ecac10d3fda4f0c81 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 08:01:37 +0100 Subject: [PATCH 109/306] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 8f9cb49..534aec3 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -80,4 +80,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl microstream-v7 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From 87119cd3d50304f77b8460f92e4863a9ced7d6df Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 09:38:56 +0100 Subject: [PATCH 110/306] Updated super pom for release --- .../microstream/MigrationEmbeddedStorage.java | 5 +- .../MigrationEmbeddedStorageManager.java | 10 ++-- .../microstream/MigrationManager.java | 2 +- .../microstream/MigrationScript.java | 2 +- .../TunnelingEmbeddedStorageManager.java | 2 +- .../microstream/MigrationEmbeddedStorage.java | 8 +-- .../MigrationEmbeddedStorageManager.java | 10 ++-- .../microstream/MigrationManager.java | 2 +- .../microstream/MigrationScript.java | 2 +- .../TunnelingEmbeddedStorageManager.java | 6 +-- .../microstream/MigrationEmbeddedStorage.java | 8 +-- .../MigrationEmbeddedStorageManager.java | 6 +-- .../microstream/MigrationManager.java | 2 +- .../microstream/MigrationScript.java | 2 +- .../TunnelingEmbeddedStorageManager.java | 6 +-- pom.xml | 50 +++++++++++++++++-- 16 files changed, 83 insertions(+), 40 deletions(-) diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index cc4be8f..946ebe5 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -5,7 +5,6 @@ import software.xdev.micromigration.migrater.MicroMigrater; import one.microstream.afs.nio.types.NioFileSystem; -import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import one.microstream.storage.types.Storage; @@ -13,8 +12,8 @@ /** - * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for - * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. + * Provides static utility calls to create the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. * * @author Johannes Rabauer * diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 0ca5cd6..b358b83 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -11,14 +11,14 @@ /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link Versioned} + * Basically it intercepts storing the root object and places a {@link software.xdev.micromigration.version.Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. - * + * Internally uses the {@link software.xdev.micromigration.microstream.MigrationManager} to do the actual migration. + * * @author Johannes Rabauer - * + * */ public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager { diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 11dea89..3a9ed59 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -15,7 +15,7 @@ * Manages a given object and keeps the version for it. *

* Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * datastore versioned. Since it is not integrated like the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} * multiple versioned objects can be used in one datastore. * * @author Johannes Rabauer diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 17f5ae7..48df48b 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -8,7 +8,7 @@ * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScript#migrate(Context)} method is called, + * After the {@link software.xdev.micromigration.scripts.MigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 81505d8..153f7b9 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -27,7 +27,7 @@ /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index cc4be8f..a6676ef 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -13,11 +13,11 @@ /** - * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for - * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. - * + * Provides static utility calls to create the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. + * * @author Johannes Rabauer - * + * */ public class MigrationEmbeddedStorage { diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 0ca5cd6..b358b83 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -11,14 +11,14 @@ /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link Versioned} + * Basically it intercepts storing the root object and places a {@link software.xdev.micromigration.version.Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. - * + * Internally uses the {@link software.xdev.micromigration.microstream.MigrationManager} to do the actual migration. + * * @author Johannes Rabauer - * + * */ public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager { diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 11dea89..3a9ed59 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -15,7 +15,7 @@ * Manages a given object and keeps the version for it. *

* Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * datastore versioned. Since it is not integrated like the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} * multiple versioned objects can be used in one datastore. * * @author Johannes Rabauer diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 17f5ae7..48df48b 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -8,7 +8,7 @@ * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScript#migrate(Context)} method is called, + * After the {@link software.xdev.micromigration.scripts.MigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index da48bc8..028ce0a 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -27,14 +27,14 @@ /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
* Internally uses the {@link MigrationManager} to do the actual migration. - * + * * @author Johannes Rabauer - * + * */ public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager { diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index cc4be8f..a6676ef 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -13,11 +13,11 @@ /** - * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for - * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. - * + * Provides static utility calls to create the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. + * * @author Johannes Rabauer - * + * */ public class MigrationEmbeddedStorage { diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 0ca5cd6..a386b73 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -11,11 +11,11 @@ /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link Versioned} + * Basically it intercepts storing the root object and places a {@link software.xdev.micromigration.version.Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. + * Internally uses the {@link software.xdev.micromigration.microstream.MigrationManager} to do the actual migration. * * @author Johannes Rabauer * diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 11dea89..3a9ed59 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -15,7 +15,7 @@ * Manages a given object and keeps the version for it. *

* Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the {@link MigrationEmbeddedStorageManager} + * datastore versioned. Since it is not integrated like the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} * multiple versioned objects can be used in one datastore. * * @author Johannes Rabauer diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 17f5ae7..48df48b 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -8,7 +8,7 @@ * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScript#migrate(Context)} method is called, + * After the {@link software.xdev.micromigration.scripts.MigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index da48bc8..028ce0a 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -27,14 +27,14 @@ /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
* Internally uses the {@link MigrationManager} to do the actual migration. - * + * * @author Johannes Rabauer - * + * */ public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager { diff --git a/pom.xml b/pom.xml index 4a8d667..0c0a676 100644 --- a/pom.xml +++ b/pom.xml @@ -159,11 +159,55 @@ maven-surefire-plugin 2.22.2 + + + org.apache.maven.plugins + maven-javadoc-plugin + + ${java.version} + UTF-8 + false + + -Xdoclint:none + -Xdoclint:none + + + + attach-javadocs + + aggregate-jar + + package + + + - org.jreleaser - jreleaser-maven-plugin - 1.3.1 + org.apache.maven.plugins + maven-source-plugin + + + attach-source + + aggregate + + + + + + + release + + + + org.jreleaser + jreleaser-maven-plugin + 1.3.1 + + + + + From 3adf4d6d6b9d1268e295ff3e1c0860f4012aba17 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 09:41:24 +0100 Subject: [PATCH 111/306] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 534aec3..8303309 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -80,4 +80,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From b2888cfd2f43727102f0237f4b111b9f42253364 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 09:48:08 +0100 Subject: [PATCH 112/306] Fixed Check Build --- .github/workflows/checkBuild.yml | 4 ++-- pom.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 8303309..2923cd5 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -58,7 +58,7 @@ jobs: name: jars-java-${{ matrix.java }} path: target/*.jar - publish: + publish dry run: runs-on: ubuntu-latest steps: - name: Checkout @@ -72,7 +72,7 @@ jobs: distribution: 'temurin' - name: Build project run: mvn -B -Prelease clean install - - name: Publish 'core' + - name: Publish project env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} diff --git a/pom.xml b/pom.xml index 0c0a676..5b094b5 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,7 @@ software.xdev micro-migration MicroMigration + Multimodule project for Micro Migration pom From f6620db2b62775b90e5ac09acc1f979f1a13da17 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 09:50:28 +0100 Subject: [PATCH 113/306] Update checkBuild.yml --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 2923cd5..3fb1aa9 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -58,7 +58,7 @@ jobs: name: jars-java-${{ matrix.java }} path: target/*.jar - publish dry run: + publish-dry-run: runs-on: ubuntu-latest steps: - name: Checkout From fcee25168db2ce12b398cf9ad960bb3c8ff66f74 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 10:11:33 +0100 Subject: [PATCH 114/306] Trying to change revision to global version --- core/pom.xml | 4 ++-- examples/pom.xml | 8 ++++---- microstream-v5/pom.xml | 6 +++--- microstream-v6/pom.xml | 6 +++--- microstream-v7/pom.xml | 6 +++--- pom.xml | 4 ++-- reflection/pom.xml | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 5c341ef..def5bba 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - ${revision} + ${global.version} MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - ${revision} + ${global.version} diff --git a/examples/pom.xml b/examples/pom.xml index 50a395c..93a84b7 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - ${revision} + ${global.version} MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - ${revision} + ${global.version} micro-migration @@ -18,12 +18,12 @@ software.xdev micro-migration-microstream-v7 - ${revision} + ${global.version} software.xdev micro-migration-reflection - ${revision} + ${global.version} diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 0f819c5..de57261 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - ${revision} + ${global.version} MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -14,7 +14,7 @@ software.xdev - ${revision} + ${global.version} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + ${global.version} one.microstream diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 283309e..c60df69 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - ${revision} + ${global.version} MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -14,7 +14,7 @@ software.xdev - ${revision} + ${global.version} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + ${global.version} one.microstream diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index b9343b5..72d9c41 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - ${revision} + ${global.version} MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -14,7 +14,7 @@ software.xdev - ${revision} + ${global.version} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + ${global.version} one.microstream diff --git a/pom.xml b/pom.xml index 5b094b5..700990d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - ${revision} + ${global.version} software.xdev micro-migration MicroMigration @@ -45,7 +45,7 @@ but we are using some functionality from Java 9: https://docs.microstream.one/manual/intro/system-requirements.html --> 9 - 0.0.3 + 0.0.3 diff --git a/reflection/pom.xml b/reflection/pom.xml index 973eb0c..cbd33fa 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - ${revision} + ${global.version} MicroMigration-Reflection Provides a migrater based on reflection @@ -14,7 +14,7 @@ software.xdev - ${revision} + ${global.version} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + ${global.version} org.reflections From 59ebc1306eb071357d171607150cac309a4afea8 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 10:14:35 +0100 Subject: [PATCH 115/306] Revert "Trying to change revision to global version" This reverts commit fcee25168db2ce12b398cf9ad960bb3c8ff66f74. --- core/pom.xml | 4 ++-- examples/pom.xml | 8 ++++---- microstream-v5/pom.xml | 6 +++--- microstream-v6/pom.xml | 6 +++--- microstream-v7/pom.xml | 6 +++--- pom.xml | 4 ++-- reflection/pom.xml | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index def5bba..5c341ef 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - ${global.version} + ${revision} MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - ${global.version} + ${revision} diff --git a/examples/pom.xml b/examples/pom.xml index 93a84b7..50a395c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - ${global.version} + ${revision} MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - ${global.version} + ${revision} micro-migration @@ -18,12 +18,12 @@ software.xdev micro-migration-microstream-v7 - ${global.version} + ${revision} software.xdev micro-migration-reflection - ${global.version} + ${revision} diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index de57261..0f819c5 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - ${global.version} + ${revision} MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -14,7 +14,7 @@ software.xdev - ${global.version} + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${global.version} + ${revision} one.microstream diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index c60df69..283309e 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - ${global.version} + ${revision} MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -14,7 +14,7 @@ software.xdev - ${global.version} + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${global.version} + ${revision} one.microstream diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 72d9c41..b9343b5 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - ${global.version} + ${revision} MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -14,7 +14,7 @@ software.xdev - ${global.version} + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${global.version} + ${revision} one.microstream diff --git a/pom.xml b/pom.xml index 700990d..5b094b5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - ${global.version} + ${revision} software.xdev micro-migration MicroMigration @@ -45,7 +45,7 @@ but we are using some functionality from Java 9: https://docs.microstream.one/manual/intro/system-requirements.html --> 9 - 0.0.3 + 0.0.3 diff --git a/reflection/pom.xml b/reflection/pom.xml index cbd33fa..973eb0c 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - ${global.version} + ${revision} MicroMigration-Reflection Provides a migrater based on reflection @@ -14,7 +14,7 @@ software.xdev - ${global.version} + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${global.version} + ${revision} org.reflections From f0f8e5abbbd66c1e0ac1574ddc9def2470416031 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 10:21:41 +0100 Subject: [PATCH 116/306] Update pom.xml --- pom.xml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pom.xml b/pom.xml index 5b094b5..2a58f13 100644 --- a/pom.xml +++ b/pom.xml @@ -196,19 +196,4 @@ - - - - release - - - - org.jreleaser - jreleaser-maven-plugin - 1.3.1 - - - - - From b2846e62b59dffd7d07d04d0416aca9a16b4f2ae Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 10:23:57 +0100 Subject: [PATCH 117/306] Test with static version --- core/pom.xml | 4 ++-- examples/pom.xml | 8 ++++---- microstream-v5/pom.xml | 6 +++--- microstream-v6/pom.xml | 6 +++--- microstream-v7/pom.xml | 6 +++--- pom.xml | 2 +- reflection/pom.xml | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 5c341ef..4db950b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - ${revision} + 0.0.3 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - ${revision} + 0.0.3 diff --git a/examples/pom.xml b/examples/pom.xml index 50a395c..8a1ac63 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - ${revision} + 0.0.3 MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - ${revision} + 0.0.3 micro-migration @@ -18,12 +18,12 @@ software.xdev micro-migration-microstream-v7 - ${revision} + 0.0.3 software.xdev micro-migration-reflection - ${revision} + 0.0.3 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 0f819c5..93baf54 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - ${revision} + 0.0.3 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -14,7 +14,7 @@ software.xdev - ${revision} + 0.0.3 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + 0.0.3 one.microstream diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 283309e..f2bde45 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - ${revision} + 0.0.3 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -14,7 +14,7 @@ software.xdev - ${revision} + 0.0.3 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + 0.0.3 one.microstream diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index b9343b5..e2b7cf5 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - ${revision} + 0.0.3 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -14,7 +14,7 @@ software.xdev - ${revision} + 0.0.3 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + 0.0.3 one.microstream diff --git a/pom.xml b/pom.xml index 2a58f13..f073fd6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - ${revision} + 0.0.3 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 973eb0c..696b978 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - ${revision} + 0.0.3 MicroMigration-Reflection Provides a migrater based on reflection @@ -14,7 +14,7 @@ software.xdev - ${revision} + 0.0.3 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + 0.0.3 org.reflections From 67d3ea89cebc52bafdb501bf3480936345a5bb4b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 13:04:43 +0100 Subject: [PATCH 118/306] Tried v0.0.4 --- .github/workflows/release.yml | 40 ++--------------------------------- CHANGELOG.md | 5 ++++- README.md | 8 +++---- core/pom.xml | 4 ++-- examples/pom.xml | 8 +++---- microstream-v5/pom.xml | 6 +++--- microstream-v6/pom.xml | 6 +++--- microstream-v7/pom.xml | 6 +++--- pom.xml | 4 ++-- reflection/pom.xml | 6 +++--- 10 files changed, 30 insertions(+), 63 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa5d661..988f93d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: distribution: 'temurin' - name: Build project run: mvn -B -Prelease clean install - - name: Publish 'core' + - name: Publish env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} @@ -26,40 +26,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl core -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy - - name: Publish 'reflection' - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl reflection -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy - - name: Publish 'micro-migration-microstream-v5' - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl microstream-v5 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy - - name: Publish 'micro-migration-microstream-v6' - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl microstream-v6 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy - - name: Publish 'micro-migration-microstream-v7' - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -pl microstream-v7 -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 77174b1..c1a601f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ +## 0.0.4 +* Fixed setup. 0.0.3 was not working with the release setup. + ## 0.0.3 * Restructured the complete maven modules. Multiple MicroStream-Versions are now supported. * Added plenty of documentation ## 0.0.2 -* Updated MicroStream from v4 to v5. \ No newline at end of file +* Updated MicroStream from v4 to v5. diff --git a/README.md b/README.md index 0c5cc98..2ef713d 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Simply add the dependency to your `pom.xml`: software.xdev micro-migration-microstream-v7 - 0.0.3 + 0.0.4 ``` @@ -128,7 +128,7 @@ To use this, you need to add the following dependency to your `pom.xml`: software.xdev micro-migration-reflection - 0.0.3 + 0.0.4 ``` @@ -147,7 +147,7 @@ then use `micro-migration-microstream-v7`) and exclude the dependent version of software.xdev micro-migration-microstream-v7 - 0.0.3 + 0.0.4 one.microstream @@ -167,4 +167,4 @@ Since there is rarely a breaking change, this works 90% of times. - [MvnRepository](https://mvnrepository.com/artifact/software.xdev/micro-migration-core) # Contributing -We would love your input in any way. More about contributing: [CONTRIBUTING.md](CONTRIBUTING.md) \ No newline at end of file +We would love your input in any way. More about contributing: [CONTRIBUTING.md](CONTRIBUTING.md) diff --git a/core/pom.xml b/core/pom.xml index 4db950b..bc8a438 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.3 + 0.0.4 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.3 + 0.0.4 diff --git a/examples/pom.xml b/examples/pom.xml index 8a1ac63..d0c3dde 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.3 + 0.0.4 MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.3 + 0.0.4 micro-migration @@ -18,12 +18,12 @@ software.xdev micro-migration-microstream-v7 - 0.0.3 + 0.0.4 software.xdev micro-migration-reflection - 0.0.3 + 0.0.4 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 93baf54..9933c74 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.3 + 0.0.4 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -14,7 +14,7 @@ software.xdev - 0.0.3 + 0.0.4 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.3 + 0.0.4 one.microstream diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index f2bde45..4b6ec8d 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.3 + 0.0.4 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -14,7 +14,7 @@ software.xdev - 0.0.3 + 0.0.4 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.3 + 0.0.4 one.microstream diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index e2b7cf5..d1a2f2f 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.3 + 0.0.4 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -14,7 +14,7 @@ software.xdev - 0.0.3 + 0.0.4 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.3 + 0.0.4 one.microstream diff --git a/pom.xml b/pom.xml index f073fd6..f158e0d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.3 + 0.0.4 software.xdev micro-migration MicroMigration @@ -45,7 +45,7 @@ but we are using some functionality from Java 9: https://docs.microstream.one/manual/intro/system-requirements.html --> 9 - 0.0.3 + 0.0.4 diff --git a/reflection/pom.xml b/reflection/pom.xml index 696b978..dec3408 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.3 + 0.0.4 MicroMigration-Reflection Provides a migrater based on reflection @@ -14,7 +14,7 @@ software.xdev - 0.0.3 + 0.0.4 micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.3 + 0.0.4 org.reflections From fc9e40e5b15a3941c72407015187e8a7753c74e8 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 13:36:17 +0100 Subject: [PATCH 119/306] Cleanup --- .github/workflows/release.yml | 4 +--- examples/pom.xml | 16 ++++++++++++++++ pom.xml | 15 ++++++++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 988f93d..737d1d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,6 @@ jobs: with: java-version: '11' distribution: 'temurin' - - name: Build project - run: mvn -B -Prelease clean install - name: Publish env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} @@ -26,4 +24,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy \ No newline at end of file diff --git a/examples/pom.xml b/examples/pom.xml index d0c3dde..02d52c6 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -26,4 +26,20 @@ 0.0.4 + + + + + org.jreleaser + jreleaser-maven-plugin + + + + true + + + + + + diff --git a/pom.xml b/pom.xml index f158e0d..b362a88 100644 --- a/pom.xml +++ b/pom.xml @@ -144,7 +144,6 @@ - org.apache.maven.plugins @@ -196,4 +195,18 @@ + + + + release + + + + org.jreleaser + jreleaser-maven-plugin + + + + + From 9ec4ecb7304b097ceee04a2e2e130858ba636b29 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 13:44:19 +0100 Subject: [PATCH 120/306] Tried excluding Examples from release --- .github/workflows/checkBuild.yml | 2 +- examples/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 3fb1aa9..44c478c 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -80,4 +80,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run \ No newline at end of file diff --git a/examples/pom.xml b/examples/pom.xml index 02d52c6..be89664 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -34,9 +34,9 @@ jreleaser-maven-plugin - + true - + From a04318d29e862c6fc4e5f1538d4b7ce249600ac1 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 13:46:45 +0100 Subject: [PATCH 121/306] Fixed release --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 44c478c..60b95c1 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -80,4 +80,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run \ No newline at end of file + run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 737d1d5..08ed899 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,4 +24,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy \ No newline at end of file + run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From 535f39f996bf070bf3a423251c9d55848593350c Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 13:49:12 +0100 Subject: [PATCH 122/306] Fixed Release --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/release.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 60b95c1..3fb1aa9 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -80,4 +80,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08ed899..bf5306d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: Publish package to the Maven Central Repository on: push: + branches: [ main ] tags: - v* jobs: @@ -24,4 +25,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From b55c61f469cf6f08c3663c83ac7b80a6e3c27933 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 13:56:11 +0100 Subject: [PATCH 123/306] Fixed Release action --- examples/pom.xml | 16 ---------------- pom.xml | 1 - 2 files changed, 17 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index be89664..d0c3dde 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -26,20 +26,4 @@ 0.0.4 - - - - - org.jreleaser - jreleaser-maven-plugin - - - - true - - - - - - diff --git a/pom.xml b/pom.xml index b362a88..1d6363d 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,6 @@ core reflection - examples microstream-v5 microstream-v6 microstream-v7 From 1c581dca80167a82c087d568c6f3829ab2e317f9 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 14:26:41 +0100 Subject: [PATCH 124/306] Tried cleanup --- pom.xml | 82 +++++++++++++++++++++++++-------------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/pom.xml b/pom.xml index 1d6363d..73d8ece 100644 --- a/pom.xml +++ b/pom.xml @@ -74,15 +74,6 @@ - - org.apache.maven.plugins - maven-resources-plugin - 3.3.0 - - UTF-8 - - - org.apache.maven.plugins maven-javadoc-plugin @@ -129,9 +120,9 @@ ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false + https://s01.oss.sonatype.org/service/local + true + true target/staging-deploy @@ -158,40 +149,6 @@ maven-surefire-plugin 2.22.2 - - - org.apache.maven.plugins - maven-javadoc-plugin - - ${java.version} - UTF-8 - false - - -Xdoclint:none - -Xdoclint:none - - - - attach-javadocs - - aggregate-jar - - package - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-source - - aggregate - - - - @@ -204,6 +161,39 @@ org.jreleaser jreleaser-maven-plugin + + org.apache.maven.plugins + maven-javadoc-plugin + + ${java.version} + UTF-8 + false + + -Xdoclint:none + -Xdoclint:none + + + + attach-javadocs + + aggregate-jar + + package + + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-source + + aggregate + + + + From 6a0697c507d53837b4859b17fb751faf3714df14 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 14:35:21 +0100 Subject: [PATCH 125/306] Once again try with dynamic version number --- .github/workflows/checkBuild.yml | 2 -- core/pom.xml | 4 ++-- examples/pom.xml | 8 ++++---- microstream-v5/pom.xml | 6 +++--- microstream-v6/pom.xml | 6 +++--- microstream-v7/pom.xml | 6 +++--- pom.xml | 4 ++-- reflection/pom.xml | 6 +++--- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 3fb1aa9..d2d3333 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -70,8 +70,6 @@ jobs: with: java-version: '11' distribution: 'temurin' - - name: Build project - run: mvn -B -Prelease clean install - name: Publish project env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/core/pom.xml b/core/pom.xml index bc8a438..5c341ef 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.4 + ${revision} MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.4 + ${revision} diff --git a/examples/pom.xml b/examples/pom.xml index d0c3dde..50a395c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.4 + ${revision} MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.4 + ${revision} micro-migration @@ -18,12 +18,12 @@ software.xdev micro-migration-microstream-v7 - 0.0.4 + ${revision} software.xdev micro-migration-reflection - 0.0.4 + ${revision} diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 9933c74..0f819c5 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.4 + ${revision} MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -14,7 +14,7 @@ software.xdev - 0.0.4 + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.4 + ${revision} one.microstream diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 4b6ec8d..283309e 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.4 + ${revision} MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -14,7 +14,7 @@ software.xdev - 0.0.4 + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.4 + ${revision} one.microstream diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index d1a2f2f..b9343b5 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.4 + ${revision} MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -14,7 +14,7 @@ software.xdev - 0.0.4 + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.4 + ${revision} one.microstream diff --git a/pom.xml b/pom.xml index 73d8ece..deda819 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.4 + ${revision} software.xdev micro-migration MicroMigration @@ -45,7 +45,7 @@ but we are using some functionality from Java 9: https://docs.microstream.one/manual/intro/system-requirements.html --> 9 - 0.0.4 + 0.0.5 diff --git a/reflection/pom.xml b/reflection/pom.xml index dec3408..973eb0c 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.4 + ${revision} MicroMigration-Reflection Provides a migrater based on reflection @@ -14,7 +14,7 @@ software.xdev - 0.0.4 + ${revision} micro-migration @@ -22,7 +22,7 @@ software.xdev micro-migration-core - 0.0.4 + ${revision} org.reflections From efb3489e4f6e2ca339c42c340910e430de11b180 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 15 Dec 2022 15:03:29 +0100 Subject: [PATCH 126/306] Test with static version --- core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index 5c341ef..adf1159 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -11,7 +11,7 @@ software.xdev micro-migration - ${revision} + 0.0.5 From 2b87e9194ce2446b92c2affb89b445c20972789d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 07:47:03 +0100 Subject: [PATCH 127/306] Trying to set the redundant relativePath --- core/pom.xml | 3 ++- pom.xml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index adf1159..8ab2329 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -11,7 +11,8 @@ software.xdev micro-migration - 0.0.5 + ${revision} + ../pom.xml diff --git a/pom.xml b/pom.xml index deda819..034fd34 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,14 @@ + + org.apache.maven.plugins + maven-resources-plugin + 3.3.0 + + UTF-8 + + org.apache.maven.plugins maven-javadoc-plugin From ece9c37b003e20f1ff67c2fd34c2007ecd1bb847 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 07:58:47 +0100 Subject: [PATCH 128/306] Trying to build with pre build --- .github/workflows/checkBuild.yml | 2 ++ core/pom.xml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index d2d3333..7eddb32 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -70,6 +70,8 @@ jobs: with: java-version: '11' distribution: 'temurin' + - name: Build with Maven + run: mvn -B clean install - name: Publish project env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/core/pom.xml b/core/pom.xml index 8ab2329..5c341ef 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -12,7 +12,6 @@ software.xdev micro-migration ${revision} - ../pom.xml From a46eef69b96aa8a5b57889af30e78a9ca4613dfc Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 09:26:37 +0100 Subject: [PATCH 129/306] Fixed revision reference --- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 2 +- microstream-v6/pom.xml | 2 +- microstream-v7/pom.xml | 2 +- reflection/pom.xml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index 50a395c..0bf3f60 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -18,12 +18,12 @@ software.xdev micro-migration-microstream-v7 - ${revision} + ${project.version} software.xdev micro-migration-reflection - ${revision} + ${project.version} diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 0f819c5..30fde8c 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + ${project.version} one.microstream diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 283309e..87355c9 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + ${project.version} one.microstream diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index b9343b5..7eac00b 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -22,7 +22,7 @@ software.xdev micro-migration-core - ${revision} + ${project.version} one.microstream diff --git a/reflection/pom.xml b/reflection/pom.xml index 973eb0c..ccd25e1 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -14,15 +14,15 @@ software.xdev - ${revision} micro-migration + ${revision} software.xdev micro-migration-core - ${revision} + ${project.version} org.reflections From 32e01166eb3d1c1e2ec84b12380b0cbd8bb99484 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 09:32:39 +0100 Subject: [PATCH 130/306] Replaced revision since it's not working witch JReleaser --- core/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 3 +-- reflection/pom.xml | 4 ++-- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 5c341ef..bc8a438 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - ${revision} + 0.0.4 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - ${revision} + 0.0.4 diff --git a/examples/pom.xml b/examples/pom.xml index 0bf3f60..775f7ff 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - ${revision} + 0.0.4 MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - ${revision} + 0.0.4 micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 30fde8c..d6c19dd 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - ${revision} + 0.0.4 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -14,8 +14,8 @@ software.xdev - ${revision} micro-migration + 0.0.4 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 87355c9..093f153 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - ${revision} + 0.0.4 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -14,8 +14,8 @@ software.xdev - ${revision} micro-migration + 0.0.4 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 7eac00b..ea00188 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - ${revision} + 0.0.4 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -14,8 +14,8 @@ software.xdev - ${revision} micro-migration + 0.0.4 diff --git a/pom.xml b/pom.xml index 034fd34..7ac6e89 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - ${revision} + 0.0.4 software.xdev micro-migration MicroMigration @@ -45,7 +45,6 @@ but we are using some functionality from Java 9: https://docs.microstream.one/manual/intro/system-requirements.html --> 9 - 0.0.5 diff --git a/reflection/pom.xml b/reflection/pom.xml index ccd25e1..5f490df 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - ${revision} + 0.0.4 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - ${revision} + 0.0.4 From f83683be0f8d3ee56f1b5cb8b87edd0222b717e4 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 09:36:00 +0100 Subject: [PATCH 131/306] Added Snapshot to version --- core/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index bc8a438..f1f70ab 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.4 + 0.0.4-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.4 + 0.0.4-SNAPSHOT diff --git a/examples/pom.xml b/examples/pom.xml index 775f7ff..b896d4d 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.4 + 0.0.4-SNAPSHOT MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.4 + 0.0.4-SNAPSHOT micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index d6c19dd..834b8c5 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.4 + 0.0.4-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4 + 0.0.4-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 093f153..b618a64 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.4 + 0.0.4-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4 + 0.0.4-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index ea00188..3d148bc 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.4 + 0.0.4-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4 + 0.0.4-SNAPSHOT diff --git a/pom.xml b/pom.xml index 7ac6e89..10ec0a3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.4 + 0.0.4-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 5f490df..0f34cd8 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.4 + 0.0.4-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4 + 0.0.4-SNAPSHOT From 4fed300757de076dac1a380b8333a8b4c569f7b8 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 09:47:44 +0100 Subject: [PATCH 132/306] Update release.yml --- .github/workflows/release.yml | 98 +++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf5306d..9d4e2b7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,10 +2,72 @@ name: Publish package to the Maven Central Repository on: push: branches: [ main ] - tags: - - v* jobs: - publish: + check_build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Maven + run: mvn -B clean verify + prepare_release: + runs-on: ubuntu-latest + needs: [check_build] + outputs: + upload_url: ${{ steps.create_draft.outputs.upload_url }} + steps: + - uses: actions/checkout@v3 + + - name: Configure Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Un-SNAP + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + + - name: Get version + id: version + run: | + echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" + + - name: Commit and Push + run: | + git add -A + git commit -m "Release ${{ steps.version.outputs.release }}" + git push origin + git tag v${{ steps.version.outputs.release }} + git push origin --tags + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.version.outputs.release }} + release_name: v${{ steps.version.outputs.release }} + commitish: master + body: | + ## Installation + Add the following lines to your pom: + ```XML + + software.xdev + micro-migration-microstream-v7 + ${{ steps.version.outputs.release }} + + ``` + draft: false + prerelease: false + publish_central: runs-on: ubuntu-latest steps: - name: Checkout @@ -25,4 +87,32 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + after_release: + runs-on: ubuntu-latest + needs: [publish_central] + steps: + - uses: actions/checkout@v3 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Inc Version and SNAP root + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + + - name: Git Commit and Push + run: | + git add -A + git commit -m "Preparing for next development iteration" + git push origin + + - name: pull-request + uses: repo-sync/pull-request@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + destination_branch: "develop" + pr_title: "Sync back" + pr_body: "An automated PR to sync changes back" \ No newline at end of file From 5d4495a353fd7e1ab93989d5f93f8e38ee15ea42 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 09:52:14 +0100 Subject: [PATCH 133/306] Fixed release.yml --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d4e2b7..9b243fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,11 +69,10 @@ jobs: prerelease: false publish_central: runs-on: ubuntu-latest + needs: [prepare_release] steps: - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Set up Java uses: actions/setup-java@v3 with: From 925527eff7c101b4ef9647a29976cede11c0fd48 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 09:58:33 +0100 Subject: [PATCH 134/306] Fixed warning in release --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b243fc..e2d5d76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: - name: Get version id: version run: | - echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" + echo "release=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT - name: Commit and Push run: | From 638e8b5f99dd325caae83897f9ed62fb5eb963dc Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 09:11:22 +0000 Subject: [PATCH 135/306] Release 0.0.4 --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index f1f70ab..bc8a438 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.4-SNAPSHOT + 0.0.4 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.4 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 834b8c5..d6c19dd 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.4-SNAPSHOT + 0.0.4 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.4 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index b618a64..093f153 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.4-SNAPSHOT + 0.0.4 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.4 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 3d148bc..ea00188 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.4-SNAPSHOT + 0.0.4 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.4 diff --git a/pom.xml b/pom.xml index 10ec0a3..7ac6e89 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.4-SNAPSHOT + 0.0.4 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 0f34cd8..5f490df 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.4-SNAPSHOT + 0.0.4 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.4 From 4199c436f7fa1fd712acfc9c807fd64d82356323 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 10:17:52 +0100 Subject: [PATCH 136/306] Version update --- .github/workflows/checkBuild.yml | 5 +++-- .github/workflows/release.yml | 5 +++++ CHANGELOG.md | 3 +++ README.md | 6 +++--- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 7eddb32..eda49ce 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -35,6 +35,9 @@ jobs: - name: Build with Maven run: mvn -B clean verify + - name: Build examples with Maven + run: mvn -B -pl examples clean verify + - name: Check for uncommited changes run: | if [[ "$(git status --porcelain)" != "" ]]; then @@ -70,8 +73,6 @@ jobs: with: java-version: '11' distribution: 'temurin' - - name: Build with Maven - run: mvn -B clean install - name: Publish project env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2d5d76..b1ccdc1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,8 @@ jobs: - name: Un-SNAP run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + - name: Un-SNAP examples + run: mvn -B -pl examples versions:set -DremoveSnapshot -DgenerateBackupPoms=false - name: Get version id: version @@ -101,6 +103,9 @@ jobs: - name: Inc Version and SNAP root run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + + - name: Inc Version and SNAP root from examples + run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - name: Git Commit and Push run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index c1a601f..1dd01a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.0.5 +* Tried a new release-action. + ## 0.0.4 * Fixed setup. 0.0.3 was not working with the release setup. diff --git a/README.md b/README.md index 2ef713d..cf3e845 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Simply add the dependency to your `pom.xml`: software.xdev micro-migration-microstream-v7 - 0.0.4 + 0.0.5 ``` @@ -128,7 +128,7 @@ To use this, you need to add the following dependency to your `pom.xml`: software.xdev micro-migration-reflection - 0.0.4 + 0.0.5 ``` @@ -147,7 +147,7 @@ then use `micro-migration-microstream-v7`) and exclude the dependent version of software.xdev micro-migration-microstream-v7 - 0.0.4 + 0.0.5 one.microstream diff --git a/core/pom.xml b/core/pom.xml index f1f70ab..2cf5ef8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 834b8c5..823e6e1 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index b618a64..07758b2 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 3d148bc..38a0e19 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index 10ec0a3..03914ee 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 0f34cd8..8a0751f 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT From a75836b8cd0b1f008f2a4ddb46446dfa86592d15 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 10:25:19 +0100 Subject: [PATCH 137/306] Fixed GitHub Actions --- .github/workflows/checkBuild.yml | 3 ++- .github/workflows/release.yml | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index eda49ce..520b002 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -36,7 +36,8 @@ jobs: run: mvn -B clean verify - name: Build examples with Maven - run: mvn -B -pl examples clean verify + run: mvn -B clean verify + working-directory: examples - name: Check for uncommited changes run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1ccdc1..c8de0b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,8 +8,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Set up Java uses: actions/setup-java@v3 with: @@ -33,7 +31,8 @@ jobs: - name: Un-SNAP run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - name: Un-SNAP examples - run: mvn -B -pl examples versions:set -DremoveSnapshot -DgenerateBackupPoms=false + run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + working-directory: examples - name: Get version id: version @@ -106,6 +105,8 @@ jobs: - name: Inc Version and SNAP root from examples run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true + working-directory: examples + - name: Git Commit and Push run: | From 3ecf244afa0bfc9331e05cf26114ad84eab5a310 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 10:26:20 +0100 Subject: [PATCH 138/306] Fixed examples version --- examples/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index b896d4d..08bb7f8 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.4-SNAPSHOT + 0.0.5-SNAPSHOT micro-migration From 61df194a6d1abfc778bc922215e3b55a07583a04 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 10:43:51 +0100 Subject: [PATCH 139/306] Excluded examples from versioning --- .github/workflows/checkBuild.yml | 6 +----- .github/workflows/release.yml | 10 +--------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 520b002..8960ffa 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -7,7 +7,7 @@ on: paths-ignore: - '**.md' pull_request: - branches: [ main, develop ] + branches: [ develop ] paths-ignore: - '**.md' @@ -35,10 +35,6 @@ jobs: - name: Build with Maven run: mvn -B clean verify - - name: Build examples with Maven - run: mvn -B clean verify - working-directory: examples - - name: Check for uncommited changes run: | if [[ "$(git status --porcelain)" != "" ]]; then diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8de0b4..9100a3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,9 +30,6 @@ jobs: - name: Un-SNAP run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - - name: Un-SNAP examples - run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false - working-directory: examples - name: Get version id: version @@ -102,12 +99,7 @@ jobs: - name: Inc Version and SNAP root run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - - - name: Inc Version and SNAP root from examples - run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - working-directory: examples - - + - name: Git Commit and Push run: | git add -A From 146d756e212bab25a0ec06f571adbd90d599975f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 09:47:48 +0000 Subject: [PATCH 140/306] Release 0.0.5 --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 2cf5ef8..8aa6e9c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 823e6e1..919a99a 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 07758b2..31db9d7 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 38a0e19..1682b8c 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/pom.xml b/pom.xml index 03914ee..4689735 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5-SNAPSHOT + 0.0.5 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 8a0751f..d7c7d0b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 From 2d9373e0881aa9fc5f95085ce4a11f3e278fc9fc Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 10:56:38 +0100 Subject: [PATCH 141/306] Update release.yml --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9100a3e..334e7cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,13 +46,13 @@ jobs: - name: Create Release id: create_release - uses: actions/create-release@v1 + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: v${{ steps.version.outputs.release }} - release_name: v${{ steps.version.outputs.release }} - commitish: master + name: v${{ steps.version.outputs.release }} + target_commitish: main body: | ## Installation Add the following lines to your pom: From 88c9fec2a1704b62fb5019bd8625f47ddcfe0ccd Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 10:57:00 +0100 Subject: [PATCH 142/306] Revert "Release 0.0.5" This reverts commit 146d756e212bab25a0ec06f571adbd90d599975f. --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8aa6e9c..2cf5ef8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 919a99a..823e6e1 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 31db9d7..07758b2 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 1682b8c..38a0e19 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index 4689735..03914ee 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5 + 0.0.5-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index d7c7d0b..8a0751f 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT From c06bdd662a33784b2a9140d52f4770dbfc847f03 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 09:59:26 +0000 Subject: [PATCH 143/306] Release 0.0.5 --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 2cf5ef8..8aa6e9c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 823e6e1..919a99a 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 07758b2..31db9d7 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 38a0e19..1682b8c 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/pom.xml b/pom.xml index 03914ee..4689735 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5-SNAPSHOT + 0.0.5 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 8a0751f..d7c7d0b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 From 2b9bbacfdc7a74a9282863a85d4e2343af3b671b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 10:01:29 +0000 Subject: [PATCH 144/306] Preparing for next development iteration --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8aa6e9c..ea47145 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 919a99a..6b6ce21 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 31db9d7..05f0043 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 1682b8c..85935d7 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/pom.xml b/pom.xml index 4689735..27d28b9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5 + 0.0.6-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index d7c7d0b..2bf0c9d 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT From a3a12c0511530af14c65d9672cf4b188066646fb Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 11:51:54 +0100 Subject: [PATCH 145/306] Fixed miss pull after version change --- .github/workflows/release.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 334e7cc..0db9630 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,6 +71,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + # This might seem strange, but in order to see the Version update from the previous step, + # we must pull this change from git. + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull - name: Set up Java uses: actions/setup-java@v3 with: From 34805de1fdde6f0459a9115daf24d7ae8320b7ee Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 12:02:09 +0100 Subject: [PATCH 146/306] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cf3e845..88193e1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration-core)](https://mvnrepository.com/artifact/software.xdev/micro-migration-core) -[![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/main)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Amain) +[![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/versions) +[![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/main)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) @@ -136,9 +136,9 @@ To use this, you need to add the following dependency to your `pom.xml`: Micro migration currently supports the following MicroStream versions: | MicroStream Version | Micro migration artifact Id | | --- | --- | -| 05.00.02-MS-GA | micro-migration-microstream-v5 | -| 06.01.00-MS-GA | micro-migration-microstream-v6 | -| 07.01.00-MS-GA | micro-migration-microstream-v7 | +| [05.00.02-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | micro-migration-microstream-v5 | +| [06.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | micro-migration-microstream-v6 | +| [07.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | micro-migration-microstream-v7 | If you are using a different, not listed version of MicroStream, this shouldn't be a problem. Usually you can simply use the closest Micro migration version (f.e. you are using MicroStream `07.00.00-MS-GA`, @@ -164,7 +164,7 @@ Since there is rarely a breaking change, this works 90% of times. # Links - [Javadoc](https://javadoc.io/doc/software.xdev/micro-migration-core/latest/index.html) -- [MvnRepository](https://mvnrepository.com/artifact/software.xdev/micro-migration-core) +- [Maven central repository](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/version) # Contributing We would love your input in any way. More about contributing: [CONTRIBUTING.md](CONTRIBUTING.md) From 7cf49007f58e18b8492c71790fa232f97c40191e Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 12:04:07 +0100 Subject: [PATCH 147/306] Revert to v0.0.5 because of problems with release --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index ea47145..2cf5ef8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 6b6ce21..823e6e1 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 05f0043..07758b2 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 85935d7..38a0e19 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index 27d28b9..03914ee 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 2bf0c9d..8a0751f 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.5-SNAPSHOT From 8ffb359795e8db01d9d07b7435be46a330b83b44 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 11:06:10 +0000 Subject: [PATCH 148/306] Release 0.0.5 --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 2cf5ef8..8aa6e9c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 823e6e1..919a99a 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 07758b2..31db9d7 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 38a0e19..1682b8c 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/pom.xml b/pom.xml index 03914ee..4689735 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5-SNAPSHOT + 0.0.5 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 8a0751f..d7c7d0b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 From f587be86d1947f8758f536ab47d12e6cdbdb9d09 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 13:21:50 +0100 Subject: [PATCH 149/306] Workaround because releasing right away does not work --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 03914ee..0f2892e 100644 --- a/pom.xml +++ b/pom.xml @@ -128,8 +128,8 @@ ALWAYS https://s01.oss.sonatype.org/service/local - true - true + false + false target/staging-deploy From c58ebda9a4ee81072add5d4d897c5d391413d745 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 13:22:28 +0100 Subject: [PATCH 150/306] Revert "Release 0.0.5" This reverts commit 8ffb359795e8db01d9d07b7435be46a330b83b44. --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8aa6e9c..2cf5ef8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 919a99a..823e6e1 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 31db9d7..07758b2 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 1682b8c..38a0e19 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index 4689735..03914ee 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5 + 0.0.5-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index d7c7d0b..8a0751f 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT From 64a8b2e619f818365d174a8eb524ec313052abd3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 12:24:35 +0000 Subject: [PATCH 151/306] Release 0.0.5 --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 2cf5ef8..8aa6e9c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 823e6e1..919a99a 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 07758b2..31db9d7 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 38a0e19..1682b8c 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/pom.xml b/pom.xml index 0f2892e..138ddf3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5-SNAPSHOT + 0.0.5 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 8a0751f..d7c7d0b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 From d3c4adebf154fe6ab04715e69574d42e2942d606 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 13:28:41 +0100 Subject: [PATCH 152/306] Revert "Release 0.0.5" This reverts commit 64a8b2e619f818365d174a8eb524ec313052abd3. --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8aa6e9c..2cf5ef8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 919a99a..823e6e1 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 31db9d7..07758b2 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 1682b8c..38a0e19 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT diff --git a/pom.xml b/pom.xml index 138ddf3..0f2892e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5 + 0.0.5-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index d7c7d0b..8a0751f 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5 + 0.0.5-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.5-SNAPSHOT From 907942be4afb1c31c1dcc0e4576a4e587da6065c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 12:29:57 +0000 Subject: [PATCH 153/306] Release 0.0.5 --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 2cf5ef8..8aa6e9c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 823e6e1..919a99a 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 07758b2..31db9d7 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 38a0e19..1682b8c 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 diff --git a/pom.xml b/pom.xml index 0f2892e..138ddf3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5-SNAPSHOT + 0.0.5 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 8a0751f..d7c7d0b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5-SNAPSHOT + 0.0.5 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5-SNAPSHOT + 0.0.5 From c6f20755802180ab1e761e835eabd2a5ffb665b2 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 12:33:23 +0000 Subject: [PATCH 154/306] Preparing for next development iteration --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 8aa6e9c..ea47145 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 919a99a..6b6ce21 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 31db9d7..05f0043 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 1682b8c..85935d7 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT diff --git a/pom.xml b/pom.xml index 138ddf3..46cca8b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.5 + 0.0.6-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index d7c7d0b..2bf0c9d 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.5 + 0.0.6-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.5 + 0.0.6-SNAPSHOT From 94f70399bdc47281a534fba15099d09ee05329dc Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Fri, 16 Dec 2022 14:13:03 +0100 Subject: [PATCH 155/306] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 35 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..d9cdd08 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Implemented Micro migration like this... +2. Started datastore... +3. Restarted datastore... + + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment (please complete the following information):** + - OS: [e.g. Windows 10, Ubuntu] + - Java version [e.g. Java 11] + - IDE [e.g. eclipse, intellij] + - MicroStream version [e.g. 07.01.00-MS-GA] + - Micro migration version [e.g. 22] + - Maven pom.xml [relevant parts] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From bf187341d36ef59d831a44a55be0c75cfd1ca60c Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 16 Dec 2022 15:01:10 +0100 Subject: [PATCH 156/306] Fixes for new version --- CHANGELOG.md | 3 +++ README.md | 6 +++--- examples/pom.xml | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dd01a4..429500f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.0.6 +* Tried a new release-action...again. + ## 0.0.5 * Tried a new release-action. diff --git a/README.md b/README.md index 88193e1..101a604 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Simply add the dependency to your `pom.xml`: software.xdev micro-migration-microstream-v7 - 0.0.5 + 0.0.6 ``` @@ -128,7 +128,7 @@ To use this, you need to add the following dependency to your `pom.xml`: software.xdev micro-migration-reflection - 0.0.5 + 0.0.6 ``` @@ -147,7 +147,7 @@ then use `micro-migration-microstream-v7`) and exclude the dependent version of software.xdev micro-migration-microstream-v7 - 0.0.5 + 0.0.6 one.microstream diff --git a/examples/pom.xml b/examples/pom.xml index 08bb7f8..e54c2af 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.5-SNAPSHOT + 0.0.6 MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.5-SNAPSHOT + 0.0.6 micro-migration From 3824d3de1d0616025f5b8f27c137c539726bb392 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 14:02:58 +0000 Subject: [PATCH 157/306] Release 0.0.6 --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index ea47145..f5331d7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.6-SNAPSHOT + 0.0.6 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.6 diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 6b6ce21..bd1f3b3 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.6-SNAPSHOT + 0.0.6 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.6 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 05f0043..5b4d80e 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.6-SNAPSHOT + 0.0.6 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.6 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 85935d7..0bc674a 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.6-SNAPSHOT + 0.0.6 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.6 diff --git a/pom.xml b/pom.xml index 46cca8b..e3fdc19 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.6-SNAPSHOT + 0.0.6 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 2bf0c9d..9a9d009 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.6-SNAPSHOT + 0.0.6 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6-SNAPSHOT + 0.0.6 From 884f556de9d063fd1083988006234f42923ec370 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 16 Dec 2022 14:06:29 +0000 Subject: [PATCH 158/306] Preparing for next development iteration --- core/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index f5331d7..194147c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-core - 0.0.6 + 0.0.7-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.6 + 0.0.7-SNAPSHOT diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index bd1f3b3..0ee2cb2 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.6 + 0.0.7-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6 + 0.0.7-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 5b4d80e..ccc2682 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.6 + 0.0.7-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6 + 0.0.7-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 0bc674a..7d29236 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.6 + 0.0.7-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6 + 0.0.7-SNAPSHOT diff --git a/pom.xml b/pom.xml index e3fdc19..1decbaf 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.6 + 0.0.7-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 9a9d009..cd65e5b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.6 + 0.0.7-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.6 + 0.0.7-SNAPSHOT From 6f69b83229e723d44b16df844005c22573ca0a34 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Mon, 19 Dec 2022 13:16:26 +0100 Subject: [PATCH 159/306] Create SECURITY.md --- SECURITY.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..03bbbd4 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| < 0.0.6 | :x: | +| > 0.0.6 | :white_check_mark: | + +## Supported MicroStream versions +Micro migration currently supports the following MicroStream versions: +| MicroStream Version | Micro migration artifact Id | +| --- | --- | +| [05.00.02-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | micro-migration-microstream-v5 | +| [06.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | micro-migration-microstream-v6 | +| [07.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | micro-migration-microstream-v7 | + +## Reporting a Vulnerability + +Instructions for reporting a vulnerability can be found on the [CONTRIBUTING page](CONTRIBUTING.md). From 62ee00e65e5a037253743b2cb5f365bccccc4f85 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 19 Dec 2022 13:22:36 +0100 Subject: [PATCH 160/306] Created rudimentary pr-template --- pull_request_template.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 pull_request_template.md diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..149f933 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,4 @@ +## What does this PR do? + +## Checklist before merging +- [ ] If its a core feature, I have added through test. \ No newline at end of file From f0720539553a1780d8da1dc66eb60d5b60dd3d76 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Mon, 19 Dec 2022 14:10:01 +0100 Subject: [PATCH 161/306] Create codeql.yml --- .github/workflows/codeql.yml | 76 ++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..70a157d --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,76 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "develop", main ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "develop" ] + schedule: + - cron: '27 16 * * 6' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Use only 'java' to analyze code written in Java, Kotlin or both + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From b54e4c2fb5767246a7d5afda6f6375bd3b95474f Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 19 Dec 2022 14:27:27 +0100 Subject: [PATCH 162/306] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 101a604..70af09e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ +![License](https://img.shields.io/github/license/xdev-software/micro-migration) [![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/versions) -[![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/main)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/develop)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) +![Twitter Follow](https://img.shields.io/twitter/follow/XDEVSoftware) # Micro migration When you think about default database setup, you probably imagine something like this: From 8a7dad04357076c936a57ebbdf5cd3fec1c35e30 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 19 Dec 2022 14:29:39 +0100 Subject: [PATCH 163/306] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70af09e..e8a98e6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/develop)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) -![Twitter Follow](https://img.shields.io/twitter/follow/XDEVSoftware) +[![Twitter Follow](https://img.shields.io/twitter/follow/XDEVSoftware)](https://twitter.com/XDEVSoftware) # Micro migration When you think about default database setup, you probably imagine something like this: From c95fa1b159be749779943218dde4c53d667a096c Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 19 Dec 2022 14:38:18 +0100 Subject: [PATCH 164/306] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e8a98e6..b4d6a45 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![License](https://img.shields.io/github/license/xdev-software/micro-migration) [![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/versions) -[![Build](https://img.shields.io/github/workflow/status/xdev-software/micro-migration/Check%20Build/develop)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) +[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/micro-migration/checkBuild.yml?branch=develop)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) [![Twitter Follow](https://img.shields.io/twitter/follow/XDEVSoftware)](https://twitter.com/XDEVSoftware) From 73f559a57d3d4c492b280878da896266911044df Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 19 Dec 2022 15:06:13 +0100 Subject: [PATCH 165/306] Activated Caching for maven in github actions --- .github/workflows/checkBuild.yml | 1 + .github/workflows/release.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 8960ffa..2a90003 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -70,6 +70,7 @@ jobs: with: java-version: '11' distribution: 'temurin' + cache: 'maven' - name: Publish project env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0db9630..794e8d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,7 @@ jobs: with: java-version: '11' distribution: 'temurin' + cache: 'maven' - name: Build with Maven run: mvn -B clean verify prepare_release: @@ -83,6 +84,7 @@ jobs: with: java-version: '11' distribution: 'temurin' + cache: 'maven' - name: Publish env: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} From 809b435261620f971f337aa1b61e38dd52c7f2cd Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 19 Dec 2022 15:09:26 +0100 Subject: [PATCH 166/306] Added abstract to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b4d6a45..9f1a1a3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ [![Twitter Follow](https://img.shields.io/twitter/follow/XDEVSoftware)](https://twitter.com/XDEVSoftware) # Micro migration +Tiny java library to migrate MicroStream datastores. +Applies migration scripts on the datastores to keep them up to date. + +## Intro When you think about default database setup, you probably imagine something like this: ![Imaginative system layout](./docs/MigrationSequence_1.png "Imaginative system layout") From 91cb49c4e9ed9dbf27e012a5f15d29bc4bcc44b9 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 21 Dec 2022 11:28:23 +0100 Subject: [PATCH 167/306] Abstracted BusinessBranchDummyBranch in exmaple --- ...alWithMigrationEmbeddedStorageManager.java | 20 ++----------------- .../MainPracticalWithMigrationManager.java | 20 +------------------ .../examples/practical/v0/BusinessBranch.java | 18 +++++++++++++++++ 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 2ce7611..753263a 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -27,7 +27,7 @@ public static void main(String[] args) final ExplicitMigrater emptyMigrater = new ExplicitMigrater(); try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(emptyMigrater)) { - storageManager.setRoot(createDummyBranch()); + storageManager.setRoot(BusinessBranch.createDummyBranch()); storageManager.storeRoot(); System.out.println(storageManager.root().toString()); } @@ -52,21 +52,5 @@ public static void main(String[] args) } } - private static BusinessBranch createDummyBranch() - { - BusinessBranch branch = new BusinessBranch(); - Customer customer1 = new Customer(); - customer1.name = "Mick Fleetwood"; - customer1.number = 1; - customer1.street = "Fleetwood Street"; - customer1.city = "Redruth"; - branch.customers.add(customer1); - Customer customer2 = new Customer(); - customer2.name = "Lindsey Buckingham"; - customer2.number = 2; - customer2.street = "Mac Street"; - customer2.city = "Palo Alto"; - branch.customers.add(customer2); - return branch; - } + } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index abd9f57..428bbd2 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -32,7 +32,7 @@ public static void main(String[] args) //V0.0 try(EmbeddedStorageManager storageManager = EmbeddedStorage.start()) { - VersionedObject versionedBranch = new VersionedObject<>(createDummyBranch()); + VersionedObject versionedBranch = new VersionedObject<>(BusinessBranch.createDummyBranch()); storageManager.setRoot(versionedBranch); storageManager.storeRoot(); System.out.println(storageManager.root().toString()); @@ -60,22 +60,4 @@ public static void main(String[] args) System.out.println(storageManager.root().toString()); } } - - private static BusinessBranch createDummyBranch() - { - BusinessBranch branch = new BusinessBranch(); - Customer customer1 = new Customer(); - customer1.name = "Mick Fleetwood"; - customer1.number = 1; - customer1.street = "Fleetwood Street"; - customer1.city = "Redruth"; - branch.customers.add(customer1); - Customer customer2 = new Customer(); - customer2.name = "Lindsey Buckingham"; - customer2.number = 2; - customer2.street = "Mac Street"; - customer2.city = "Palo Alto"; - branch.customers.add(customer2); - return branch; - } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java index fcc8f7f..8b23e7d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java @@ -15,4 +15,22 @@ public String toString() { } return toString; } + + public static BusinessBranch createDummyBranch() + { + BusinessBranch branch = new BusinessBranch(); + Customer customer1 = new Customer(); + customer1.name = "Mick Fleetwood"; + customer1.number = 1; + customer1.street = "Fleetwood Street"; + customer1.city = "Redruth"; + branch.customers.add(customer1); + Customer customer2 = new Customer(); + customer2.name = "Lindsey Buckingham"; + customer2.number = 2; + customer2.street = "Mac Street"; + customer2.city = "Palo Alto"; + branch.customers.add(customer2); + return branch; + } } From c5bb901e591fe51d7b2bc6caf46ea339bd98cb60 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 21 Dec 2022 11:42:55 +0100 Subject: [PATCH 168/306] Added Javadoc --- .../examples/explicit/MainExplicit.java | 11 ++++++++++- .../examples/reflective/MainReflective.java | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index ea5d079..7a2e99c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -2,13 +2,22 @@ import java.util.Date; +import software.xdev.micromigration.examples.practical.embedded.UpdateToV2_0; +import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_0; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_1; import software.xdev.micromigration.migrater.ExplicitMigrater; - +/** + * The most basic usage of micro migration. + * Here two {@link software.xdev.micromigration.scripts.MigrationScript}s are explicitly registered + * and subsequently executed. Easy. + * + * @author Johannes Rabauer + * + */ public class MainExplicit { public static void main(String[] args) diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index 1e87e99..3cf1848 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -8,6 +8,11 @@ import software.xdev.micromigration.migrater.ScriptInstantiationException; +/** + * Shows the usage of the {@link ReflectiveMigrater}. Very simple. + * + * @author Johannes Rabauer + */ public class MainReflective { public static void main(String[] args) From 1160d16e373c1dce9b113ac474c7f75ab669de58 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 21 Dec 2022 11:43:05 +0100 Subject: [PATCH 169/306] Added example for notification --- .../notification/MainNotification.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java new file mode 100644 index 0000000..5bf80f3 --- /dev/null +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -0,0 +1,54 @@ +package software.xdev.micromigration.examples.notification; + +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.version.MigrationVersion; + +import java.util.Date; + + +/** + * Shows the basic registration of migration notifications + * ({@link software.xdev.micromigration.notification.ScriptExecutionNotification}). + * + * @author Johannes Rabauer + */ +public class MainNotification +{ + public static void main(String[] args) + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MainNotification.UpdateToV1_0() + ); + migrater.setNotificationConsumer( + scriptExecutionNotification -> System.out.println("Script " + scriptExecutionNotification.getExecutedScript().getClass().getSimpleName() + " executed.") + ); + final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); + System.out.println(storageManager.root()); + if(storageManager.root() == null) + { + storageManager.setRoot("Hello World! @ " + new Date()); + } + storageManager.storeRoot(); + storageManager.shutdown(); + } + + static class UpdateToV1_0 implements MigrationScript + { + @Override + public MigrationVersion getTargetVersion() + { + return new MigrationVersion(1,0); + } + + @Override + public void migrate(Context context) + { + context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); + } + } +} From 6871e99e42548db24530246e0002f34c0bb4766b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 21 Dec 2022 12:06:58 +0100 Subject: [PATCH 170/306] Added a ScriptExecutionNotificationWithoutScriptReference --- .../migrater/AbstractMigrater.java | 8 +-- ... AbstractScriptExecutionNotification.java} | 21 ++------ ...cutionNotificationWithScriptReference.java | 50 +++++++++++++++++++ ...ionNotificationWithoutScriptReference.java | 40 +++++++++++++++ 4 files changed, 99 insertions(+), 20 deletions(-) rename core/src/main/java/software/xdev/micromigration/notification/{ScriptExecutionNotification.java => AbstractScriptExecutionNotification.java} (81%) create mode 100644 core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java create mode 100644 core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index bc02bb8..485e2dc 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -6,7 +6,7 @@ import java.util.function.Consumer; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import software.xdev.micromigration.notification.ScriptExecutionNotification; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithScriptReference; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; @@ -20,13 +20,13 @@ */ public abstract class AbstractMigrater implements MicroMigrater { - private Consumer notificationConsumer = null; + private Consumer notificationConsumer = null; /** * Registers a callback to take action when a script is executed. * @param notificationConsumer is executed when a script is used from this migrater. */ - public void setNotificationConsumer(Consumer notificationConsumer) + public void setNotificationConsumer(Consumer notificationConsumer) { this.notificationConsumer = notificationConsumer; } @@ -84,7 +84,7 @@ public MigrationVersion migrateToNewest( if(this.notificationConsumer != null) { this.notificationConsumer.accept( - new ScriptExecutionNotification( + new ScriptExecutionNotificationWithScriptReference( script , versionBeforeUpdate , updateVersionWhichWasExecuted, diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java similarity index 81% rename from core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java rename to core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java index beaa653..9ed6f18 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotification.java +++ b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java @@ -1,33 +1,31 @@ package software.xdev.micromigration.notification; -import java.time.LocalDateTime; - import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; +import java.time.LocalDateTime; + + /** * Contains data about the execution of a script by a {@link MicroMigrater}. * * @author Johannes Rabauer */ -public class ScriptExecutionNotification +public abstract class AbstractScriptExecutionNotification { - private final MigrationScript executedScript; private final MigrationVersion sourceVersion ; private final MigrationVersion targetVersion ; private final LocalDateTime startDate ; private final LocalDateTime endDate ; /** - * @param executedScript script that was executed * @param sourceVersion original version of the object before executing the script * @param targetVersion version of the object after executing the script * @param startDate time when the script was started * @param endDate time when the script has finished */ - public ScriptExecutionNotification( - MigrationScript executedScript, + public AbstractScriptExecutionNotification( MigrationVersion sourceVersion , MigrationVersion targetVersion , LocalDateTime startDate , @@ -35,21 +33,12 @@ public ScriptExecutionNotification( ) { super(); - this.executedScript = executedScript; this.sourceVersion = sourceVersion ; this.targetVersion = targetVersion ; this.startDate = startDate ; this.endDate = endDate ; } - /** - * @return the script that was executed - */ - public MigrationScript getExecutedScript() - { - return executedScript; - } - /** * @return the original version of the object before executing the script */ diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java new file mode 100644 index 0000000..bc8681a --- /dev/null +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java @@ -0,0 +1,50 @@ +package software.xdev.micromigration.notification; + +import java.time.LocalDateTime; + +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +/** + * Contains data about the execution of a script by a {@link MicroMigrater}. + * + * @author Johannes Rabauer + */ +public class ScriptExecutionNotificationWithScriptReference extends AbstractScriptExecutionNotification +{ + private final MigrationScript executedScript; + + /** + * @param executedScript script that was executed + * @param sourceVersion original version of the object before executing the script + * @param targetVersion version of the object after executing the script + * @param startDate time when the script was started + * @param endDate time when the script has finished + */ + public ScriptExecutionNotificationWithScriptReference( + MigrationScript executedScript, + MigrationVersion sourceVersion , + MigrationVersion targetVersion , + LocalDateTime startDate , + LocalDateTime endDate + ) + { + super( + sourceVersion, + targetVersion, + startDate , + endDate + ); + this.executedScript = executedScript; + } + + /** + * @return the script that was executed + */ + public MigrationScript getExecutedScript() + { + return executedScript; + } + +} diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java new file mode 100644 index 0000000..580ba6e --- /dev/null +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java @@ -0,0 +1,40 @@ +package software.xdev.micromigration.notification; + +/** + * Same as {@link ScriptExecutionNotificationWithScriptReference} but instead of referencing + * the {@link software.xdev.micromigration.scripts.MigrationScript} directly, only the name of the script is + * extracted through the class name. + *

+ * "Why?!" - If you want to persist say a history of your applied scripts in your database and + * you reference your scripts directly, these classes are referenced in your datastore. + * That shouldn't be a problem. Except when you refactor or delete these scripts. + * Usually what's really important is the name of the script. + * + * @author Johannes Rabauer + */ +public class ScriptExecutionNotificationWithoutScriptReference extends AbstractScriptExecutionNotification +{ + private final String executedScriptName; + + /** + * @param originalNotification where the reference to the script is deleted and the class name is extracted. + */ + public ScriptExecutionNotificationWithoutScriptReference(final ScriptExecutionNotificationWithScriptReference originalNotification) + { + super( + originalNotification.getSourceVersion(), + originalNotification.getTargetVersion(), + originalNotification.getStartDate() , + originalNotification.getEndDate() + ); + this.executedScriptName = originalNotification.getExecutedScript().getClass().getSimpleName(); + } + + /** + * @return the name of the script that was extracted. + */ + public String getExecutedScriptName() + { + return this.executedScriptName; + } +} From 82eaa1a655a6588aee9a7d8e7b54cca0024eb986 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 22 Dec 2022 09:34:32 +0100 Subject: [PATCH 171/306] Incomplete refactoring of migration-structure --- core/pom.xml | 5 +- .../xdev/micromigration/MigrationManager.java | 20 -- ...nosticMigrationEmbeddedStorageManager.java | 113 ++++++++ .../VersionAgnosticMigrationManager.java | 39 ++- ...nosticTunnelingEmbeddedStorageManager.java | 37 +++ .../migrater/AbstractMigrater.java | 52 ++-- .../migrater/ExplicitMigrater.java | 13 +- .../migrater/MicroMigrater.java | 18 +- .../VersionAlreadyRegisteredException.java | 18 +- .../AbstractScriptExecutionNotification.java | 1 - ...cutionNotificationWithScriptReference.java | 12 +- ...ionNotificationWithoutScriptReference.java | 5 +- .../xdev/micromigration/scripts/Context.java | 2 +- .../ReflectiveVersionMigrationScript.java | 6 +- .../scripts/SimpleTypedMigrationScript.java | 6 +- ...va => VersionAgnosticMigrationScript.java} | 10 +- microstream-v5/pom.xml | 6 + .../microstream/MigrationEmbeddedStorage.java | 1 - .../MigrationEmbeddedStorageManager.java | 79 +----- .../microstream/MigrationManager.java | 110 ++------ .../microstream/MigrationScript.java | 6 +- .../TunnelingEmbeddedStorageManager.java | 9 +- .../MigrationScriptAfterScriptTest.java | 37 ++- .../integration/MultipleScriptsTest.java | 32 +-- ...oreStuffInMigrationStorageManagerTest.java | 22 +- .../testUtil/MicroMigrationScriptDummy.java | 6 +- microstream-v6/pom.xml | 76 +---- .../microstream/MigrationEmbeddedStorage.java | 16 +- .../MigrationEmbeddedStorageManager.java | 262 +++++++++++++---- .../microstream/MigrationManager.java | 107 ------- .../microstream/MigrationScript.java | 7 +- .../TunnelingEmbeddedStorageManager.java | 251 ----------------- ...oduceMigrationOnExistingDatastoreTest.java | 19 +- .../MigrationScriptAfterScriptTest.java | 40 ++- .../integration/MultipleScriptsTest.java | 32 +-- ...oreStuffInMigrationStorageManagerTest.java | 22 +- .../migrater/ExplicitMigraterTest.java | 14 +- .../testUtil/MicroMigrationScriptDummy.java | 6 +- .../microstream/MigrationEmbeddedStorage.java | 16 +- .../MigrationEmbeddedStorageManager.java | 266 ++++++++++++++---- .../microstream/MigrationScript.java | 7 +- .../TunnelingEmbeddedStorageManager.java | 251 ----------------- ...oduceMigrationOnExistingDatastoreTest.java | 19 +- .../MigrationScriptAfterScriptTest.java | 40 ++- .../integration/MultipleScriptsTest.java | 34 +-- ...oreStuffInMigrationStorageManagerTest.java | 22 +- .../migrater/ExplicitMigraterTest.java | 14 +- .../testUtil/MicroMigrationScriptDummy.java | 6 +- .../migrater/ReflectiveMigrater.java | 25 +- .../abstractSuperClass/AbstractScript.java | 6 +- .../errorThrowing/ErrorThrowingScript.java | 6 +- .../ExceptionThrowingScript.java | 6 +- .../includeSubPackages/ValidScript.java | 6 +- .../subpackage/ValidScriptInSubpackage.java | 6 +- .../ValidScript.java | 6 +- .../NoCorrectConstructorScript.java | 6 +- .../migrater/scripts/valid/ValidScript.java | 6 +- 57 files changed, 920 insertions(+), 1345 deletions(-) delete mode 100644 core/src/main/java/software/xdev/micromigration/MigrationManager.java create mode 100644 core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java rename microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java => core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java (75%) create mode 100644 core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java rename core/src/main/java/software/xdev/micromigration/scripts/{MigrationScript.java => VersionAgnosticMigrationScript.java} (82%) delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java delete mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java diff --git a/core/pom.xml b/core/pom.xml index 194147c..8955cc2 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -20,10 +20,7 @@ org.apache.maven.plugins maven-source-plugin - - org.apache.maven.plugins - maven-javadoc-plugin - + org.apache.maven.plugins maven-resources-plugin diff --git a/core/src/main/java/software/xdev/micromigration/MigrationManager.java b/core/src/main/java/software/xdev/micromigration/MigrationManager.java deleted file mode 100644 index 06ab6b0..0000000 --- a/core/src/main/java/software/xdev/micromigration/MigrationManager.java +++ /dev/null @@ -1,20 +0,0 @@ -package software.xdev.micromigration; - -/** - * Manages a given object and keeps the version for it. - *

- * Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the MigrationEmbeddedStorageManager - * multiple versioned objects can be used in one datastore. - * - * @author Johannes Rabauer - * - */ -public interface MigrationManager -{ - /** - * Migrates the given object to the newest possible version, defined by the {@link software.xdev.micromigration.migrater.MicroMigrater}. - * @param objectToMigrate is given to the {@link software.xdev.micromigration.migrater.MicroMigrater} for migrating upon - */ - void migrate(Object objectToMigrate); -} diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..c960aa4 --- /dev/null +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -0,0 +1,113 @@ +package software.xdev.micromigration.microstream.versionagnostic; + +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedRoot; + +import java.util.Objects; + + +/** + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class VersionAgnosticMigrationEmbeddedStorageManager + implements AutoCloseable +{ + private final MicroMigrater migrater ; + private VersionedRoot versionRoot ; + + private VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager; + + /** + * @param tunnelingManager which will be used as the underlying storage manager. + * Almost all methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + * @param migrater which is used as source for the migration scripts + */ + public VersionAgnosticMigrationEmbeddedStorageManager( + VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager, + MicroMigrater migrater + ) + { + this.tunnelingManager = Objects.requireNonNull(tunnelingManager); + this.migrater = Objects.requireNonNull(migrater); + } + + protected VersionAgnosticTunnelingEmbeddedStorageManager getTunnelingManager() + { + return this.tunnelingManager; + } + + /** + * {@inheritDoc} + *

+ * Checks if the root object is of the instance of {@link Versioned}. + * If it is not, the root will be replaced with the versioned root and the actual root object + * will be put inside the versioned root. + *

+ * After starting the storage manager, all the available update scripts are executed in order + * until the newest version of the datastore is reached. + */ + public SELF start() + { + this.tunnelingManager.start(); + if(this.tunnelingManager.root() instanceof VersionedRoot) + { + this.versionRoot = (VersionedRoot)this.tunnelingManager.root(); + } + else + { + //Build VersionedRoot around actual root, set by user. + this.versionRoot = new VersionedRoot(this.tunnelingManager.root()); + this.tunnelingManager.setRoot(versionRoot); + this.tunnelingManager.storeRoot(); + } + new VersionAgnosticMigrationManager( + this.versionRoot, + migrater, + this.tunnelingManager + ) + .migrate(this.versionRoot.getRoot()); + return (SELF)this; + } + + /** + * @return current version that's managed + */ + public MigrationVersion getCurrentVersion() + { + return this.versionRoot.getVersion(); + } + + public Object root() { + return this.versionRoot.getRoot(); + } + + public Object setRoot(Object newRoot) { + this.versionRoot.setRoot(newRoot); + return newRoot; + } + + public long storeRoot() { + this.tunnelingManager.store(this.versionRoot); + return this.tunnelingManager.store(this.versionRoot.getRoot()); + } + + public long store(Object objectToStore) { + return this.tunnelingManager.store(objectToStore); + } + + @Override public void close() + { + this.tunnelingManager.close(); + } +} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java similarity index 75% rename from microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java rename to core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index 3a9ed59..201d5b1 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -1,14 +1,13 @@ -package software.xdev.micromigration.microstream; - -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Supplier; +package software.xdev.micromigration.microstream.versionagnostic; import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Supplier; /** @@ -21,30 +20,30 @@ * @author Johannes Rabauer * */ -public class MigrationManager implements software.xdev.micromigration.MigrationManager +public class VersionAgnosticMigrationManager { private final Supplier currentVersionGetter; private final Consumer currentVersionSetter; private final Consumer currentVersionStorer; private final MicroMigrater migrater ; - private final EmbeddedStorageManager storageManager ; + private final VersionAgnosticTunnelingEmbeddedStorageManager storageManager ; /** - * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * Much more complicated constructor than {@link VersionAgnosticMigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. * * @param currentVersionGetter which supplies the current version of the object to update. * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManager + public VersionAgnosticMigrationManager ( final Supplier currentVersionGetter, final Consumer currentVersionSetter, final Consumer currentVersionStorer, final MicroMigrater migrater , - final EmbeddedStorageManager storageManager + final VersionAgnosticTunnelingEmbeddedStorageManager storageManager ) { Objects.requireNonNull(currentVersionGetter); @@ -63,15 +62,15 @@ public class MigrationManager implements software.xdev.micromigration.MigrationM * Simple Constructor. * * @param versionedObject which provides getter and setter for the current version. - * This object will be stored after the {@link MigrationScript}s are executed. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. + * This object will be stored after the {@link VersionAgnosticMigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. */ - public MigrationManager + public VersionAgnosticMigrationManager ( final Versioned versionedObject, final MicroMigrater migrater , - final EmbeddedStorageManager storageManager + final VersionAgnosticTunnelingEmbeddedStorageManager storageManager ) { this( @@ -94,7 +93,7 @@ public void migrate(Object objectToMigrate) // Execute Updates final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( versionBeforeUpdate, - new TunnelingEmbeddedStorageManager(this.storageManager), + this.storageManager, objectToMigrate ); //Update stored version, if needed diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java new file mode 100644 index 0000000..e98e16f --- /dev/null +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java @@ -0,0 +1,37 @@ +package software.xdev.micromigration.microstream.versionagnostic; + +import software.xdev.micromigration.version.Versioned; + + +/** + * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. + * + * @author Johannes Rabauer + * + */ + public interface VersionAgnosticTunnelingEmbeddedStorageManager + extends VersionAgnosticEmbeddedStorageManager, AutoCloseable +{ + T start(); + Object root(); + Object setRoot(Object newRoot); + long storeRoot(); + boolean shutdown(); + boolean isAcceptingTasks(); + boolean isRunning(); + boolean isStartingUp(); + boolean isShuttingDown(); + void checkAcceptingTasks(); + long initializationTime(); + long operationModeTime(); + boolean isActive(); + boolean issueGarbageCollection(long nanoTimeBudget); + boolean issueFileCheck(long nanoTimeBudget); + long store(Object instance); + T getNativeStorageManager(); + void close(); +} diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 485e2dc..a81ba4a 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -1,34 +1,36 @@ package software.xdev.micromigration.migrater; -import java.time.LocalDateTime; -import java.util.Objects; -import java.util.TreeSet; -import java.util.function.Consumer; - import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import software.xdev.micromigration.notification.ScriptExecutionNotificationWithScriptReference; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.TreeSet; +import java.util.function.Consumer; + /** - * Provides the basic functionality to apply {@link MigrationScript}s to + * Provides the basic functionality to apply {@link VersionAgnosticMigrationScript}s to * a datastore. * * @author Johannes Rabauer */ public abstract class AbstractMigrater implements MicroMigrater { - private Consumer notificationConsumer = null; + private List> notificationConsumers = new ArrayList<>(); /** * Registers a callback to take action when a script is executed. * @param notificationConsumer is executed when a script is used from this migrater. */ - public void setNotificationConsumer(Consumer notificationConsumer) + public void registerNotificationConsumer(Consumer notificationConsumer) { - this.notificationConsumer = notificationConsumer; + this.notificationConsumers.add(notificationConsumer); } @Override @@ -41,7 +43,7 @@ public MigrationVersion migrateToNewest( Objects.requireNonNull(fromVersion); Objects.requireNonNull(storageManager); - TreeSet> sortedScripts = getSortedScripts(); + TreeSet> sortedScripts = getSortedScripts(); if(sortedScripts.size() > 0) { return migrateToVersion( @@ -68,7 +70,7 @@ public MigrationVersion migrateToNewest( Objects.requireNonNull(storageManager); MigrationVersion updateVersionWhichWasExecuted = fromVersion; - for (MigrationScript script : this.getSortedScripts()) + for (VersionAgnosticMigrationScript script : this.getSortedScripts()) { if(MigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) { @@ -76,22 +78,22 @@ public MigrationVersion migrateToNewest( { LocalDateTime startDate = null; MigrationVersion versionBeforeUpdate = updateVersionWhichWasExecuted; - if(this.notificationConsumer != null) + if(!this.notificationConsumers.isEmpty()) { startDate = LocalDateTime.now(); } updateVersionWhichWasExecuted = migrateWithScript(script, storageManager, objectToMigrate); - if(this.notificationConsumer != null) + if(!this.notificationConsumers.isEmpty()) { - this.notificationConsumer.accept( + ScriptExecutionNotificationWithScriptReference scriptNotification = new ScriptExecutionNotificationWithScriptReference( - script , - versionBeforeUpdate , - updateVersionWhichWasExecuted, - startDate , + script, + versionBeforeUpdate, + updateVersionWhichWasExecuted, + startDate, LocalDateTime.now() - ) - ); + ); + this.notificationConsumers.forEach(consumer -> consumer.accept(scriptNotification)); } } } @@ -101,7 +103,7 @@ public MigrationVersion migrateToNewest( @SuppressWarnings("unchecked") private MigrationVersion migrateWithScript( - MigrationScript script , + VersionAgnosticMigrationScript script , VersionAgnosticEmbeddedStorageManager storageManager , Object objectToMigrate ) @@ -112,15 +114,15 @@ private MigrationVersion migrateWithScript( } /** - * Checks if the given {@link MigrationScript} is not already registered in the + * Checks if the given {@link VersionAgnosticMigrationScript} is not already registered in the * {@link #getSortedScripts()}. * @throws VersionAlreadyRegisteredException if script is already registered. * @param scriptToCheck It's target version is checked, if it is not already registered. */ - protected void checkIfVersionIsAlreadyRegistered(MigrationScript scriptToCheck) + protected void checkIfVersionIsAlreadyRegistered(VersionAgnosticMigrationScript scriptToCheck) { //Check if same version is not already registered - for (MigrationScript alreadyRegisteredScript : this.getSortedScripts()) + for (VersionAgnosticMigrationScript alreadyRegisteredScript : this.getSortedScripts()) { if(MigrationVersion.COMPARATOR.compare(alreadyRegisteredScript.getTargetVersion(), scriptToCheck.getTargetVersion()) == 0) { diff --git a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java index 17a6416..b5ccdec 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java @@ -1,8 +1,8 @@ package software.xdev.micromigration.migrater; -import java.util.TreeSet; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; -import software.xdev.micromigration.scripts.MigrationScript; +import java.util.TreeSet; /** * Contains all the available scripts to migrate the datastore to a certain version. @@ -14,16 +14,17 @@ */ public class ExplicitMigrater extends AbstractMigrater { - private final TreeSet> sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); + private final TreeSet> sortedScripts = new TreeSet<>( + VersionAgnosticMigrationScript.COMPARATOR); /** * @param scripts are all the scripts that are executed, if the current version is lower than this of the script
* Versions of the scripts must be unique. That means that no version is allowed multiple times in the migrater. * @throws VersionAlreadyRegisteredException if two scripts have the same version */ - public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRegisteredException + public ExplicitMigrater(VersionAgnosticMigrationScript...scripts) throws VersionAlreadyRegisteredException { - for (MigrationScript script : scripts) + for (VersionAgnosticMigrationScript script : scripts) { checkIfVersionIsAlreadyRegistered(script); this.sortedScripts.add(script); @@ -31,7 +32,7 @@ public ExplicitMigrater(MigrationScript ...scripts) throws VersionAlreadyRe } @Override - public TreeSet> getSortedScripts() { + public TreeSet> getSortedScripts() { return this.sortedScripts; } } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index 466d989..cad1bf9 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater; -import java.util.TreeSet; - import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; +import java.util.TreeSet; + /** * Executes all the available scripts to migrate the datastore to a certain version. @@ -17,9 +17,9 @@ public interface MicroMigrater { /** - * @return all the contained {@link MigrationScript}s, sorted by their {@link MigrationVersion} ascending. + * @return all the contained {@link VersionAgnosticMigrationScript}s, sorted by their {@link MigrationVersion} ascending. */ - TreeSet> getSortedScripts(); + TreeSet> getSortedScripts(); /** * Executes all the scripts that are available to the migrater. @@ -34,10 +34,10 @@ public interface MicroMigrater * @param fromVersion is the current version of the datastore. * Scripts for lower versions then the fromVersion are not executed. * - * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(Context)} + * @param storageManager is relayed to the scripts {@link VersionAgnosticMigrationScript#migrate(Context)} * method. This way the script can call {@link VersionAgnosticEmbeddedStorageManager#store(Object)} or another method on the storage manager. * - * @param root is relayed to the scripts {@link MigrationScript#migrate(Context)} + * @param root is relayed to the scripts {@link VersionAgnosticMigrationScript#migrate(Context)} * method. This way the script can change something within the root object. * * @return the target version of the last executed script @@ -64,10 +64,10 @@ MigrationVersion migrateToNewest( * @param targetVersion is the highest allowed script version. * Scripts which have a higher version won't be exectued. * - * @param storageManager is relayed to the scripts {@link MigrationScript#migrate(Context)} + * @param storageManager is relayed to the scripts {@link VersionAgnosticMigrationScript#migrate(Context)} * method. This way the script can call EmbeddedStorageManager#store or another method on the storage manager. * - * @param objectToMigrate is relayed to the scripts {@link MigrationScript#migrate(Context)} + * @param objectToMigrate is relayed to the scripts {@link VersionAgnosticMigrationScript#migrate(Context)} * method. This way the script can change something within the object to migrate. * * @return the target version of the last executed script diff --git a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java index 108ec97..ac1b021 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -1,9 +1,9 @@ package software.xdev.micromigration.migrater; -import java.util.Objects; - +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import software.xdev.micromigration.scripts.MigrationScript; + +import java.util.Objects; /** @@ -21,12 +21,12 @@ public class VersionAlreadyRegisteredException extends Error /** * The version of the already registered script */ - private final MigrationScript alreadyRegisteredScript ; + private final VersionAgnosticMigrationScript alreadyRegisteredScript ; /** * The script with the same version as {@link #alreadyRegisteredScript}, * which should be registered as well */ - private final MigrationScript newScriptToRegister ; + private final VersionAgnosticMigrationScript newScriptToRegister ; /** * @param alreadyRegisteredVersion The version of the already registered script @@ -36,8 +36,8 @@ public class VersionAlreadyRegisteredException extends Error */ public VersionAlreadyRegisteredException( MigrationVersion alreadyRegisteredVersion, - MigrationScript alreadyRegisteredScript , - MigrationScript newScriptToRegister + VersionAgnosticMigrationScript alreadyRegisteredScript , + VersionAgnosticMigrationScript newScriptToRegister ) { super("Version " + alreadyRegisteredVersion.toString() + " is already registered. Versions must be unique within the migrater."); @@ -57,7 +57,7 @@ public MigrationVersion getAlreadyRegisteredVersion() /** * @return the already registered script with the same version */ - public MigrationScript getAlreadyRegisteredScript() + public VersionAgnosticMigrationScript getAlreadyRegisteredScript() { return alreadyRegisteredScript; } @@ -66,7 +66,7 @@ public MigrationScript getAlreadyRegisteredScript() * @return the script with the same version as {@link #getAlreadyRegisteredScript()}, * which should be registered as well */ - public MigrationScript getNewScriptToRegister() + public VersionAgnosticMigrationScript getNewScriptToRegister() { return newScriptToRegister; } diff --git a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java index 9ed6f18..c26a7f4 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java +++ b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java @@ -1,7 +1,6 @@ package software.xdev.micromigration.notification; import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; import java.time.LocalDateTime; diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java index bc8681a..cb21885 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.notification; -import java.time.LocalDateTime; - import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; +import java.time.LocalDateTime; + /** * Contains data about the execution of a script by a {@link MicroMigrater}. * @@ -13,7 +13,7 @@ */ public class ScriptExecutionNotificationWithScriptReference extends AbstractScriptExecutionNotification { - private final MigrationScript executedScript; + private final VersionAgnosticMigrationScript executedScript; /** * @param executedScript script that was executed @@ -23,7 +23,7 @@ public class ScriptExecutionNotificationWithScriptReference extends AbstractScri * @param endDate time when the script has finished */ public ScriptExecutionNotificationWithScriptReference( - MigrationScript executedScript, + VersionAgnosticMigrationScript executedScript, MigrationVersion sourceVersion , MigrationVersion targetVersion , LocalDateTime startDate , @@ -42,7 +42,7 @@ public ScriptExecutionNotificationWithScriptReference( /** * @return the script that was executed */ - public MigrationScript getExecutedScript() + public VersionAgnosticMigrationScript getExecutedScript() { return executedScript; } diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java index 580ba6e..4f599b3 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java @@ -1,8 +1,11 @@ package software.xdev.micromigration.notification; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; + + /** * Same as {@link ScriptExecutionNotificationWithScriptReference} but instead of referencing - * the {@link software.xdev.micromigration.scripts.MigrationScript} directly, only the name of the script is + * the {@link VersionAgnosticMigrationScript} directly, only the name of the script is * extracted through the class name. *

* "Why?!" - If you want to persist say a history of your applied scripts in your database and diff --git a/core/src/main/java/software/xdev/micromigration/scripts/Context.java b/core/src/main/java/software/xdev/micromigration/scripts/Context.java index 8cc87aa..4e26688 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/Context.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/Context.java @@ -4,7 +4,7 @@ /** - * Container that holds necessary information for the execution of an {@link MigrationScript} + * Container that holds necessary information for the execution of an {@link VersionAgnosticMigrationScript} * * @author Johannes Rabauer */ diff --git a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java index 05606bf..ef90700 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -1,9 +1,9 @@ package software.xdev.micromigration.scripts; -import java.util.ArrayList; - import software.xdev.micromigration.version.MigrationVersion; +import java.util.ArrayList; + /** * Script which creates the target version of the script through the class name. @@ -28,7 +28,7 @@ * @author Johannes Rabauer * */ -public abstract class ReflectiveVersionMigrationScript implements MigrationScript +public abstract class ReflectiveVersionMigrationScript implements VersionAgnosticMigrationScript { private final static char PREFIX = 'v'; private final static String VERSION_SEPERATOR = "_"; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java index cbea800..7802e33 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java @@ -1,10 +1,10 @@ package software.xdev.micromigration.scripts; +import software.xdev.micromigration.version.MigrationVersion; + import java.util.Objects; import java.util.function.Consumer; -import software.xdev.micromigration.version.MigrationVersion; - /** * Provides a simple way to create a migration script with the necessary version @@ -13,7 +13,7 @@ * @author Johannes Rabauer * */ -public class SimpleTypedMigrationScript implements MigrationScript +public class SimpleTypedMigrationScript implements VersionAgnosticMigrationScript { private final MigrationVersion version ; private final Consumer> consumer; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java similarity index 82% rename from core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java rename to core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java index 2ec732d..39910ec 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/MigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java @@ -1,21 +1,21 @@ package software.xdev.micromigration.scripts; -import java.util.Comparator; - import software.xdev.micromigration.version.MigrationVersion; +import java.util.Comparator; + /** * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link MigrationScript#migrate(Context)} method is called, + * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MigrationScript +public interface VersionAgnosticMigrationScript { /** * @return the version of the datastore after this script is executed. @@ -33,6 +33,6 @@ public interface MigrationScript /** * Provides a {@link Comparator} that compares the {@link #getTargetVersion()} of the given scripts */ - Comparator> COMPARATOR = + Comparator> COMPARATOR = (o1, o2) -> MigrationVersion.COMPARATOR.compare(o1.getTargetVersion(), o2.getTargetVersion()); } diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 0ee2cb2..44159cf 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -34,6 +34,12 @@ microstream-configuration ${microstream.version} + + software.xdev + micro-migration-core + 0.0.7-SNAPSHOT + compile + diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 946ebe5..6eb8cf1 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -29,7 +29,6 @@ public class MigrationEmbeddedStorage * @param migrater which is used as source for the migration scripts * @return the created storage manager with the given migrater */ - @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) { Objects.requireNonNull(migrater); diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index b358b83..b8223df 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,13 +1,10 @@ package software.xdev.micromigration.microstream; -import java.util.Objects; - -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import software.xdev.micromigration.version.VersionedRoot; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** @@ -15,16 +12,14 @@ *

* Basically it intercepts storing the root object and places a {@link software.xdev.micromigration.version.Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link software.xdev.micromigration.microstream.MigrationManager} to do the actual migration. + * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. * * @author Johannes Rabauer * */ -public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager +public class MigrationEmbeddedStorageManager + extends VersionAgnosticMigrationEmbeddedStorageManager { - private final MicroMigrater migrater ; - private VersionedRoot versionRoot ; - /** * @param nativeManager which will be used as the underlying storage manager. * Almost all methods are only rerouted to this native manager. @@ -37,66 +32,6 @@ public MigrationEmbeddedStorageManager( MicroMigrater migrater ) { - super(nativeManager); - Objects.requireNonNull(migrater); - this.migrater = migrater; - } - - /** - * {@inheritDoc} - *

- * Checks if the root object is of the instance of {@link Versioned}. - * If it is not, the root will be replaced with the versioned root and the actual root object - * will be put inside the versioned root. - *

- * After starting the storage manager, all the available update scripts are executed in order - * until the newest version of the datastore is reached. - */ - @Override - public MigrationEmbeddedStorageManager start() - { - this.nativeManager.start(); - if(this.nativeManager.root() instanceof VersionedRoot) - { - this.versionRoot = (VersionedRoot)this.nativeManager.root(); - } - else - { - //Build VersionedRoot around actual root, set by user. - this.versionRoot = new VersionedRoot(this.nativeManager.root()); - nativeManager.setRoot(versionRoot); - nativeManager.storeRoot(); - } - new MigrationManager( - this.versionRoot, - migrater, - this - ) - .migrate(this.versionRoot.getRoot()); - return this; - } - - /** - * @return current version that's managed - */ - public MigrationVersion getCurrentVersion() - { - return this.versionRoot.getVersion(); - } - - @Override - public Object root() { - return this.versionRoot.getRoot(); - } - - @Override - public Object setRoot(Object newRoot) { - this.versionRoot.setRoot(newRoot); - return newRoot; - } - - @Override - public long storeRoot() { - return this.nativeManager.store(this.versionRoot); + super(new TunnelingEmbeddedStorageManager(nativeManager), migrater); } } diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 3a9ed59..e00da40 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,107 +1,31 @@ package software.xdev.micromigration.microstream; -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Supplier; - +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import java.util.function.Consumer; +import java.util.function.Supplier; -/** - * Manages a given object and keeps the version for it. - *

- * Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} - * multiple versioned objects can be used in one datastore. - * - * @author Johannes Rabauer - * - */ -public class MigrationManager implements software.xdev.micromigration.MigrationManager -{ - private final Supplier currentVersionGetter; - private final Consumer currentVersionSetter; - private final Consumer currentVersionStorer; - private final MicroMigrater migrater ; - private final EmbeddedStorageManager storageManager ; - /** - * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. - * - * @param currentVersionGetter which supplies the current version of the object to update. - * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. - * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. - */ - public MigrationManager - ( - final Supplier currentVersionGetter, - final Consumer currentVersionSetter, - final Consumer currentVersionStorer, - final MicroMigrater migrater , - final EmbeddedStorageManager storageManager - ) - { - Objects.requireNonNull(currentVersionGetter); - Objects.requireNonNull(currentVersionSetter); - Objects.requireNonNull(currentVersionStorer); - Objects.requireNonNull(migrater); - Objects.requireNonNull(storageManager); - this.currentVersionGetter = currentVersionGetter; - this.currentVersionSetter = currentVersionSetter; - this.currentVersionStorer = currentVersionStorer; - this.migrater = migrater; - this.storageManager = storageManager; - } - - /** - * Simple Constructor. - * - * @param versionedObject which provides getter and setter for the current version. - * This object will be stored after the {@link MigrationScript}s are executed. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. - */ - public MigrationManager - ( - final Versioned versionedObject, - final MicroMigrater migrater , - final EmbeddedStorageManager storageManager - ) +public class MigrationManager extends VersionAgnosticMigrationManager +{ + public MigrationManager( + Supplier currentVersionGetter, + Consumer currentVersionSetter, + Consumer currentVersionStorer, + MicroMigrater migrater, + EmbeddedStorageManager storageManager) { - this( - ( ) -> versionedObject.getVersion() , - (version) -> versionedObject.setVersion(version) , - (version) -> storageManager.store(versionedObject), - migrater , - storageManager - ); - Objects.requireNonNull(versionedObject); + super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new TunnelingEmbeddedStorageManager(storageManager)); } - /** - * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. - * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon - */ - public void migrate(Object objectToMigrate) + public MigrationManager( + Versioned versionedObject, MicroMigrater migrater, + EmbeddedStorageManager storageManager) { - final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); - // Execute Updates - final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( - versionBeforeUpdate, - new TunnelingEmbeddedStorageManager(this.storageManager), - objectToMigrate - ); - //Update stored version, if needed - if(!versionAfterUpdate.equals(versionBeforeUpdate)) - { - currentVersionSetter.accept(versionAfterUpdate); - currentVersionStorer.accept(versionAfterUpdate); - } + super(versionedObject, migrater, new TunnelingEmbeddedStorageManager(storageManager)); } } diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 48df48b..4066284 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,18 +1,18 @@ package software.xdev.micromigration.microstream; import software.xdev.micromigration.scripts.Context; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; /** * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link software.xdev.micromigration.scripts.MigrationScript#migrate(Context)} method is called, + * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MigrationScript extends software.xdev.micromigration.scripts.MigrationScript +public interface MigrationScript extends VersionAgnosticMigrationScript {} diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 153f7b9..350b09c 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,7 +1,5 @@ package software.xdev.micromigration.microstream; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import software.xdev.micromigration.version.Versioned; import one.microstream.afs.types.AFile; import one.microstream.collections.types.XGettingEnum; import one.microstream.persistence.binary.types.Binary; @@ -21,6 +19,8 @@ import one.microstream.storage.types.StorageLiveFileProvider; import one.microstream.storage.types.StorageRawFileStatistics; import one.microstream.storage.types.StorageTypeDictionary; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; import java.util.Objects; import java.util.function.Predicate; @@ -36,7 +36,10 @@ * @author Johannes Rabauer * */ -public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager +public class TunnelingEmbeddedStorageManager + implements + EmbeddedStorageManager, + VersionAgnosticTunnelingEmbeddedStorageManager { /** * The underlying, actual MicroStream EmbeddedStorageManager diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index 7224e0a..c473b09 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,27 +1,26 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.nio.file.Path; -import java.util.concurrent.atomic.AtomicBoolean; - +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedObject; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; class MigrationScriptAfterScriptTest { @@ -40,7 +39,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with one migration script - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -53,7 +52,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -68,13 +67,13 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem @Test void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); final AtomicBoolean notificationReceived = new AtomicBoolean(false); - migrater.setNotificationConsumer( + migrater.registerNotificationConsumer( notification -> { Assertions.assertEquals(firstScript, notification.getExecutedScript()); @@ -104,7 +103,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with one migration script - final MigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); @@ -124,7 +123,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with two migration scripts - final MigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 8bc4f52..df5e060 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,20 +1,20 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.nio.file.Path; - +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; + +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; class MultipleScriptsTest @@ -22,11 +22,11 @@ class MultipleScriptsTest @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -41,11 +41,11 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir @Test void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); @@ -57,15 +57,15 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) @Test void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); - final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(3) ); diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 51b1ccc..cbfee9c 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,20 +1,20 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import java.io.IOException; -import java.nio.file.Path; - +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; + +import java.io.IOException; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; class StoreStuffInMigrationStorageManagerTest @@ -32,7 +32,7 @@ private static class ChildClass @Test void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final MigrationScript script = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> {} ); diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index cf32f3a..ecfaf2c 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.testUtil; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class MicroMigrationScriptDummy implements MigrationScript +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index ccc2682..d91b874 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -41,40 +41,14 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 - - - attach-sources - - jar - - - org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 - - ${java.version} - UTF-8 - false - - - - attach-javadocs - - jar - - - + org.apache.maven.plugins maven-resources-plugin - 3.3.0 - - UTF-8 - @@ -84,57 +58,9 @@ release - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.1 - - - attach-javadoc - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - attach-source - - jar - - - - org.jreleaser jreleaser-maven-plugin - 1.3.1 - - - - ALWAYS - true - - - - - - ALWAYS - https://s01.oss.sonatype.org/service/local; - false - false - target/staging-deploy - - - - - - diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index a6676ef..dcc90d1 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,23 +1,22 @@ package software.xdev.micromigration.microstream; -import java.nio.file.Path; -import java.util.Objects; - -import software.xdev.micromigration.migrater.MicroMigrater; import one.microstream.afs.nio.types.NioFileSystem; -import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import one.microstream.storage.types.Storage; import one.microstream.storage.types.StorageConfiguration; +import software.xdev.micromigration.migrater.MicroMigrater; + +import java.nio.file.Path; +import java.util.Objects; /** - * Provides static utility calls to create the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} for + * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. - * + * * @author Johannes Rabauer - * + * */ public class MigrationEmbeddedStorage { @@ -30,7 +29,6 @@ public class MigrationEmbeddedStorage * @param migrater which is used as source for the migration scripts * @return the created storage manager with the given migrater */ - @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) { Objects.requireNonNull(migrater); diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index b358b83..03cc219 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,30 +1,46 @@ package software.xdev.micromigration.microstream; -import java.util.Objects; - -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import one.microstream.afs.types.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; +import one.microstream.reference.Reference; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.exceptions.StorageException; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import software.xdev.micromigration.version.VersionedRoot; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.function.Predicate; /** * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link software.xdev.micromigration.version.Versioned} + * Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link software.xdev.micromigration.microstream.MigrationManager} to do the actual migration. + * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. * * @author Johannes Rabauer * */ -public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager +public class MigrationEmbeddedStorageManager + extends VersionAgnosticMigrationEmbeddedStorageManager + implements EmbeddedStorageManager { - private final MicroMigrater migrater ; - private VersionedRoot versionRoot ; - /** * @param nativeManager which will be used as the underlying storage manager. * Almost all methods are only rerouted to this native manager. @@ -37,66 +53,198 @@ public MigrationEmbeddedStorageManager( MicroMigrater migrater ) { - super(nativeManager); - Objects.requireNonNull(migrater); - this.migrater = migrater; + super(nativeManager, migrater); } - /** - * {@inheritDoc} - *

- * Checks if the root object is of the instance of {@link Versioned}. - * If it is not, the root will be replaced with the versioned root and the actual root object - * will be put inside the versioned root. - *

- * After starting the storage manager, all the available update scripts are executed in order - * until the newest version of the datastore is reached. - */ - @Override - public MigrationEmbeddedStorageManager start() - { - this.nativeManager.start(); - if(this.nativeManager.root() instanceof VersionedRoot) - { - this.versionRoot = (VersionedRoot)this.nativeManager.root(); - } - else - { - //Build VersionedRoot around actual root, set by user. - this.versionRoot = new VersionedRoot(this.nativeManager.root()); - nativeManager.setRoot(versionRoot); - nativeManager.storeRoot(); - } - new MigrationManager( - this.versionRoot, - migrater, - this - ) - .migrate(this.versionRoot.getRoot()); - return this; - } + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// - /** - * @return current version that's managed - */ - public MigrationVersion getCurrentVersion() + @Override + public EmbeddedStorageManager startNative() { - return this.versionRoot.getVersion(); + this.getTunnelingManager().start(); + return this; } @Override public Object root() { - return this.versionRoot.getRoot(); + return this.getTunnelingManager().root(); } @Override public Object setRoot(Object newRoot) { - this.versionRoot.setRoot(newRoot); - return newRoot; + return this.getTunnelingManager().setRoot(newRoot); } @Override public long storeRoot() { - return this.nativeManager.store(this.versionRoot); + return this.getTunnelingManager().storeRoot(); } + + @Override + public StorageConfiguration configuration() + { + return this.getTunnelingManager().configuration(); + } + + @Override + public StorageTypeDictionary typeDictionary() + { + return this.getTunnelingManager().typeDictionary(); + } + + @Override + public boolean shutdown() + { + return this.getTunnelingManager().shutdown(); + } + + @Override + public void close() throws StorageException + { + this.getTunnelingManager().close(); + } + + @Override + public StorageConnection createConnection() + { + return this.getTunnelingManager().createConnection(); + } + + + @Override + public PersistenceRootsView viewRoots() + { + return this.getTunnelingManager().viewRoots(); + } + + @Override + @Deprecated + public Reference defaultRoot() + { + return this.getTunnelingManager().defaultRoot(); + } + + @Override + public Database database() + { + return this.getTunnelingManager().database(); + } + + @Override + public boolean isAcceptingTasks() + { + return this.getTunnelingManager().isAcceptingTasks(); + } + + @Override + public boolean isRunning() + { + return this.getTunnelingManager().isRunning(); + } + + @Override + public boolean isStartingUp() + { + return this.getTunnelingManager().isStartingUp(); + } + + @Override + public boolean isShuttingDown() + { + return this.getTunnelingManager().isShuttingDown(); + } + + @Override + public void checkAcceptingTasks() + { + this.getTunnelingManager().checkAcceptingTasks(); + } + + @Override + public long initializationTime() + { + return this.getTunnelingManager().initializationTime(); + } + + @Override + public long operationModeTime() + { + return this.getTunnelingManager().operationModeTime(); + } + + @Override + public boolean isActive() + { + return this.getTunnelingManager().isActive(); + } + + @Override + public boolean issueGarbageCollection(long nanoTimeBudget) + { + return this.getTunnelingManager().issueGarbageCollection(nanoTimeBudget); + } + + @Override + public boolean issueFileCheck(long nanoTimeBudget) + { + return this.getTunnelingManager().issueFileCheck(nanoTimeBudget); + } + + @Override + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) + { + return this.getTunnelingManager().issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.getTunnelingManager().createStorageStatistics(); + } + + @Override + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + { + this.getTunnelingManager().exportChannels(fileProvider, performGarbageCollection); + } + + @Override + public StorageEntityTypeExportStatistics exportTypes( + StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) + { + return this.getTunnelingManager().exportTypes(exportFileProvider, isExportType); + } + + @Override + public void importFiles(XGettingEnum importFiles) + { + this.getTunnelingManager().importFiles(importFiles); + } + + @Override + public PersistenceManager persistenceManager() + { + return this.getTunnelingManager().persistenceManager(); + } + + @Override + public long store(Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.getTunnelingManager(); + } + + @Override + public void issueFullBackup(StorageLiveFileProvider targetFileProvider, + PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.getTunnelingManager().issueFullBackup(targetFileProvider, typeDictionaryExporter); + } + } diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java deleted file mode 100644 index 3a9ed59..0000000 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ /dev/null @@ -1,107 +0,0 @@ -package software.xdev.micromigration.microstream; - -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.scripts.MigrationScript; -import software.xdev.micromigration.version.MigrationVersion; -import software.xdev.micromigration.version.Versioned; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; - - -/** - * Manages a given object and keeps the version for it. - *

- * Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} - * multiple versioned objects can be used in one datastore. - * - * @author Johannes Rabauer - * - */ -public class MigrationManager implements software.xdev.micromigration.MigrationManager -{ - private final Supplier currentVersionGetter; - private final Consumer currentVersionSetter; - private final Consumer currentVersionStorer; - private final MicroMigrater migrater ; - private final EmbeddedStorageManager storageManager ; - - /** - * Much more complicated constructor than {@link MigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. - * - * @param currentVersionGetter which supplies the current version of the object to update. - * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. - * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. - */ - public MigrationManager - ( - final Supplier currentVersionGetter, - final Consumer currentVersionSetter, - final Consumer currentVersionStorer, - final MicroMigrater migrater , - final EmbeddedStorageManager storageManager - ) - { - Objects.requireNonNull(currentVersionGetter); - Objects.requireNonNull(currentVersionSetter); - Objects.requireNonNull(currentVersionStorer); - Objects.requireNonNull(migrater); - Objects.requireNonNull(storageManager); - this.currentVersionGetter = currentVersionGetter; - this.currentVersionSetter = currentVersionSetter; - this.currentVersionStorer = currentVersionStorer; - this.migrater = migrater; - this.storageManager = storageManager; - } - - /** - * Simple Constructor. - * - * @param versionedObject which provides getter and setter for the current version. - * This object will be stored after the {@link MigrationScript}s are executed. - * @param migrater does the actual migration with the given {@link MigrationScript} - * @param storageManager for the {@link MigrationScript}s to use. Is not used for the storing of the new version. - */ - public MigrationManager - ( - final Versioned versionedObject, - final MicroMigrater migrater , - final EmbeddedStorageManager storageManager - ) - { - this( - ( ) -> versionedObject.getVersion() , - (version) -> versionedObject.setVersion(version) , - (version) -> storageManager.store(versionedObject), - migrater , - storageManager - ); - Objects.requireNonNull(versionedObject); - } - - /** - * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. - * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon - */ - public void migrate(Object objectToMigrate) - { - final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); - // Execute Updates - final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( - versionBeforeUpdate, - new TunnelingEmbeddedStorageManager(this.storageManager), - objectToMigrate - ); - //Update stored version, if needed - if(!versionAfterUpdate.equals(versionBeforeUpdate)) - { - currentVersionSetter.accept(versionAfterUpdate); - currentVersionStorer.accept(versionAfterUpdate); - } - } -} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 48df48b..6ae8679 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,18 +1,19 @@ package software.xdev.micromigration.microstream; -import software.xdev.micromigration.scripts.Context; import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; /** * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link software.xdev.micromigration.scripts.MigrationScript#migrate(Context)} method is called, + * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MigrationScript extends software.xdev.micromigration.scripts.MigrationScript +public interface MigrationScript extends VersionAgnosticMigrationScript {} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java deleted file mode 100644 index 028ce0a..0000000 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ /dev/null @@ -1,251 +0,0 @@ -package software.xdev.micromigration.microstream; - -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import software.xdev.micromigration.version.Versioned; -import one.microstream.afs.types.AFile; -import one.microstream.collections.types.XGettingEnum; -import one.microstream.persistence.binary.types.Binary; -import one.microstream.persistence.types.PersistenceManager; -import one.microstream.persistence.types.PersistenceRootsView; -import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; -import one.microstream.reference.Reference; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import one.microstream.storage.exceptions.StorageException; -import one.microstream.storage.types.Database; -import one.microstream.storage.types.StorageConfiguration; -import one.microstream.storage.types.StorageConnection; -import one.microstream.storage.types.StorageEntityCacheEvaluator; -import one.microstream.storage.types.StorageEntityTypeExportFileProvider; -import one.microstream.storage.types.StorageEntityTypeExportStatistics; -import one.microstream.storage.types.StorageEntityTypeHandler; -import one.microstream.storage.types.StorageLiveFileProvider; -import one.microstream.storage.types.StorageRawFileStatistics; -import one.microstream.storage.types.StorageTypeDictionary; - -import java.util.Objects; -import java.util.function.Predicate; - - -/** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. - *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. - * - * @author Johannes Rabauer - * - */ -public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager -{ - /** - * The underlying, actual MicroStream EmbeddedStorageManager - */ - protected final EmbeddedStorageManager nativeManager; - - /** - * @param nativeManager which will be used as the underlying storage manager. - * All methods are only rerouted to this native manager. - * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted - * and a {@link Versioned} is placed between the requests. - */ - public TunnelingEmbeddedStorageManager( - EmbeddedStorageManager nativeManager - ) - { - Objects.requireNonNull(nativeManager); - this.nativeManager = nativeManager; - } - - //////////////////////////////////////////////////////////////// - // Simply forward all the methods - //////////////////////////////////////////////////////////////// - - @Override - public TunnelingEmbeddedStorageManager start() - { - this.nativeManager.start(); - return this; - } - - @Override - public Object root() { - return this.nativeManager.root(); - } - - @Override - public Object setRoot(Object newRoot) { - return this.nativeManager.setRoot(newRoot); - } - - @Override - public long storeRoot() { - return this.nativeManager.storeRoot(); - } - - @Override - public StorageConfiguration configuration() - { - return this.nativeManager.configuration(); - } - - @Override - public StorageTypeDictionary typeDictionary() - { - return this.nativeManager.typeDictionary(); - } - - @Override - public boolean shutdown() - { - return this.nativeManager.shutdown(); - } - - @Override - public void close() throws StorageException - { - this.nativeManager.close(); - } - - @Override - public StorageConnection createConnection() - { - return this.nativeManager.createConnection(); - } - - - @Override - public PersistenceRootsView viewRoots() - { - return this.nativeManager.viewRoots(); - } - - @Override - @Deprecated - public Reference defaultRoot() - { - return this.nativeManager.defaultRoot(); - } - - @Override - public Database database() - { - return this.nativeManager.database(); - } - - @Override - public boolean isAcceptingTasks() - { - return this.nativeManager.isAcceptingTasks(); - } - - @Override - public boolean isRunning() - { - return this.nativeManager.isRunning(); - } - - @Override - public boolean isStartingUp() - { - return this.nativeManager.isStartingUp(); - } - - @Override - public boolean isShuttingDown() - { - return this.nativeManager.isShuttingDown(); - } - - @Override - public void checkAcceptingTasks() - { - this.nativeManager.checkAcceptingTasks(); - } - - @Override - public long initializationTime() - { - return this.nativeManager.initializationTime(); - } - - @Override - public long operationModeTime() - { - return this.nativeManager.operationModeTime(); - } - - @Override - public boolean isActive() - { - return this.nativeManager.isActive(); - } - - @Override - public boolean issueGarbageCollection(long nanoTimeBudget) - { - return this.nativeManager.issueGarbageCollection(nanoTimeBudget); - } - - @Override - public boolean issueFileCheck(long nanoTimeBudget) - { - return this.nativeManager.issueFileCheck(nanoTimeBudget); - } - - @Override - public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) - { - return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); - } - - @Override - public StorageRawFileStatistics createStorageStatistics() - { - return this.nativeManager.createStorageStatistics(); - } - - @Override - public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) - { - this.nativeManager.exportChannels(fileProvider, performGarbageCollection); - } - - @Override - public StorageEntityTypeExportStatistics exportTypes( - StorageEntityTypeExportFileProvider exportFileProvider, - Predicate isExportType) - { - return this.nativeManager.exportTypes(exportFileProvider, isExportType); - } - - @Override - public void importFiles(XGettingEnum importFiles) - { - this.nativeManager.importFiles(importFiles); - } - - @Override - public PersistenceManager persistenceManager() - { - return this.nativeManager.persistenceManager(); - } - - @Override - public long store(Object instance) - { - return EmbeddedStorageManager.super.store(instance); - } - - @Override public EmbeddedStorageManager getNativeStorageManager() - { - return this.nativeManager; - } - - @Override - public void issueFullBackup(StorageLiveFileProvider targetFileProvider, - PersistenceTypeDictionaryExporter typeDictionaryExporter) { - this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); - } - - } diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 9651585..48cf2e4 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,21 +1,16 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.io.IOException; -import java.nio.file.Path; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; -import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import java.io.IOException; +import java.nio.file.Path; class IntroduceMigrationOnExistingDatastoreTest diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index 7224e0a..d7d9351 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,27 +1,23 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.nio.file.Path; -import java.util.concurrent.atomic.AtomicBoolean; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationManager; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedObject; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; class MigrationScriptAfterScriptTest { @@ -40,7 +36,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with one migration script - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -53,7 +49,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -68,13 +64,13 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem @Test void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); final AtomicBoolean notificationReceived = new AtomicBoolean(false); - migrater.setNotificationConsumer( + migrater.registerNotificationConsumer( notification -> { Assertions.assertEquals(firstScript, notification.getExecutedScript()); @@ -104,7 +100,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with one migration script - final MigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); @@ -124,7 +120,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with two migration scripts - final MigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 8bc4f52..67353ba 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,20 +1,16 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.nio.file.Path; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; -import software.xdev.micromigration.scripts.MigrationScript; -import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; -import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +import java.nio.file.Path; class MultipleScriptsTest @@ -22,11 +18,11 @@ class MultipleScriptsTest @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -41,11 +37,11 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir @Test void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); @@ -57,15 +53,15 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) @Test void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); - final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(3) ); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 51b1ccc..5e6dfee 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,20 +1,18 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.scripts.MigrationScript; -import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; -import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; class StoreStuffInMigrationStorageManagerTest @@ -32,7 +30,7 @@ private static class ChildClass @Test void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final MigrationScript script = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> {} ); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index badc98f..6314b3a 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,21 +1,17 @@ package software.xdev.micromigration.migrater; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.nio.file.Path; - -import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; + class ExplicitMigraterTest { diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index cf32f3a..ecfaf2c 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.testUtil; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class MicroMigrationScriptDummy implements MigrationScript +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index a6676ef..dcc90d1 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,23 +1,22 @@ package software.xdev.micromigration.microstream; -import java.nio.file.Path; -import java.util.Objects; - -import software.xdev.micromigration.migrater.MicroMigrater; import one.microstream.afs.nio.types.NioFileSystem; -import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import one.microstream.storage.types.Storage; import one.microstream.storage.types.StorageConfiguration; +import software.xdev.micromigration.migrater.MicroMigrater; + +import java.nio.file.Path; +import java.util.Objects; /** - * Provides static utility calls to create the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} for + * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. - * + * * @author Johannes Rabauer - * + * */ public class MigrationEmbeddedStorage { @@ -30,7 +29,6 @@ public class MigrationEmbeddedStorage * @param migrater which is used as source for the migration scripts * @return the created storage manager with the given migrater */ - @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) { Objects.requireNonNull(migrater); diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index a386b73..03cc219 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,30 +1,46 @@ package software.xdev.micromigration.microstream; -import java.util.Objects; - -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import one.microstream.afs.types.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; +import one.microstream.reference.Reference; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.exceptions.StorageException; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; -import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import software.xdev.micromigration.version.VersionedRoot; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.function.Predicate; /** * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link software.xdev.micromigration.version.Versioned} + * Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link software.xdev.micromigration.microstream.MigrationManager} to do the actual migration. - * + * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. + * * @author Johannes Rabauer - * + * */ -public class MigrationEmbeddedStorageManager extends TunnelingEmbeddedStorageManager +public class MigrationEmbeddedStorageManager + extends VersionAgnosticMigrationEmbeddedStorageManager + implements EmbeddedStorageManager { - private final MicroMigrater migrater ; - private VersionedRoot versionRoot ; - /** * @param nativeManager which will be used as the underlying storage manager. * Almost all methods are only rerouted to this native manager. @@ -37,66 +53,198 @@ public MigrationEmbeddedStorageManager( MicroMigrater migrater ) { - super(nativeManager); - Objects.requireNonNull(migrater); - this.migrater = migrater; + super(nativeManager, migrater); } - /** - * {@inheritDoc} - *

- * Checks if the root object is of the instance of {@link Versioned}. - * If it is not, the root will be replaced with the versioned root and the actual root object - * will be put inside the versioned root. - *

- * After starting the storage manager, all the available update scripts are executed in order - * until the newest version of the datastore is reached. - */ - @Override - public MigrationEmbeddedStorageManager start() - { - this.nativeManager.start(); - if(this.nativeManager.root() instanceof VersionedRoot) - { - this.versionRoot = (VersionedRoot)this.nativeManager.root(); - } - else - { - //Build VersionedRoot around actual root, set by user. - this.versionRoot = new VersionedRoot(this.nativeManager.root()); - nativeManager.setRoot(versionRoot); - nativeManager.storeRoot(); - } - new MigrationManager( - this.versionRoot, - migrater, - this - ) - .migrate(this.versionRoot.getRoot()); - return this; - } + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// - /** - * @return current version that's managed - */ - public MigrationVersion getCurrentVersion() + @Override + public EmbeddedStorageManager startNative() { - return this.versionRoot.getVersion(); + this.getTunnelingManager().start(); + return this; } @Override public Object root() { - return this.versionRoot.getRoot(); + return this.getTunnelingManager().root(); } @Override public Object setRoot(Object newRoot) { - this.versionRoot.setRoot(newRoot); - return newRoot; + return this.getTunnelingManager().setRoot(newRoot); } @Override public long storeRoot() { - return this.nativeManager.store(this.versionRoot); + return this.getTunnelingManager().storeRoot(); } + + @Override + public StorageConfiguration configuration() + { + return this.getTunnelingManager().configuration(); + } + + @Override + public StorageTypeDictionary typeDictionary() + { + return this.getTunnelingManager().typeDictionary(); + } + + @Override + public boolean shutdown() + { + return this.getTunnelingManager().shutdown(); + } + + @Override + public void close() throws StorageException + { + this.getTunnelingManager().close(); + } + + @Override + public StorageConnection createConnection() + { + return this.getTunnelingManager().createConnection(); + } + + + @Override + public PersistenceRootsView viewRoots() + { + return this.getTunnelingManager().viewRoots(); + } + + @Override + @Deprecated + public Reference defaultRoot() + { + return this.getTunnelingManager().defaultRoot(); + } + + @Override + public Database database() + { + return this.getTunnelingManager().database(); + } + + @Override + public boolean isAcceptingTasks() + { + return this.getTunnelingManager().isAcceptingTasks(); + } + + @Override + public boolean isRunning() + { + return this.getTunnelingManager().isRunning(); + } + + @Override + public boolean isStartingUp() + { + return this.getTunnelingManager().isStartingUp(); + } + + @Override + public boolean isShuttingDown() + { + return this.getTunnelingManager().isShuttingDown(); + } + + @Override + public void checkAcceptingTasks() + { + this.getTunnelingManager().checkAcceptingTasks(); + } + + @Override + public long initializationTime() + { + return this.getTunnelingManager().initializationTime(); + } + + @Override + public long operationModeTime() + { + return this.getTunnelingManager().operationModeTime(); + } + + @Override + public boolean isActive() + { + return this.getTunnelingManager().isActive(); + } + + @Override + public boolean issueGarbageCollection(long nanoTimeBudget) + { + return this.getTunnelingManager().issueGarbageCollection(nanoTimeBudget); + } + + @Override + public boolean issueFileCheck(long nanoTimeBudget) + { + return this.getTunnelingManager().issueFileCheck(nanoTimeBudget); + } + + @Override + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) + { + return this.getTunnelingManager().issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.getTunnelingManager().createStorageStatistics(); + } + + @Override + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + { + this.getTunnelingManager().exportChannels(fileProvider, performGarbageCollection); + } + + @Override + public StorageEntityTypeExportStatistics exportTypes( + StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) + { + return this.getTunnelingManager().exportTypes(exportFileProvider, isExportType); + } + + @Override + public void importFiles(XGettingEnum importFiles) + { + this.getTunnelingManager().importFiles(importFiles); + } + + @Override + public PersistenceManager persistenceManager() + { + return this.getTunnelingManager().persistenceManager(); + } + + @Override + public long store(Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.getTunnelingManager(); + } + + @Override + public void issueFullBackup(StorageLiveFileProvider targetFileProvider, + PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.getTunnelingManager().issueFullBackup(targetFileProvider, typeDictionaryExporter); + } + } diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 48df48b..6ae8679 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,18 +1,19 @@ package software.xdev.micromigration.microstream; -import software.xdev.micromigration.scripts.Context; import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; /** * Interface for scripts to migrate / update datastores. *

* One script is supposed to bring a datastore from a lower version to the target version. - * After the {@link software.xdev.micromigration.scripts.MigrationScript#migrate(Context)} method is called, + * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, * the target version is reached. * * @author Johannes Rabauer * */ -public interface MigrationScript extends software.xdev.micromigration.scripts.MigrationScript +public interface MigrationScript extends VersionAgnosticMigrationScript {} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java deleted file mode 100644 index 028ce0a..0000000 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ /dev/null @@ -1,251 +0,0 @@ -package software.xdev.micromigration.microstream; - -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; -import software.xdev.micromigration.version.Versioned; -import one.microstream.afs.types.AFile; -import one.microstream.collections.types.XGettingEnum; -import one.microstream.persistence.binary.types.Binary; -import one.microstream.persistence.types.PersistenceManager; -import one.microstream.persistence.types.PersistenceRootsView; -import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; -import one.microstream.reference.Reference; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import one.microstream.storage.exceptions.StorageException; -import one.microstream.storage.types.Database; -import one.microstream.storage.types.StorageConfiguration; -import one.microstream.storage.types.StorageConnection; -import one.microstream.storage.types.StorageEntityCacheEvaluator; -import one.microstream.storage.types.StorageEntityTypeExportFileProvider; -import one.microstream.storage.types.StorageEntityTypeExportStatistics; -import one.microstream.storage.types.StorageEntityTypeHandler; -import one.microstream.storage.types.StorageLiveFileProvider; -import one.microstream.storage.types.StorageRawFileStatistics; -import one.microstream.storage.types.StorageTypeDictionary; - -import java.util.Objects; -import java.util.function.Predicate; - - -/** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. - *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. - * - * @author Johannes Rabauer - * - */ -public class TunnelingEmbeddedStorageManager implements EmbeddedStorageManager, VersionAgnosticEmbeddedStorageManager -{ - /** - * The underlying, actual MicroStream EmbeddedStorageManager - */ - protected final EmbeddedStorageManager nativeManager; - - /** - * @param nativeManager which will be used as the underlying storage manager. - * All methods are only rerouted to this native manager. - * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted - * and a {@link Versioned} is placed between the requests. - */ - public TunnelingEmbeddedStorageManager( - EmbeddedStorageManager nativeManager - ) - { - Objects.requireNonNull(nativeManager); - this.nativeManager = nativeManager; - } - - //////////////////////////////////////////////////////////////// - // Simply forward all the methods - //////////////////////////////////////////////////////////////// - - @Override - public TunnelingEmbeddedStorageManager start() - { - this.nativeManager.start(); - return this; - } - - @Override - public Object root() { - return this.nativeManager.root(); - } - - @Override - public Object setRoot(Object newRoot) { - return this.nativeManager.setRoot(newRoot); - } - - @Override - public long storeRoot() { - return this.nativeManager.storeRoot(); - } - - @Override - public StorageConfiguration configuration() - { - return this.nativeManager.configuration(); - } - - @Override - public StorageTypeDictionary typeDictionary() - { - return this.nativeManager.typeDictionary(); - } - - @Override - public boolean shutdown() - { - return this.nativeManager.shutdown(); - } - - @Override - public void close() throws StorageException - { - this.nativeManager.close(); - } - - @Override - public StorageConnection createConnection() - { - return this.nativeManager.createConnection(); - } - - - @Override - public PersistenceRootsView viewRoots() - { - return this.nativeManager.viewRoots(); - } - - @Override - @Deprecated - public Reference defaultRoot() - { - return this.nativeManager.defaultRoot(); - } - - @Override - public Database database() - { - return this.nativeManager.database(); - } - - @Override - public boolean isAcceptingTasks() - { - return this.nativeManager.isAcceptingTasks(); - } - - @Override - public boolean isRunning() - { - return this.nativeManager.isRunning(); - } - - @Override - public boolean isStartingUp() - { - return this.nativeManager.isStartingUp(); - } - - @Override - public boolean isShuttingDown() - { - return this.nativeManager.isShuttingDown(); - } - - @Override - public void checkAcceptingTasks() - { - this.nativeManager.checkAcceptingTasks(); - } - - @Override - public long initializationTime() - { - return this.nativeManager.initializationTime(); - } - - @Override - public long operationModeTime() - { - return this.nativeManager.operationModeTime(); - } - - @Override - public boolean isActive() - { - return this.nativeManager.isActive(); - } - - @Override - public boolean issueGarbageCollection(long nanoTimeBudget) - { - return this.nativeManager.issueGarbageCollection(nanoTimeBudget); - } - - @Override - public boolean issueFileCheck(long nanoTimeBudget) - { - return this.nativeManager.issueFileCheck(nanoTimeBudget); - } - - @Override - public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) - { - return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); - } - - @Override - public StorageRawFileStatistics createStorageStatistics() - { - return this.nativeManager.createStorageStatistics(); - } - - @Override - public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) - { - this.nativeManager.exportChannels(fileProvider, performGarbageCollection); - } - - @Override - public StorageEntityTypeExportStatistics exportTypes( - StorageEntityTypeExportFileProvider exportFileProvider, - Predicate isExportType) - { - return this.nativeManager.exportTypes(exportFileProvider, isExportType); - } - - @Override - public void importFiles(XGettingEnum importFiles) - { - this.nativeManager.importFiles(importFiles); - } - - @Override - public PersistenceManager persistenceManager() - { - return this.nativeManager.persistenceManager(); - } - - @Override - public long store(Object instance) - { - return EmbeddedStorageManager.super.store(instance); - } - - @Override public EmbeddedStorageManager getNativeStorageManager() - { - return this.nativeManager; - } - - @Override - public void issueFullBackup(StorageLiveFileProvider targetFileProvider, - PersistenceTypeDictionaryExporter typeDictionaryExporter) { - this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); - } - - } diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 9651585..48cf2e4 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,21 +1,16 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.io.IOException; -import java.nio.file.Path; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; -import software.xdev.micromigration.version.MigrationVersion; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import java.io.IOException; +import java.nio.file.Path; class IntroduceMigrationOnExistingDatastoreTest diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index 7224e0a..d7d9351 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,27 +1,23 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; -import java.nio.file.Path; -import java.util.concurrent.atomic.AtomicBoolean; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationManager; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedObject; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; class MigrationScriptAfterScriptTest { @@ -40,7 +36,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with one migration script - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -53,7 +49,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -68,13 +64,13 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem @Test void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); final AtomicBoolean notificationReceived = new AtomicBoolean(false); - migrater.setNotificationConsumer( + migrater.registerNotificationConsumer( notification -> { Assertions.assertEquals(firstScript, notification.getExecutedScript()); @@ -104,7 +100,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with one migration script - final MigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); @@ -124,7 +120,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with two migration scripts - final MigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 8bc4f52..7171829 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,20 +1,20 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.nio.file.Path; - +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; -import software.xdev.micromigration.scripts.MigrationScript; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; + +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; class MultipleScriptsTest @@ -22,11 +22,11 @@ class MultipleScriptsTest @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -34,18 +34,18 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { assertEquals(2, migrationStorageManager.root()); - Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); } } @Test void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); @@ -57,15 +57,15 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) @Test void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) { - final MigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final MigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); - final MigrationScript thirdScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(3) ); diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 51b1ccc..5e6dfee 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,20 +1,18 @@ package software.xdev.micromigration.integration; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.scripts.MigrationScript; -import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; -import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; class StoreStuffInMigrationStorageManagerTest @@ -32,7 +30,7 @@ private static class ChildClass @Test void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final MigrationScript script = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> {} ); diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index badc98f..6314b3a 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,21 +1,17 @@ package software.xdev.micromigration.migrater; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.nio.file.Path; - -import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; + class ExplicitMigraterTest { diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index cf32f3a..ecfaf2c 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.testUtil; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class MicroMigrationScriptDummy implements MigrationScript +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java index 4d7bb4d..328ea57 100644 --- a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java @@ -1,21 +1,20 @@ package software.xdev.micromigration.migrater; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Modifier; -import java.util.TreeSet; - import org.reflections.Reflections; import org.reflections.scanners.SubTypesScanner; import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; import org.reflections.util.FilterBuilder; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; -import software.xdev.micromigration.scripts.MigrationScript; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Modifier; +import java.util.TreeSet; /** * Contains all the available scripts to migrate the datastore to a certain version. *

- * Searches all implementation of {@link MigrationScript} in the specified package + * Searches all implementation of {@link VersionAgnosticMigrationScript} in the specified package * and it's the sub packages. * * @author Johannes Rabauer @@ -23,10 +22,11 @@ */ public class ReflectiveMigrater extends AbstractMigrater { - private final TreeSet> sortedScripts = new TreeSet<>(MigrationScript.COMPARATOR); + private final TreeSet> sortedScripts = new TreeSet<>( + VersionAgnosticMigrationScript.COMPARATOR); /** - * @param packagePath defines the package in which {@link MigrationScript}s will be searched. + * @param packagePath defines the package in which {@link VersionAgnosticMigrationScript}s will be searched. * Also searches through all sub packages of packagePath * @throws ScriptInstantiationException if a class in the given package could not be instantiated */ @@ -41,12 +41,13 @@ public ReflectiveMigrater(final String packagePath) throws ScriptInstantiationEx .filterInputsBy(new FilterBuilder().includePackage(packagePath)) ); - for (Class scriptClass : reflections.getSubTypesOf(MigrationScript.class)) + for (Class scriptClass : reflections.getSubTypesOf( + VersionAgnosticMigrationScript.class)) { //Only instanciate non abstract classes if(!Modifier.isAbstract(scriptClass.getModifiers())) { - MigrationScript instanciatedScript = instanciateClass(scriptClass); + VersionAgnosticMigrationScript instanciatedScript = instanciateClass(scriptClass); checkIfVersionIsAlreadyRegistered(instanciatedScript); this.sortedScripts.add(instanciatedScript); } @@ -54,7 +55,7 @@ public ReflectiveMigrater(final String packagePath) throws ScriptInstantiationEx } @SuppressWarnings("rawtypes") - private MigrationScript instanciateClass(Class scriptClass) throws ScriptInstantiationException + private VersionAgnosticMigrationScript instanciateClass(Class scriptClass) throws ScriptInstantiationException { try { return scriptClass.getDeclaredConstructor().newInstance(); @@ -71,7 +72,7 @@ private MigrationScript instanciateClass(Class s } @Override - public TreeSet> getSortedScripts() + public TreeSet> getSortedScripts() { return this.sortedScripts; } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java index 70f1eee..356a7f8 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.migrater.scripts.abstractSuperClass; -import software.xdev.micromigration.scripts.MigrationScript; -import software.xdev.micromigration.version.MigrationVersion; import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; -public abstract class AbstractScript implements MigrationScript +public abstract class AbstractScript implements VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java index cf4fcf5..b2589cb 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.errorThrowing; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class ErrorThrowingScript implements MigrationScript +public class ErrorThrowingScript implements VersionAgnosticMigrationScript { public ErrorThrowingScript() { diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java index 4c72a3c..e024fec 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.exceptionThrowing; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class ExceptionThrowingScript implements MigrationScript +public class ExceptionThrowingScript implements VersionAgnosticMigrationScript { public ExceptionThrowingScript() throws Exception { diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java index 33d28f6..8c95b38 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.includeSubPackages; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class ValidScript implements MigrationScript +public class ValidScript implements VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java index 16cf5d1..e9379bb 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.includeSubPackages.subpackage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class ValidScriptInSubpackage implements MigrationScript +public class ValidScriptInSubpackage implements VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java index 72438d9..674ee0a 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class ValidScript implements MigrationScript +public class ValidScript implements VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java index 65603e3..e932011 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.noCorrectConstructor; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class NoCorrectConstructorScript implements MigrationScript +public class NoCorrectConstructorScript implements VersionAgnosticMigrationScript { private final String argument; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java index 2ea5fe8..0ab3b09 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.valid; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.MigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class ValidScript implements MigrationScript +public class ValidScript implements VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() From 723cef34c0ac620dfd07ead64d3ad8b72f2cba6d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 22 Dec 2022 10:39:18 +0100 Subject: [PATCH 172/306] Working refactoring --- ...nosticMigrationEmbeddedStorageManager.java | 6 +- .../VersionAgnosticMigrationManager.java | 6 +- .../migrater/AbstractMigrater.java | 22 +- .../migrater/MicroMigrater.java | 11 +- .../xdev/micromigration/scripts/Context.java | 7 +- .../ReflectiveVersionMigrationScript.java | 3 +- .../scripts/SimpleMigrationScript.java | 9 +- .../scripts/SimpleTypedMigrationScript.java | 3 +- .../VersionAgnosticMigrationScript.java | 3 +- .../ReflectiveVersionMigrationScriptTest.java | 10 +- examples/pom.xml | 4 +- .../explicit/scripts/UpdateToV1_0.java | 8 +- .../explicit/scripts/UpdateToV1_1.java | 8 +- .../notification/MainNotification.java | 5 +- .../practical/embedded/UpdateToV1_0.java | 8 +- .../practical/embedded/UpdateToV2_0.java | 4 +- .../migrationManager/UpdateToV1_0.java | 4 +- .../migrationManager/UpdateToV2_0.java | 4 +- .../reflective/scripts/UpdateToV1_0.java | 8 +- .../reflective/scripts/UpdateToV1_1.java | 8 +- .../microstream/MigrationManager.java | 4 +- .../MigrationScriptAfterScriptTest.java | 4 +- .../integration/MultipleScriptsTest.java | 15 +- ...oreStuffInMigrationStorageManagerTest.java | 3 +- .../migrater/ExplicitMigraterTest.java | 15 +- .../testUtil/MicroMigrationScriptDummy.java | 6 +- .../MigrationEmbeddedStorageManager.java | 215 +-------------- .../microstream/MigrationManager.java | 31 +++ .../microstream/MigrationScript.java | 3 +- .../TunnelingEmbeddedStorageManager.java | 253 ++++++++++++++++++ ...oduceMigrationOnExistingDatastoreTest.java | 7 +- .../MigrationScriptAfterScriptTest.java | 13 +- .../integration/MultipleScriptsTest.java | 21 +- ...oreStuffInMigrationStorageManagerTest.java | 5 +- .../migrater/ExplicitMigraterTest.java | 5 +- .../testUtil/MicroMigrationScriptDummy.java | 6 +- .../MigrationEmbeddedStorageManager.java | 215 +-------------- .../microstream/MigrationManager.java | 31 +++ .../microstream/MigrationScript.java | 3 +- .../TunnelingEmbeddedStorageManager.java | 253 ++++++++++++++++++ ...oduceMigrationOnExistingDatastoreTest.java | 7 +- .../MigrationScriptAfterScriptTest.java | 13 +- .../integration/MultipleScriptsTest.java | 15 +- ...oreStuffInMigrationStorageManagerTest.java | 5 +- .../migrater/ExplicitMigraterTest.java | 5 +- .../testUtil/MicroMigrationScriptDummy.java | 6 +- reflection/pom.xml | 12 +- .../AbstractScript.java | 4 +- .../v1_ValidScript.java | 4 +- .../abstractSuperClass/AbstractScript.java | 5 +- .../abstractSuperClass/ValidScript.java | 4 +- .../errorThrowing/ErrorThrowingScript.java | 8 +- .../ExceptionThrowingScript.java | 8 +- .../includeSubPackages/ValidScript.java | 8 +- .../subpackage/ValidScriptInSubpackage.java | 8 +- .../ValidScript.java | 8 +- .../NoCorrectConstructorScript.java | 8 +- .../reflectiveVersion/v1_ValidScript.java | 6 +- .../migrater/scripts/valid/ValidScript.java | 8 +- 59 files changed, 770 insertions(+), 621 deletions(-) create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java create mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java create mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java index c960aa4..fbc48b1 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -74,7 +74,7 @@ public SELF start() new VersionAgnosticMigrationManager( this.versionRoot, migrater, - this.tunnelingManager + this ) .migrate(this.versionRoot.getRoot()); return (SELF)this; @@ -106,6 +106,10 @@ public long store(Object objectToStore) { return this.tunnelingManager.store(objectToStore); } + public boolean shutdown(){ + return this.tunnelingManager.shutdown(); + } + @Override public void close() { this.tunnelingManager.close(); diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index 201d5b1..08adb5f 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -26,7 +26,7 @@ public class VersionAgnosticMigrationManager private final Consumer currentVersionSetter; private final Consumer currentVersionStorer; private final MicroMigrater migrater ; - private final VersionAgnosticTunnelingEmbeddedStorageManager storageManager ; + private final VersionAgnosticMigrationEmbeddedStorageManager storageManager ; /** * Much more complicated constructor than {@link VersionAgnosticMigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. @@ -43,7 +43,7 @@ public class VersionAgnosticMigrationManager final Consumer currentVersionSetter, final Consumer currentVersionStorer, final MicroMigrater migrater , - final VersionAgnosticTunnelingEmbeddedStorageManager storageManager + final VersionAgnosticMigrationEmbeddedStorageManager storageManager ) { Objects.requireNonNull(currentVersionGetter); @@ -70,7 +70,7 @@ public class VersionAgnosticMigrationManager ( final Versioned versionedObject, final MicroMigrater migrater , - final VersionAgnosticTunnelingEmbeddedStorageManager storageManager + final VersionAgnosticMigrationEmbeddedStorageManager storageManager ) { this( diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index a81ba4a..c7db690 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -1,6 +1,6 @@ package software.xdev.micromigration.migrater; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.notification.ScriptExecutionNotificationWithScriptReference; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -34,9 +34,9 @@ public void registerNotificationConsumer(Consumer> MigrationVersion migrateToNewest( MigrationVersion fromVersion , - VersionAgnosticEmbeddedStorageManager storageManager, + E storageManager, Object root ) { @@ -54,14 +54,15 @@ public MigrationVersion migrateToNewest( ); } return fromVersion; - } - + } + + @SuppressWarnings("unchecked") @Override - public MigrationVersion migrateToVersion + public > MigrationVersion migrateToVersion ( MigrationVersion fromVersion , MigrationVersion targetVersion , - VersionAgnosticEmbeddedStorageManager storageManager , + E storageManager , Object objectToMigrate ) { @@ -72,6 +73,7 @@ public MigrationVersion migrateToNewest( MigrationVersion updateVersionWhichWasExecuted = fromVersion; for (VersionAgnosticMigrationScript script : this.getSortedScripts()) { + VersionAgnosticMigrationScript castedScript = (VersionAgnosticMigrationScript)script; if(MigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) { if(MigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) @@ -82,7 +84,7 @@ public MigrationVersion migrateToNewest( { startDate = LocalDateTime.now(); } - updateVersionWhichWasExecuted = migrateWithScript(script, storageManager, objectToMigrate); + updateVersionWhichWasExecuted = migrateWithScript(castedScript, storageManager, objectToMigrate); if(!this.notificationConsumers.isEmpty()) { ScriptExecutionNotificationWithScriptReference scriptNotification = @@ -102,9 +104,9 @@ public MigrationVersion migrateToNewest( } @SuppressWarnings("unchecked") - private MigrationVersion migrateWithScript( + private > MigrationVersion migrateWithScript( VersionAgnosticMigrationScript script , - VersionAgnosticEmbeddedStorageManager storageManager , + E storageManager , Object objectToMigrate ) { diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index cad1bf9..1765742 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -1,6 +1,7 @@ package software.xdev.micromigration.migrater; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; @@ -14,7 +15,7 @@ * @author Johannes Rabauer * */ -public interface MicroMigrater +public interface MicroMigrater { /** * @return all the contained {@link VersionAgnosticMigrationScript}s, sorted by their {@link MigrationVersion} ascending. @@ -42,9 +43,9 @@ public interface MicroMigrater * * @return the target version of the last executed script */ - MigrationVersion migrateToNewest( + > MigrationVersion migrateToNewest( MigrationVersion fromVersion , - VersionAgnosticEmbeddedStorageManager storageManager, + E storageManager, Object root ); @@ -72,11 +73,11 @@ MigrationVersion migrateToNewest( * * @return the target version of the last executed script */ - MigrationVersion migrateToVersion + > MigrationVersion migrateToVersion ( MigrationVersion fromVersion , MigrationVersion targetVersion , - VersionAgnosticEmbeddedStorageManager storageManager , + E storageManager , Object objectToMigrate ); } diff --git a/core/src/main/java/software/xdev/micromigration/scripts/Context.java b/core/src/main/java/software/xdev/micromigration/scripts/Context.java index 4e26688..49fcfa7 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/Context.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/Context.java @@ -1,8 +1,5 @@ package software.xdev.micromigration.scripts; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; - - /** * Container that holds necessary information for the execution of an {@link VersionAgnosticMigrationScript} * @@ -19,12 +16,12 @@ public class Context */ public Context( final T migratingObject, - final VersionAgnosticEmbeddedStorageManager storageManager + final E storageManager ) { super(); this.migratingObject = migratingObject; - this.storageManager = storageManager.getNativeStorageManager(); + this.storageManager = storageManager; } /** diff --git a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java index ef90700..edf1253 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -1,5 +1,6 @@ package software.xdev.micromigration.scripts; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; import java.util.ArrayList; @@ -28,7 +29,7 @@ * @author Johannes Rabauer * */ -public abstract class ReflectiveVersionMigrationScript implements VersionAgnosticMigrationScript +public abstract class ReflectiveVersionMigrationScript> implements VersionAgnosticMigrationScript { private final static char PREFIX = 'v'; private final static String VERSION_SEPERATOR = "_"; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java index 2cf9714..c27ac46 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java @@ -1,9 +1,10 @@ package software.xdev.micromigration.scripts; -import java.util.function.Consumer; - +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; +import java.util.function.Consumer; + /** * Provides a simple way to create a migration script with the necessary version @@ -12,7 +13,7 @@ * @author Johannes Rabauer * */ -public class SimpleMigrationScript extends SimpleTypedMigrationScript +public class SimpleMigrationScript> extends SimpleTypedMigrationScript { /** * @param targetVersion to which the script is updating the object @@ -20,7 +21,7 @@ public class SimpleMigrationScript extends SimpleTypedMigrationScript> consumer + final Consumer> consumer ) { super(targetVersion, consumer); diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java index 7802e33..4ab437a 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java @@ -1,5 +1,6 @@ package software.xdev.micromigration.scripts; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; import java.util.Objects; @@ -13,7 +14,7 @@ * @author Johannes Rabauer * */ -public class SimpleTypedMigrationScript implements VersionAgnosticMigrationScript +public class SimpleTypedMigrationScript> implements VersionAgnosticMigrationScript { private final MigrationVersion version ; private final Consumer> consumer; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java index 39910ec..16e6375 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java @@ -1,5 +1,6 @@ package software.xdev.micromigration.scripts; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; import java.util.Comparator; @@ -15,7 +16,7 @@ * @author Johannes Rabauer * */ -public interface VersionAgnosticMigrationScript +public interface VersionAgnosticMigrationScript> { /** * @return the version of the datastore after this script is executed. diff --git a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index 83d50b1..b63f364 100644 --- a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -1,12 +1,8 @@ package software.xdev.micromigration.scripts; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; - -import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.ReflectiveVersionMigrationScript; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; class ReflectiveVersionMigrationScriptTest @@ -127,10 +123,10 @@ void testInvalildName_v___InvalidClassName() } - public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript + public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript> { @Override - public void migrate(Context context) { + public void migrate(Context> context) { //Dummy } } diff --git a/examples/pom.xml b/examples/pom.xml index e54c2af..9b01833 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.6 + 0.0.7 MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.6 + 0.0.7 micro-migration diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 2d65e9b..02decd3 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.examples.explicit.scripts; -import java.util.Date; - +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.Date; public class UpdateToV1_0 implements MigrationScript @@ -17,7 +17,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { System.out.println("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index 78b2f15..7db5b20 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.examples.explicit.scripts; -import java.util.Date; - +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.Date; public class UpdateToV1_1 implements MigrationScript @@ -17,7 +17,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { System.out.println("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index 5bf80f3..c2e28d0 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -1,6 +1,5 @@ package software.xdev.micromigration.examples.notification; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; @@ -24,7 +23,7 @@ public static void main(String[] args) final ExplicitMigrater migrater = new ExplicitMigrater( new MainNotification.UpdateToV1_0() ); - migrater.setNotificationConsumer( + migrater.registerNotificationConsumer( scriptExecutionNotification -> System.out.println("Script " + scriptExecutionNotification.getExecutedScript().getClass().getSimpleName() + " executed.") ); final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); @@ -46,7 +45,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index e3785e4..5f72f0c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.examples.practical.embedded; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; +import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; +import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; -import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; public class UpdateToV1_0 implements MigrationScript @@ -18,7 +18,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { System.out.println("Executing Script for v1.0..."); software.xdev.micromigration.examples.practical.v0.BusinessBranch oldBranch = context.getMigratingObject(); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index 3d7911d..3274773 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -2,10 +2,10 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; public class UpdateToV2_0 implements MigrationScript @@ -17,7 +17,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { System.out.println("Executing Script for v2.0..."); final BusinessBranch branch = context.getMigratingObject(); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index b2e4dbf..027cbf1 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -3,11 +3,11 @@ import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; public class UpdateToV1_0 implements MigrationScript> @@ -19,7 +19,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context, EmbeddedStorageManager> context) + public void migrate(Context, MigrationEmbeddedStorageManager> context) { System.out.println("Executing Script for v1.0..."); VersionedObject versionedBranch = context.getMigratingObject(); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 155558b..3eaf293 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -2,11 +2,11 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; public class UpdateToV2_0 implements MigrationScript> @@ -18,7 +18,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context, EmbeddedStorageManager> context) + public void migrate(Context, MigrationEmbeddedStorageManager> context) { System.out.println("Executing Script for v2.0..."); VersionedObject versionedBranch = context.getMigratingObject(); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index 79f2caa..8fa8a35 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.examples.reflective.scripts; -import java.util.Date; - +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.Date; public class UpdateToV1_0 implements MigrationScript @@ -17,7 +17,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { System.out.println("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index 273354f..da1b76c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.examples.reflective.scripts; -import java.util.Date; - +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; + +import java.util.Date; public class UpdateToV1_1 implements MigrationScript @@ -17,7 +17,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { System.out.println("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index e00da40..dfaf8d7 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -19,13 +19,13 @@ public MigrationManager( MicroMigrater migrater, EmbeddedStorageManager storageManager) { - super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new TunnelingEmbeddedStorageManager(storageManager)); + super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } public MigrationManager( Versioned versionedObject, MicroMigrater migrater, EmbeddedStorageManager storageManager) { - super(versionedObject, migrater, new TunnelingEmbeddedStorageManager(storageManager)); + super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } } diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index c473b09..e714a11 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -103,7 +103,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with one migration script - final VersionAgnosticMigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); @@ -123,7 +123,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with two migration scripts - final VersionAgnosticMigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index df5e060..115ba3b 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,6 +1,5 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -22,11 +21,11 @@ class MultipleScriptsTest @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -41,11 +40,11 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir @Test void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); @@ -57,15 +56,15 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) @Test void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); - final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(3) ); diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index cbfee9c..f7f3c9f 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,6 +1,5 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; @@ -32,7 +31,7 @@ private static class ChildClass @Test void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> {} ); diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index badc98f..be6360c 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,21 +1,18 @@ package software.xdev.micromigration.migrater; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.nio.file.Path; - -import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; + class ExplicitMigraterTest { @@ -58,7 +55,7 @@ void testWrongTypedVersionedScript(@TempDir Path storageFolder) storageManager.storeRoot(); } final ExplicitMigrater migrater = new ExplicitMigrater( - new SimpleTypedMigrationScript( + new SimpleTypedMigrationScript( new MigrationVersion(1), (context) -> { context.getStorageManager().setRoot(context.getMigratingObject() + 1); diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index ecfaf2c..1f6b8d9 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.testUtil; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; @@ -22,7 +22,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) { + public void migrate(Context context) { // Don't do anything. } } diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 03cc219..2073bd7 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,31 +1,11 @@ package software.xdev.micromigration.microstream; -import one.microstream.afs.types.AFile; -import one.microstream.collections.types.XGettingEnum; -import one.microstream.persistence.binary.types.Binary; -import one.microstream.persistence.types.PersistenceManager; -import one.microstream.persistence.types.PersistenceRootsView; -import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; -import one.microstream.reference.Reference; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import one.microstream.storage.exceptions.StorageException; -import one.microstream.storage.types.Database; -import one.microstream.storage.types.StorageConfiguration; -import one.microstream.storage.types.StorageConnection; -import one.microstream.storage.types.StorageEntityCacheEvaluator; -import one.microstream.storage.types.StorageEntityTypeExportFileProvider; -import one.microstream.storage.types.StorageEntityTypeExportStatistics; -import one.microstream.storage.types.StorageEntityTypeHandler; -import one.microstream.storage.types.StorageLiveFileProvider; -import one.microstream.storage.types.StorageRawFileStatistics; -import one.microstream.storage.types.StorageTypeDictionary; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; -import java.util.function.Predicate; - /** * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. @@ -39,7 +19,6 @@ */ public class MigrationEmbeddedStorageManager extends VersionAgnosticMigrationEmbeddedStorageManager - implements EmbeddedStorageManager { /** * @param nativeManager which will be used as the underlying storage manager. @@ -53,198 +32,6 @@ public MigrationEmbeddedStorageManager( MicroMigrater migrater ) { - super(nativeManager, migrater); - } - - //////////////////////////////////////////////////////////////// - // Simply forward all the methods - //////////////////////////////////////////////////////////////// - - @Override - public EmbeddedStorageManager startNative() - { - this.getTunnelingManager().start(); - return this; - } - - @Override - public Object root() { - return this.getTunnelingManager().root(); - } - - @Override - public Object setRoot(Object newRoot) { - return this.getTunnelingManager().setRoot(newRoot); - } - - @Override - public long storeRoot() { - return this.getTunnelingManager().storeRoot(); - } - - @Override - public StorageConfiguration configuration() - { - return this.getTunnelingManager().configuration(); - } - - @Override - public StorageTypeDictionary typeDictionary() - { - return this.getTunnelingManager().typeDictionary(); - } - - @Override - public boolean shutdown() - { - return this.getTunnelingManager().shutdown(); - } - - @Override - public void close() throws StorageException - { - this.getTunnelingManager().close(); + super(new TunnelingEmbeddedStorageManager(nativeManager), migrater); } - - @Override - public StorageConnection createConnection() - { - return this.getTunnelingManager().createConnection(); - } - - - @Override - public PersistenceRootsView viewRoots() - { - return this.getTunnelingManager().viewRoots(); - } - - @Override - @Deprecated - public Reference defaultRoot() - { - return this.getTunnelingManager().defaultRoot(); - } - - @Override - public Database database() - { - return this.getTunnelingManager().database(); - } - - @Override - public boolean isAcceptingTasks() - { - return this.getTunnelingManager().isAcceptingTasks(); - } - - @Override - public boolean isRunning() - { - return this.getTunnelingManager().isRunning(); - } - - @Override - public boolean isStartingUp() - { - return this.getTunnelingManager().isStartingUp(); - } - - @Override - public boolean isShuttingDown() - { - return this.getTunnelingManager().isShuttingDown(); - } - - @Override - public void checkAcceptingTasks() - { - this.getTunnelingManager().checkAcceptingTasks(); - } - - @Override - public long initializationTime() - { - return this.getTunnelingManager().initializationTime(); - } - - @Override - public long operationModeTime() - { - return this.getTunnelingManager().operationModeTime(); - } - - @Override - public boolean isActive() - { - return this.getTunnelingManager().isActive(); - } - - @Override - public boolean issueGarbageCollection(long nanoTimeBudget) - { - return this.getTunnelingManager().issueGarbageCollection(nanoTimeBudget); - } - - @Override - public boolean issueFileCheck(long nanoTimeBudget) - { - return this.getTunnelingManager().issueFileCheck(nanoTimeBudget); - } - - @Override - public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) - { - return this.getTunnelingManager().issueCacheCheck(nanoTimeBudget, entityEvaluator); - } - - @Override - public StorageRawFileStatistics createStorageStatistics() - { - return this.getTunnelingManager().createStorageStatistics(); - } - - @Override - public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) - { - this.getTunnelingManager().exportChannels(fileProvider, performGarbageCollection); - } - - @Override - public StorageEntityTypeExportStatistics exportTypes( - StorageEntityTypeExportFileProvider exportFileProvider, - Predicate isExportType) - { - return this.getTunnelingManager().exportTypes(exportFileProvider, isExportType); - } - - @Override - public void importFiles(XGettingEnum importFiles) - { - this.getTunnelingManager().importFiles(importFiles); - } - - @Override - public PersistenceManager persistenceManager() - { - return this.getTunnelingManager().persistenceManager(); - } - - @Override - public long store(Object instance) - { - return EmbeddedStorageManager.super.store(instance); - } - - @Override public EmbeddedStorageManager getNativeStorageManager() - { - return this.getTunnelingManager(); - } - - @Override - public void issueFullBackup(StorageLiveFileProvider targetFileProvider, - PersistenceTypeDictionaryExporter typeDictionaryExporter) { - this.getTunnelingManager().issueFullBackup(targetFileProvider, typeDictionaryExporter); - } - } diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java new file mode 100644 index 0000000..dfaf8d7 --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -0,0 +1,31 @@ +package software.xdev.micromigration.microstream; + +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; + +import java.util.function.Consumer; +import java.util.function.Supplier; + + +public class MigrationManager extends VersionAgnosticMigrationManager +{ + public MigrationManager( + Supplier currentVersionGetter, + Consumer currentVersionSetter, + Consumer currentVersionStorer, + MicroMigrater migrater, + EmbeddedStorageManager storageManager) + { + super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } + + public MigrationManager( + Versioned versionedObject, MicroMigrater migrater, + EmbeddedStorageManager storageManager) + { + super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } +} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 6ae8679..4066284 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,6 +1,5 @@ package software.xdev.micromigration.microstream; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -15,5 +14,5 @@ * @author Johannes Rabauer * */ -public interface MigrationScript extends VersionAgnosticMigrationScript +public interface MigrationScript extends VersionAgnosticMigrationScript {} diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java new file mode 100644 index 0000000..350b09c --- /dev/null +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -0,0 +1,253 @@ +package software.xdev.micromigration.microstream; + +import one.microstream.afs.types.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; +import one.microstream.reference.Reference; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.exceptions.StorageException; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; + +import java.util.Objects; +import java.util.function.Predicate; + + +/** + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManager} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class TunnelingEmbeddedStorageManager + implements + EmbeddedStorageManager, + VersionAgnosticTunnelingEmbeddedStorageManager +{ + /** + * The underlying, actual MicroStream EmbeddedStorageManager + */ + protected final EmbeddedStorageManager nativeManager; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * All methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + */ + public TunnelingEmbeddedStorageManager( + EmbeddedStorageManager nativeManager + ) + { + Objects.requireNonNull(nativeManager); + this.nativeManager = nativeManager; + } + + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// + + @Override + public TunnelingEmbeddedStorageManager start() + { + this.nativeManager.start(); + return this; + } + + @Override + public Object root() { + return this.nativeManager.root(); + } + + @Override + public Object setRoot(Object newRoot) { + return this.nativeManager.setRoot(newRoot); + } + + @Override + public long storeRoot() { + return this.nativeManager.storeRoot(); + } + + @Override + public StorageConfiguration configuration() + { + return this.nativeManager.configuration(); + } + + @Override + public StorageTypeDictionary typeDictionary() + { + return this.nativeManager.typeDictionary(); + } + + @Override + public boolean shutdown() + { + return this.nativeManager.shutdown(); + } + + @Override + public void close() throws StorageException + { + this.nativeManager.close(); + } + + @Override + public StorageConnection createConnection() + { + return this.nativeManager.createConnection(); + } + + + @Override + public PersistenceRootsView viewRoots() + { + return this.nativeManager.viewRoots(); + } + + @Override + @Deprecated + public Reference defaultRoot() + { + return this.nativeManager.defaultRoot(); + } + + @Override + public Database database() + { + return this.nativeManager.database(); + } + + @Override + public boolean isAcceptingTasks() + { + return this.nativeManager.isAcceptingTasks(); + } + + @Override + public boolean isRunning() + { + return this.nativeManager.isRunning(); + } + + @Override + public boolean isStartingUp() + { + return this.nativeManager.isStartingUp(); + } + + @Override + public boolean isShuttingDown() + { + return this.nativeManager.isShuttingDown(); + } + + @Override + public void checkAcceptingTasks() + { + this.nativeManager.checkAcceptingTasks(); + } + + @Override + public long initializationTime() + { + return this.nativeManager.initializationTime(); + } + + @Override + public long operationModeTime() + { + return this.nativeManager.operationModeTime(); + } + + @Override + public boolean isActive() + { + return this.nativeManager.isActive(); + } + + @Override + public boolean issueGarbageCollection(long nanoTimeBudget) + { + return this.nativeManager.issueGarbageCollection(nanoTimeBudget); + } + + @Override + public boolean issueFileCheck(long nanoTimeBudget) + { + return this.nativeManager.issueFileCheck(nanoTimeBudget); + } + + @Override + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) + { + return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.nativeManager.createStorageStatistics(); + } + + @Override + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + { + this.nativeManager.exportChannels(fileProvider, performGarbageCollection); + } + + @Override + public StorageEntityTypeExportStatistics exportTypes( + StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) + { + return this.nativeManager.exportTypes(exportFileProvider, isExportType); + } + + @Override + public void importFiles(XGettingEnum importFiles) + { + this.nativeManager.importFiles(importFiles); + } + + @Override + public PersistenceManager persistenceManager() + { + return this.nativeManager.persistenceManager(); + } + + @Override + public long store(Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.nativeManager; + } + + @Override + public void issueFullBackup(StorageLiveFileProvider targetFileProvider, + PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); + } +} diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 48cf2e4..ebd46b8 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -2,9 +2,10 @@ import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; @@ -12,6 +13,8 @@ import java.io.IOException; import java.nio.file.Path; +import static org.junit.jupiter.api.Assertions.assertEquals; + class IntroduceMigrationOnExistingDatastoreTest { @@ -32,7 +35,7 @@ void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { assertEquals(ROOT, migrationStorageManager.root()); - Assertions.assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); + assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); } } } diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index d7d9351..e714a11 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -5,6 +5,9 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -36,7 +39,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with one migration script - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -49,7 +52,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -64,7 +67,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem @Test void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -100,7 +103,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with one migration script - final VersionAgnosticMigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); @@ -120,7 +123,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with two migration scripts - final VersionAgnosticMigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 67353ba..0c431fb 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,9 +1,10 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; @@ -12,17 +13,19 @@ import java.nio.file.Path; +import static org.junit.jupiter.api.Assertions.assertEquals; + class MultipleScriptsTest { @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -30,18 +33,18 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { assertEquals(2, migrationStorageManager.root()); - Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); } } @Test void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); @@ -53,15 +56,15 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) @Test void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); - final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(3) ); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 5e6dfee..f7f3c9f 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,8 +1,9 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -30,7 +31,7 @@ private static class ChildClass @Test void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> {} ); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 6314b3a..be6360c 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,9 +1,10 @@ package software.xdev.micromigration.migrater; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; @@ -54,7 +55,7 @@ void testWrongTypedVersionedScript(@TempDir Path storageFolder) storageManager.storeRoot(); } final ExplicitMigrater migrater = new ExplicitMigrater( - new SimpleTypedMigrationScript( + new SimpleTypedMigrationScript( new MigrationVersion(1), (context) -> { context.getStorageManager().setRoot(context.getMigratingObject() + 1); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index ecfaf2c..1f6b8d9 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.testUtil; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; @@ -22,7 +22,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) { + public void migrate(Context context) { // Don't do anything. } } diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 03cc219..2073bd7 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,31 +1,11 @@ package software.xdev.micromigration.microstream; -import one.microstream.afs.types.AFile; -import one.microstream.collections.types.XGettingEnum; -import one.microstream.persistence.binary.types.Binary; -import one.microstream.persistence.types.PersistenceManager; -import one.microstream.persistence.types.PersistenceRootsView; -import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; -import one.microstream.reference.Reference; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import one.microstream.storage.exceptions.StorageException; -import one.microstream.storage.types.Database; -import one.microstream.storage.types.StorageConfiguration; -import one.microstream.storage.types.StorageConnection; -import one.microstream.storage.types.StorageEntityCacheEvaluator; -import one.microstream.storage.types.StorageEntityTypeExportFileProvider; -import one.microstream.storage.types.StorageEntityTypeExportStatistics; -import one.microstream.storage.types.StorageEntityTypeHandler; -import one.microstream.storage.types.StorageLiveFileProvider; -import one.microstream.storage.types.StorageRawFileStatistics; -import one.microstream.storage.types.StorageTypeDictionary; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; -import java.util.function.Predicate; - /** * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. @@ -39,7 +19,6 @@ */ public class MigrationEmbeddedStorageManager extends VersionAgnosticMigrationEmbeddedStorageManager - implements EmbeddedStorageManager { /** * @param nativeManager which will be used as the underlying storage manager. @@ -53,198 +32,6 @@ public MigrationEmbeddedStorageManager( MicroMigrater migrater ) { - super(nativeManager, migrater); - } - - //////////////////////////////////////////////////////////////// - // Simply forward all the methods - //////////////////////////////////////////////////////////////// - - @Override - public EmbeddedStorageManager startNative() - { - this.getTunnelingManager().start(); - return this; - } - - @Override - public Object root() { - return this.getTunnelingManager().root(); - } - - @Override - public Object setRoot(Object newRoot) { - return this.getTunnelingManager().setRoot(newRoot); - } - - @Override - public long storeRoot() { - return this.getTunnelingManager().storeRoot(); - } - - @Override - public StorageConfiguration configuration() - { - return this.getTunnelingManager().configuration(); - } - - @Override - public StorageTypeDictionary typeDictionary() - { - return this.getTunnelingManager().typeDictionary(); - } - - @Override - public boolean shutdown() - { - return this.getTunnelingManager().shutdown(); - } - - @Override - public void close() throws StorageException - { - this.getTunnelingManager().close(); + super(new TunnelingEmbeddedStorageManager(nativeManager), migrater); } - - @Override - public StorageConnection createConnection() - { - return this.getTunnelingManager().createConnection(); - } - - - @Override - public PersistenceRootsView viewRoots() - { - return this.getTunnelingManager().viewRoots(); - } - - @Override - @Deprecated - public Reference defaultRoot() - { - return this.getTunnelingManager().defaultRoot(); - } - - @Override - public Database database() - { - return this.getTunnelingManager().database(); - } - - @Override - public boolean isAcceptingTasks() - { - return this.getTunnelingManager().isAcceptingTasks(); - } - - @Override - public boolean isRunning() - { - return this.getTunnelingManager().isRunning(); - } - - @Override - public boolean isStartingUp() - { - return this.getTunnelingManager().isStartingUp(); - } - - @Override - public boolean isShuttingDown() - { - return this.getTunnelingManager().isShuttingDown(); - } - - @Override - public void checkAcceptingTasks() - { - this.getTunnelingManager().checkAcceptingTasks(); - } - - @Override - public long initializationTime() - { - return this.getTunnelingManager().initializationTime(); - } - - @Override - public long operationModeTime() - { - return this.getTunnelingManager().operationModeTime(); - } - - @Override - public boolean isActive() - { - return this.getTunnelingManager().isActive(); - } - - @Override - public boolean issueGarbageCollection(long nanoTimeBudget) - { - return this.getTunnelingManager().issueGarbageCollection(nanoTimeBudget); - } - - @Override - public boolean issueFileCheck(long nanoTimeBudget) - { - return this.getTunnelingManager().issueFileCheck(nanoTimeBudget); - } - - @Override - public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) - { - return this.getTunnelingManager().issueCacheCheck(nanoTimeBudget, entityEvaluator); - } - - @Override - public StorageRawFileStatistics createStorageStatistics() - { - return this.getTunnelingManager().createStorageStatistics(); - } - - @Override - public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) - { - this.getTunnelingManager().exportChannels(fileProvider, performGarbageCollection); - } - - @Override - public StorageEntityTypeExportStatistics exportTypes( - StorageEntityTypeExportFileProvider exportFileProvider, - Predicate isExportType) - { - return this.getTunnelingManager().exportTypes(exportFileProvider, isExportType); - } - - @Override - public void importFiles(XGettingEnum importFiles) - { - this.getTunnelingManager().importFiles(importFiles); - } - - @Override - public PersistenceManager persistenceManager() - { - return this.getTunnelingManager().persistenceManager(); - } - - @Override - public long store(Object instance) - { - return EmbeddedStorageManager.super.store(instance); - } - - @Override public EmbeddedStorageManager getNativeStorageManager() - { - return this.getTunnelingManager(); - } - - @Override - public void issueFullBackup(StorageLiveFileProvider targetFileProvider, - PersistenceTypeDictionaryExporter typeDictionaryExporter) { - this.getTunnelingManager().issueFullBackup(targetFileProvider, typeDictionaryExporter); - } - } diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java new file mode 100644 index 0000000..dfaf8d7 --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -0,0 +1,31 @@ +package software.xdev.micromigration.microstream; + +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; + +import java.util.function.Consumer; +import java.util.function.Supplier; + + +public class MigrationManager extends VersionAgnosticMigrationManager +{ + public MigrationManager( + Supplier currentVersionGetter, + Consumer currentVersionSetter, + Consumer currentVersionStorer, + MicroMigrater migrater, + EmbeddedStorageManager storageManager) + { + super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } + + public MigrationManager( + Versioned versionedObject, MicroMigrater migrater, + EmbeddedStorageManager storageManager) + { + super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } +} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 6ae8679..4066284 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,6 +1,5 @@ package software.xdev.micromigration.microstream; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -15,5 +14,5 @@ * @author Johannes Rabauer * */ -public interface MigrationScript extends VersionAgnosticMigrationScript +public interface MigrationScript extends VersionAgnosticMigrationScript {} diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java new file mode 100644 index 0000000..350b09c --- /dev/null +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -0,0 +1,253 @@ +package software.xdev.micromigration.microstream; + +import one.microstream.afs.types.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; +import one.microstream.reference.Reference; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.exceptions.StorageException; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; + +import java.util.Objects; +import java.util.function.Predicate; + + +/** + * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. + *

+ * Basically it intercepts storing the root object and places a {@link Versioned} + * in front of it. This means the root object of the datastore is then versioned.
+ * Internally uses the {@link MigrationManager} to do the actual migration. + * + * @author Johannes Rabauer + * + */ +public class TunnelingEmbeddedStorageManager + implements + EmbeddedStorageManager, + VersionAgnosticTunnelingEmbeddedStorageManager +{ + /** + * The underlying, actual MicroStream EmbeddedStorageManager + */ + protected final EmbeddedStorageManager nativeManager; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * All methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + */ + public TunnelingEmbeddedStorageManager( + EmbeddedStorageManager nativeManager + ) + { + Objects.requireNonNull(nativeManager); + this.nativeManager = nativeManager; + } + + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// + + @Override + public TunnelingEmbeddedStorageManager start() + { + this.nativeManager.start(); + return this; + } + + @Override + public Object root() { + return this.nativeManager.root(); + } + + @Override + public Object setRoot(Object newRoot) { + return this.nativeManager.setRoot(newRoot); + } + + @Override + public long storeRoot() { + return this.nativeManager.storeRoot(); + } + + @Override + public StorageConfiguration configuration() + { + return this.nativeManager.configuration(); + } + + @Override + public StorageTypeDictionary typeDictionary() + { + return this.nativeManager.typeDictionary(); + } + + @Override + public boolean shutdown() + { + return this.nativeManager.shutdown(); + } + + @Override + public void close() throws StorageException + { + this.nativeManager.close(); + } + + @Override + public StorageConnection createConnection() + { + return this.nativeManager.createConnection(); + } + + + @Override + public PersistenceRootsView viewRoots() + { + return this.nativeManager.viewRoots(); + } + + @Override + @Deprecated + public Reference defaultRoot() + { + return this.nativeManager.defaultRoot(); + } + + @Override + public Database database() + { + return this.nativeManager.database(); + } + + @Override + public boolean isAcceptingTasks() + { + return this.nativeManager.isAcceptingTasks(); + } + + @Override + public boolean isRunning() + { + return this.nativeManager.isRunning(); + } + + @Override + public boolean isStartingUp() + { + return this.nativeManager.isStartingUp(); + } + + @Override + public boolean isShuttingDown() + { + return this.nativeManager.isShuttingDown(); + } + + @Override + public void checkAcceptingTasks() + { + this.nativeManager.checkAcceptingTasks(); + } + + @Override + public long initializationTime() + { + return this.nativeManager.initializationTime(); + } + + @Override + public long operationModeTime() + { + return this.nativeManager.operationModeTime(); + } + + @Override + public boolean isActive() + { + return this.nativeManager.isActive(); + } + + @Override + public boolean issueGarbageCollection(long nanoTimeBudget) + { + return this.nativeManager.issueGarbageCollection(nanoTimeBudget); + } + + @Override + public boolean issueFileCheck(long nanoTimeBudget) + { + return this.nativeManager.issueFileCheck(nanoTimeBudget); + } + + @Override + public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) + { + return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.nativeManager.createStorageStatistics(); + } + + @Override + public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) + { + this.nativeManager.exportChannels(fileProvider, performGarbageCollection); + } + + @Override + public StorageEntityTypeExportStatistics exportTypes( + StorageEntityTypeExportFileProvider exportFileProvider, + Predicate isExportType) + { + return this.nativeManager.exportTypes(exportFileProvider, isExportType); + } + + @Override + public void importFiles(XGettingEnum importFiles) + { + this.nativeManager.importFiles(importFiles); + } + + @Override + public PersistenceManager persistenceManager() + { + return this.nativeManager.persistenceManager(); + } + + @Override + public long store(Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.nativeManager; + } + + @Override + public void issueFullBackup(StorageLiveFileProvider targetFileProvider, + PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); + } +} diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 48cf2e4..ebd46b8 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -2,9 +2,10 @@ import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; @@ -12,6 +13,8 @@ import java.io.IOException; import java.nio.file.Path; +import static org.junit.jupiter.api.Assertions.assertEquals; + class IntroduceMigrationOnExistingDatastoreTest { @@ -32,7 +35,7 @@ void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) { assertEquals(ROOT, migrationStorageManager.root()); - Assertions.assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); + assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); } } } diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index d7d9351..e714a11 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -5,6 +5,9 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -36,7 +39,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with one migration script - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -49,7 +52,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -64,7 +67,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem @Test void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); @@ -100,7 +103,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with one migration script - final VersionAgnosticMigrationScript, EmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); @@ -120,7 +123,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem //Run with two migration scripts - final VersionAgnosticMigrationScript, EmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 7171829..0c431fb 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,6 +1,5 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -22,11 +21,11 @@ class MultipleScriptsTest @Test void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); @@ -41,11 +40,11 @@ void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir @Test void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(2) ); @@ -57,15 +56,15 @@ void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) @Test void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) ); - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) ); - final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(3) ); diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 5e6dfee..f7f3c9f 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,8 +1,9 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -30,7 +31,7 @@ private static class ChildClass @Test void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), (context) -> {} ); diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 6314b3a..be6360c 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,9 +1,10 @@ package software.xdev.micromigration.migrater; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; @@ -54,7 +55,7 @@ void testWrongTypedVersionedScript(@TempDir Path storageFolder) storageManager.storeRoot(); } final ExplicitMigrater migrater = new ExplicitMigrater( - new SimpleTypedMigrationScript( + new SimpleTypedMigrationScript( new MigrationVersion(1), (context) -> { context.getStorageManager().setRoot(context.getMigratingObject() + 1); diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index ecfaf2c..1f6b8d9 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.testUtil; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; @@ -22,7 +22,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) { + public void migrate(Context context) { // Don't do anything. } } diff --git a/reflection/pom.xml b/reflection/pom.xml index cd65e5b..ce373be 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -30,15 +30,9 @@ 0.10.2 - one.microstream - microstream-storage-embedded - ${microstream.version} - test - - - one.microstream - microstream-configuration - ${microstream.version} + software.xdev + micro-migration-microstream-v7 + ${project.version} test diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java index 06f7a1b..2012fb0 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java @@ -1,10 +1,10 @@ package software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.ReflectiveVersionMigrationScript; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public abstract class AbstractScript extends ReflectiveVersionMigrationScript +public abstract class AbstractScript extends ReflectiveVersionMigrationScript { } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java index a6075e0..8c6f56a 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java @@ -1,13 +1,13 @@ package software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; public class v1_ValidScript extends AbstractScript { @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java index 356a7f8..7d2f53e 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java @@ -1,11 +1,10 @@ package software.xdev.micromigration.migrater.scripts.abstractSuperClass; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public abstract class AbstractScript implements VersionAgnosticMigrationScript +public abstract class AbstractScript implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java index 1e0d47c..3c9c569 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java @@ -1,13 +1,13 @@ package software.xdev.micromigration.migrater.scripts.abstractSuperClass; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; public class ValidScript extends AbstractScript { @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java index b2589cb..9da0eee 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.errorThrowing; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class ErrorThrowingScript implements VersionAgnosticMigrationScript +public class ErrorThrowingScript implements MigrationScript { public ErrorThrowingScript() { @@ -20,7 +20,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java index e024fec..84c0db9 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.exceptionThrowing; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class ExceptionThrowingScript implements VersionAgnosticMigrationScript +public class ExceptionThrowingScript implements MigrationScript { public ExceptionThrowingScript() throws Exception { @@ -20,7 +20,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java index 8c95b38..54f8efe 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.includeSubPackages; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScript implements VersionAgnosticMigrationScript +public class ValidScript implements MigrationScript { @Override public MigrationVersion getTargetVersion() @@ -15,7 +15,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java index e9379bb..27bac0f 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.includeSubPackages.subpackage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScriptInSubpackage implements VersionAgnosticMigrationScript +public class ValidScriptInSubpackage implements MigrationScript { @Override public MigrationVersion getTargetVersion() @@ -15,7 +15,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java index 674ee0a..e1061df 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScript implements VersionAgnosticMigrationScript +public class ValidScript implements MigrationScript { @Override public MigrationVersion getTargetVersion() @@ -15,7 +15,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java index e932011..ec15b6c 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.noCorrectConstructor; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class NoCorrectConstructorScript implements VersionAgnosticMigrationScript +public class NoCorrectConstructorScript implements MigrationScript { private final String argument; @@ -22,7 +22,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { System.out.println(this.argument); } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java index 303d176..a905aed 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java @@ -1,14 +1,14 @@ package software.xdev.micromigration.migrater.scripts.reflectiveVersion; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.ReflectiveVersionMigrationScript; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; -public class v1_ValidScript extends ReflectiveVersionMigrationScript +public class v1_ValidScript extends ReflectiveVersionMigrationScript { @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java index 0ab3b09..fafad8e 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.valid; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScript implements VersionAgnosticMigrationScript +public class ValidScript implements MigrationScript { @Override public MigrationVersion getTargetVersion() @@ -15,7 +15,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(Context context) { //Do nothing } From 7680c7cbf94df68be31a3783fc32e9c0d37edbcb Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 22 Dec 2022 11:02:58 +0100 Subject: [PATCH 173/306] Slight cleanup --- core/pom.xml | 28 ----------------- ...VersionAgnosticEmbeddedStorageManager.java | 25 --------------- ...nosticTunnelingEmbeddedStorageManager.java | 2 +- .../migrater/MicroMigrater.java | 1 - microstream-v5/pom.xml | 31 ------------------- microstream-v6/pom.xml | 31 ------------------- microstream-v7/pom.xml | 31 ------------------- pom.xml | 12 +++++++ reflection/pom.xml | 31 ------------------- 9 files changed, 13 insertions(+), 179 deletions(-) delete mode 100644 core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java diff --git a/core/pom.xml b/core/pom.xml index 8955cc2..018961e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -13,32 +13,4 @@ micro-migration 0.0.7-SNAPSHOT - - - - - org.apache.maven.plugins - maven-source-plugin - - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - release - - - - org.jreleaser - jreleaser-maven-plugin - - - - - diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java deleted file mode 100644 index 2ab88a6..0000000 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticEmbeddedStorageManager.java +++ /dev/null @@ -1,25 +0,0 @@ -package software.xdev.micromigration.microstream.versionagnostic; - -/** - * To keep MicroStream from being directly referenced, this is a abstraction to keep the - * actual EmbeddedStorageManager concealed. - * - * @param is usually the one.microstream.storage.embedded.types.EmbeddedStorageManager, - * but to keep it version agnostic, this is dynamically typed. - * - * @author Johannes Rabauer - */ -public interface VersionAgnosticEmbeddedStorageManager -{ - /** - * Stores the given object instance - * @param instance to store - * @return the object id representing the passed instance - */ - long store(final Object instance); - - /** - * @return the actual EmbeddedStorageManager - */ - T getNativeStorageManager(); -} diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java index e98e16f..ee466cb 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java @@ -14,7 +14,7 @@ * */ public interface VersionAgnosticTunnelingEmbeddedStorageManager - extends VersionAgnosticEmbeddedStorageManager, AutoCloseable + extends AutoCloseable { T start(); Object root(); diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index 1765742..f598f51 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -1,6 +1,5 @@ package software.xdev.micromigration.migrater; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 44159cf..d115376 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -41,35 +41,4 @@ compile - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - release - - - - org.jreleaser - jreleaser-maven-plugin - - - - - diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index d91b874..a85441d 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -35,35 +35,4 @@ ${microstream.version} - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - release - - - - org.jreleaser - jreleaser-maven-plugin - - - - - diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 7d29236..fb16686 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -35,35 +35,4 @@ ${microstream.version} - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - release - - - - org.jreleaser - jreleaser-maven-plugin - - - - - diff --git a/pom.xml b/pom.xml index 1decbaf..be60a93 100644 --- a/pom.xml +++ b/pom.xml @@ -156,6 +156,18 @@ maven-surefire-plugin 2.22.2 + + org.apache.maven.plugins + maven-source-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + org.apache.maven.plugins + maven-resources-plugin + diff --git a/reflection/pom.xml b/reflection/pom.xml index ce373be..b70e2ca 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -36,35 +36,4 @@ test - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.apache.maven.plugins - maven-resources-plugin - - - - - - - release - - - - org.jreleaser - jreleaser-maven-plugin - - - - - From 0eaeda2ddad4d111d0c6e56622c6a515aeebc4fb Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 22 Dec 2022 15:03:39 +0100 Subject: [PATCH 174/306] Fixed Javadoc --- ...nosticMigrationEmbeddedStorageManager.java | 54 ++++++-- .../VersionAgnosticMigrationManager.java | 39 +++--- ...nosticTunnelingEmbeddedStorageManager.java | 88 +++++++++++- .../migrater/AbstractMigrater.java | 19 ++- .../migrater/MicroMigrater.java | 20 +-- .../VersionAlreadyRegisteredException.java | 4 +- .../examples/explicit/MainExplicit.java | 8 +- .../explicit/scripts/UpdateToV1_0.java | 5 +- .../explicit/scripts/UpdateToV1_1.java | 5 +- .../notification/MainNotification.java | 6 +- ...alWithMigrationEmbeddedStorageManager.java | 3 - .../practical/embedded/UpdateToV1_0.java | 5 +- .../practical/embedded/UpdateToV2_0.java | 5 +- .../MainPracticalWithMigrationManager.java | 6 +- .../migrationManager/UpdateToV1_0.java | 5 +- .../migrationManager/UpdateToV2_0.java | 5 +- .../examples/reflective/MainReflective.java | 6 +- .../reflective/scripts/UpdateToV1_0.java | 5 +- .../reflective/scripts/UpdateToV1_1.java | 5 +- microstream-v5/pom.xml | 6 - .../MigrationEmbeddedStorageManager.java | 10 +- .../microstream/MigrationManager.java | 35 ++++- .../microstream/MigrationScript.java | 4 +- .../TunnelingEmbeddedStorageManager.java | 131 +++++++++++++++++- .../MigrationEmbeddedStorageManager.java | 10 +- .../microstream/MigrationManager.java | 35 ++++- .../microstream/MigrationScript.java | 4 +- .../TunnelingEmbeddedStorageManager.java | 131 +++++++++++++++++- .../MigrationEmbeddedStorageManager.java | 10 +- .../microstream/MigrationManager.java | 35 ++++- .../microstream/MigrationScript.java | 4 +- .../TunnelingEmbeddedStorageManager.java | 131 +++++++++++++++++- .../abstractSuperClass/AbstractScript.java | 4 +- .../errorThrowing/ErrorThrowingScript.java | 4 +- .../ExceptionThrowingScript.java | 4 +- .../includeSubPackages/ValidScript.java | 4 +- .../subpackage/ValidScriptInSubpackage.java | 4 +- .../ValidScript.java | 4 +- .../NoCorrectConstructorScript.java | 4 +- .../migrater/scripts/valid/ValidScript.java | 4 +- 40 files changed, 697 insertions(+), 174 deletions(-) diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java index fbc48b1..abc0e28 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -9,22 +9,28 @@ /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

* Basically it intercepts storing the root object and places a {@link Versioned} * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager} to do the actual migration. + * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. + *

+ * {@code VersionAgnostic} because it should be independent from the actual MicroStream implementation used. + * + * @param class of itself to be able to return the actual class and not just a generic class + * + * @param The actually used MicroStream EmbeddedStorageManager * * @author Johannes Rabauer * */ -public class VersionAgnosticMigrationEmbeddedStorageManager +public abstract class VersionAgnosticMigrationEmbeddedStorageManager implements AutoCloseable { private final MicroMigrater migrater ; private VersionedRoot versionRoot ; - private VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager; + private VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager; /** * @param tunnelingManager which will be used as the underlying storage manager. @@ -34,30 +40,32 @@ public class VersionAgnosticMigrationEmbeddedStorageManager tunnelingManager, - MicroMigrater migrater + VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager, + MicroMigrater migrater ) { this.tunnelingManager = Objects.requireNonNull(tunnelingManager); this.migrater = Objects.requireNonNull(migrater); } - protected VersionAgnosticTunnelingEmbeddedStorageManager getTunnelingManager() + /** + * @return the used {@link VersionAgnosticTunnelingEmbeddedStorageManager} + */ + protected VersionAgnosticTunnelingEmbeddedStorageManager getTunnelingManager() { return this.tunnelingManager; } /** - * {@inheritDoc} - *

* Checks if the root object is of the instance of {@link Versioned}. * If it is not, the root will be replaced with the versioned root and the actual root object * will be put inside the versioned root. *

* After starting the storage manager, all the available update scripts are executed in order * until the newest version of the datastore is reached. + * @return itself */ - public SELF start() + public T start() { this.tunnelingManager.start(); if(this.tunnelingManager.root() instanceof VersionedRoot) @@ -77,7 +85,7 @@ public SELF start() this ) .migrate(this.versionRoot.getRoot()); - return (SELF)this; + return (T)this; } /** @@ -88,28 +96,52 @@ public MigrationVersion getCurrentVersion() return this.versionRoot.getVersion(); } + /** + * @return the actual root object + */ public Object root() { return this.versionRoot.getRoot(); } + /** + * Sets the actual root element (not the versioned root) + * @param newRoot to set + * @return the set object + */ public Object setRoot(Object newRoot) { this.versionRoot.setRoot(newRoot); return newRoot; } + /** + * Stores the {@link VersionedRoot} and the actual root object. + * @return what EmbeddedStorageManager#storeRoot returns + */ public long storeRoot() { this.tunnelingManager.store(this.versionRoot); return this.tunnelingManager.store(this.versionRoot.getRoot()); } + /** + * Stores the objectToStore + * @param objectToStore which is stored + * @return what EmbeddedStorageManager#store returns + */ public long store(Object objectToStore) { return this.tunnelingManager.store(objectToStore); } + /** + * Shuts down the datastore. + * @return what EmbeddedStorageManager#storeRoot shutdown + */ public boolean shutdown(){ return this.tunnelingManager.shutdown(); } + /** + * Closes the datastore. + */ @Override public void close() { this.tunnelingManager.close(); diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index 08adb5f..b7bc7d2 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -13,23 +13,26 @@ /** * Manages a given object and keeps the version for it. *

- * Can be used to keep the version of the MicroStream-Root-Object to keep the whole - * datastore versioned. Since it is not integrated like the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} - * multiple versioned objects can be used in one datastore. - * + * Can be used to keep the version of the MicroStream-Root-Object and therefor keep the whole + * datastore versioned. + *

+ * {@code VersionAgnostic} because it should be independent from the actual MicroStream implementation used. + * + * @param The actually used MicroStream EmbeddedStorageManager + * * @author Johannes Rabauer * */ public class VersionAgnosticMigrationManager { - private final Supplier currentVersionGetter; - private final Consumer currentVersionSetter; - private final Consumer currentVersionStorer; - private final MicroMigrater migrater ; + private final Supplier currentVersionGetter; + private final Consumer currentVersionSetter; + private final Consumer currentVersionStorer; + private final MicroMigrater migrater ; private final VersionAgnosticMigrationEmbeddedStorageManager storageManager ; /** - * Much more complicated constructor than {@link VersionAgnosticMigrationManager#MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * Much more complicated constructor than {@link VersionAgnosticMigrationManager(Versioned, MicroMigrater, VersionAgnosticMigrationEmbeddedStorageManager)}. * * @param currentVersionGetter which supplies the current version of the object to update. * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. @@ -39,11 +42,11 @@ public class VersionAgnosticMigrationManager */ public VersionAgnosticMigrationManager ( - final Supplier currentVersionGetter, - final Consumer currentVersionSetter, - final Consumer currentVersionStorer, - final MicroMigrater migrater , - final VersionAgnosticMigrationEmbeddedStorageManager storageManager + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater , + final VersionAgnosticMigrationEmbeddedStorageManager storageManager ) { Objects.requireNonNull(currentVersionGetter); @@ -54,8 +57,8 @@ public class VersionAgnosticMigrationManager this.currentVersionGetter = currentVersionGetter; this.currentVersionSetter = currentVersionSetter; this.currentVersionStorer = currentVersionStorer; - this.migrater = migrater; - this.storageManager = storageManager; + this.migrater = migrater; + this.storageManager = storageManager; } /** @@ -68,8 +71,8 @@ public class VersionAgnosticMigrationManager */ public VersionAgnosticMigrationManager ( - final Versioned versionedObject, - final MicroMigrater migrater , + final Versioned versionedObject, + final MicroMigrater migrater , final VersionAgnosticMigrationEmbeddedStorageManager storageManager ) { diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java index ee466cb..a36fe1e 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java @@ -1,14 +1,15 @@ package software.xdev.micromigration.microstream.versionagnostic; -import software.xdev.micromigration.version.Versioned; - - /** - * Wrapper class for the MicroStream {@link VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. + *

+ * It's simply an interface to not directly depend on the MicroStream-Framework, but still use its functionality. + * For the separate Versions of MicroStream, a separate Maven-Module was created which implements this + * interface with the actual EmbeddedStorageManager. *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. + * {@code VersionAgnostic} because it should be independent of the actual MicroStream implementation used. + * + * @param Represents the actually used MicroStream EmbeddedStorageManager * * @author Johannes Rabauer * @@ -16,22 +17,95 @@ public interface VersionAgnosticTunnelingEmbeddedStorageManager extends AutoCloseable { + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ T start(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ Object root(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @param newRoot whatever the actual EmbeddedStorageManager uses this for + * @return what the actual EmbeddedStorageManager returns + */ Object setRoot(Object newRoot); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ long storeRoot(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ boolean shutdown(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ boolean isAcceptingTasks(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ boolean isRunning(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ boolean isStartingUp(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ boolean isShuttingDown(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + */ void checkAcceptingTasks(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ long initializationTime(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ long operationModeTime(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @return what the actual EmbeddedStorageManager returns + */ boolean isActive(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @param nanoTimeBudget whatever the actual EmbeddedStorageManager uses this for + * @return what the actual EmbeddedStorageManager returns + */ boolean issueGarbageCollection(long nanoTimeBudget); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @param nanoTimeBudget whatever the actual EmbeddedStorageManager uses this for + * @return what the actual EmbeddedStorageManager returns + */ boolean issueFileCheck(long nanoTimeBudget); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + * @param instance whatever the actual EmbeddedStorageManager uses this for + * @return what the actual EmbeddedStorageManager returns + */ long store(Object instance); + /** + * @return the actual MicroStream EmbeddedStorageManager + */ T getNativeStorageManager(); + /** + * Simply relais the method-call to the MicroStream EmbeddedStorageManager + */ void close(); } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index c7db690..9c4ec6b 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -35,9 +35,9 @@ public void registerNotificationConsumer(Consumer> MigrationVersion migrateToNewest( - MigrationVersion fromVersion , - E storageManager, - Object root + MigrationVersion fromVersion , + E storageManager, + Object root ) { Objects.requireNonNull(fromVersion); @@ -60,10 +60,10 @@ public > Migration @Override public > MigrationVersion migrateToVersion ( - MigrationVersion fromVersion , - MigrationVersion targetVersion , - E storageManager , - Object objectToMigrate + MigrationVersion fromVersion , + MigrationVersion targetVersion , + E storageManager , + Object objectToMigrate ) { Objects.requireNonNull(fromVersion); @@ -106,8 +106,8 @@ public > Migration @SuppressWarnings("unchecked") private > MigrationVersion migrateWithScript( VersionAgnosticMigrationScript script , - E storageManager , - Object objectToMigrate + E storageManager , + Object objectToMigrate ) { T castedObjectToMigrate = (T) objectToMigrate; @@ -137,5 +137,4 @@ protected void checkIfVersionIsAlreadyRegistered(VersionAgnosticMigrationScript< } } } - } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index f598f51..300fd41 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -35,17 +35,19 @@ public interface MicroMigrater * Scripts for lower versions then the fromVersion are not executed. * * @param storageManager is relayed to the scripts {@link VersionAgnosticMigrationScript#migrate(Context)} - * method. This way the script can call {@link VersionAgnosticEmbeddedStorageManager#store(Object)} or another method on the storage manager. + * method. This way the script can call {@link VersionAgnosticMigrationEmbeddedStorageManager#store(Object)} or another method on the storage manager. * * @param root is relayed to the scripts {@link VersionAgnosticMigrationScript#migrate(Context)} * method. This way the script can change something within the root object. + * + * @param the {@link VersionAgnosticMigrationEmbeddedStorageManager} which contains the migrating object * * @return the target version of the last executed script */ > MigrationVersion migrateToNewest( - MigrationVersion fromVersion , - E storageManager, - Object root + MigrationVersion fromVersion , + E storageManager, + Object root ); /** @@ -69,14 +71,16 @@ > MigrationVersion * * @param objectToMigrate is relayed to the scripts {@link VersionAgnosticMigrationScript#migrate(Context)} * method. This way the script can change something within the object to migrate. + * + * @param the {@link VersionAgnosticMigrationEmbeddedStorageManager} which contains the migrating object * * @return the target version of the last executed script */ > MigrationVersion migrateToVersion ( - MigrationVersion fromVersion , - MigrationVersion targetVersion , - E storageManager , - Object objectToMigrate + MigrationVersion fromVersion , + MigrationVersion targetVersion , + E storageManager , + Object objectToMigrate ); } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java index ac1b021..3901cca 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -17,7 +17,7 @@ public class VersionAlreadyRegisteredException extends Error /** * The already registered script with the same version */ - private final MigrationVersion alreadyRegisteredVersion; + private final MigrationVersion alreadyRegisteredVersion; /** * The version of the already registered script */ @@ -35,7 +35,7 @@ public class VersionAlreadyRegisteredException extends Error * which should be registered as well */ public VersionAlreadyRegisteredException( - MigrationVersion alreadyRegisteredVersion, + MigrationVersion alreadyRegisteredVersion, VersionAgnosticMigrationScript alreadyRegisteredScript , VersionAgnosticMigrationScript newScriptToRegister ) diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index 7a2e99c..4627949 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -1,15 +1,11 @@ package software.xdev.micromigration.examples.explicit; -import java.util.Date; - -import software.xdev.micromigration.examples.practical.embedded.UpdateToV2_0; -import software.xdev.micromigration.examples.practical.v0.BusinessBranch; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_0; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_1; import software.xdev.micromigration.migrater.ExplicitMigrater; +import java.util.Date; + /** * The most basic usage of micro migration. * Here two {@link software.xdev.micromigration.scripts.MigrationScript}s are explicitly registered diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 02decd3..984b100 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -1,14 +1,13 @@ package software.xdev.micromigration.examples.explicit.scripts; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_0 implements MigrationScript +public class UpdateToV1_0 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index 7db5b20..c246ebd 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -1,14 +1,13 @@ package software.xdev.micromigration.examples.explicit.scripts; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_1 implements MigrationScript +public class UpdateToV1_1 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index c2e28d0..9eb4a00 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -1,8 +1,5 @@ package software.xdev.micromigration.examples.notification; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; @@ -36,7 +33,8 @@ public static void main(String[] args) storageManager.shutdown(); } - static class UpdateToV1_0 implements MigrationScript + static class UpdateToV1_0 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 753263a..55ce8f0 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -1,9 +1,6 @@ package software.xdev.micromigration.examples.practical.embedded; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; -import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.migrater.ExplicitMigrater; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index 5f72f0c..81dd61b 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -3,13 +3,12 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.Address; import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class UpdateToV1_0 implements MigrationScript +public class UpdateToV1_0 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index 3274773..513ea7d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -2,13 +2,12 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class UpdateToV2_0 implements MigrationScript +public class UpdateToV2_0 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index 428bbd2..9d66570 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -1,12 +1,10 @@ package software.xdev.micromigration.examples.practical.migrationManager; -import software.xdev.micromigration.microstream.MigrationManager; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; -import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.version.VersionedObject; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; /** diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index 027cbf1..1384fbb 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -3,14 +3,13 @@ import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -public class UpdateToV1_0 implements MigrationScript> +public class UpdateToV1_0 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 3eaf293..13438d7 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -2,14 +2,13 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -public class UpdateToV2_0 implements MigrationScript> +public class UpdateToV2_0 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript, software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager> { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index 3cf1848..fdadcfb 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -1,12 +1,10 @@ package software.xdev.micromigration.examples.reflective; -import java.util.Date; - -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ReflectiveMigrater; import software.xdev.micromigration.migrater.ScriptInstantiationException; +import java.util.Date; + /** * Shows the usage of the {@link ReflectiveMigrater}. Very simple. diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index 8fa8a35..5703aa6 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -1,14 +1,13 @@ package software.xdev.micromigration.examples.reflective.scripts; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_0 implements MigrationScript +public class UpdateToV1_0 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index da1b76c..48770ca 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -1,14 +1,13 @@ package software.xdev.micromigration.examples.reflective.scripts; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_1 implements MigrationScript +public class UpdateToV1_1 implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index d115376..c1d86de 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -34,11 +34,5 @@ microstream-configuration ${microstream.version} - - software.xdev - micro-migration-core - 0.0.7-SNAPSHOT - compile - diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index b8223df..fff5347 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -2,17 +2,15 @@ import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; /** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. - *

- * Basically it intercepts storing the root object and places a {@link software.xdev.micromigration.version.Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. + * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationEmbeddedStorageManager * * @author Johannes Rabauer * diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index dfaf8d7..5967cf5 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -3,6 +3,7 @@ import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; @@ -10,21 +11,47 @@ import java.util.function.Supplier; +/** + * Specific implementation of the {@link VersionAgnosticMigrationManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationManager + */ public class MigrationManager extends VersionAgnosticMigrationManager { + /** + * Much more complicated constructor than {@link MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager( Supplier currentVersionGetter, Consumer currentVersionSetter, Consumer currentVersionStorer, - MicroMigrater migrater, - EmbeddedStorageManager storageManager) + MicroMigrater migrater, + EmbeddedStorageManager storageManager + ) { super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link VersionAgnosticMigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager( - Versioned versionedObject, MicroMigrater migrater, - EmbeddedStorageManager storageManager) + Versioned versionedObject, + MicroMigrater migrater , + EmbeddedStorageManager storageManager + ) { super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 4066284..bb8029f 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -10,7 +10,9 @@ * One script is supposed to bring a datastore from a lower version to the target version. * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, * the target version is reached. - * + *

+ * This is a shorthand for {@link VersionAgnosticMigrationScript} for this specific MicroStream version. + * * @author Johannes Rabauer * */ diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 350b09c..53c2c1a 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -27,12 +27,12 @@ /** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. - * + * It simply relays all the commands to the contained {@link EmbeddedStorageManager}. + * + * @see VersionAgnosticTunnelingEmbeddedStorageManager + * * @author Johannes Rabauer * */ @@ -64,6 +64,10 @@ public TunnelingEmbeddedStorageManager( // Simply forward all the methods //////////////////////////////////////////////////////////////// + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#start} + */ @Override public TunnelingEmbeddedStorageManager start() { @@ -71,58 +75,97 @@ public TunnelingEmbeddedStorageManager start() return this; } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#root} + */ @Override public Object root() { return this.nativeManager.root(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#setRoot(Object)} + */ @Override public Object setRoot(Object newRoot) { return this.nativeManager.setRoot(newRoot); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#storeRoot()} + */ @Override public long storeRoot() { return this.nativeManager.storeRoot(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#configuration()} + */ @Override public StorageConfiguration configuration() { return this.nativeManager.configuration(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#typeDictionary()} + */ @Override public StorageTypeDictionary typeDictionary() { return this.nativeManager.typeDictionary(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#shutdown()} + */ @Override public boolean shutdown() { return this.nativeManager.shutdown(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#close()} + */ @Override public void close() throws StorageException { this.nativeManager.close(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createConnection()} + */ @Override public StorageConnection createConnection() { return this.nativeManager.createConnection(); } - + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#viewRoots()} + */ @Override public PersistenceRootsView viewRoots() { return this.nativeManager.viewRoots(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#defaultRoot()} + */ @Override @Deprecated public Reference defaultRoot() @@ -130,90 +173,150 @@ public Reference defaultRoot() return this.nativeManager.defaultRoot(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#database()} + */ @Override public Database database() { return this.nativeManager.database(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isAcceptingTasks()} + */ @Override public boolean isAcceptingTasks() { return this.nativeManager.isAcceptingTasks(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isRunning()} + */ @Override public boolean isRunning() { return this.nativeManager.isRunning(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isStartingUp()} + */ @Override public boolean isStartingUp() { return this.nativeManager.isStartingUp(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isShuttingDown()} + */ @Override public boolean isShuttingDown() { return this.nativeManager.isShuttingDown(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#checkAcceptingTasks()} + */ @Override public void checkAcceptingTasks() { this.nativeManager.checkAcceptingTasks(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#initializationTime()} + */ @Override public long initializationTime() { return this.nativeManager.initializationTime(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#operationModeTime()} + */ @Override public long operationModeTime() { return this.nativeManager.operationModeTime(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isActive()} + */ @Override public boolean isActive() { return this.nativeManager.isActive(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueGarbageCollection(long)} + */ @Override public boolean issueGarbageCollection(long nanoTimeBudget) { return this.nativeManager.issueGarbageCollection(nanoTimeBudget); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFileCheck(long)} + */ @Override public boolean issueFileCheck(long nanoTimeBudget) { return this.nativeManager.issueFileCheck(nanoTimeBudget); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueCacheCheck(long, StorageEntityCacheEvaluator)} + */ @Override public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) { return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createStorageStatistics} + */ @Override public StorageRawFileStatistics createStorageStatistics() { return this.nativeManager.createStorageStatistics(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportChannels(StorageLiveFileProvider)} + */ @Override public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { this.nativeManager.exportChannels(fileProvider, performGarbageCollection); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportTypes(StorageEntityTypeExportFileProvider)} + */ @Override public StorageEntityTypeExportStatistics exportTypes( StorageEntityTypeExportFileProvider exportFileProvider, @@ -222,18 +325,30 @@ public StorageEntityTypeExportStatistics exportTypes( return this.nativeManager.exportTypes(exportFileProvider, isExportType); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#importFiles(XGettingEnum)} + */ @Override public void importFiles(XGettingEnum importFiles) { this.nativeManager.importFiles(importFiles); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#persistenceManager()} + */ @Override public PersistenceManager persistenceManager() { return this.nativeManager.persistenceManager(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#store(Object)} + */ @Override public long store(Object instance) { @@ -245,6 +360,10 @@ public long store(Object instance) return this.nativeManager; } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFullBackup(StorageLiveFileProvider, PersistenceTypeDictionaryExporter)} + */ @Override public void issueFullBackup(StorageLiveFileProvider targetFileProvider, PersistenceTypeDictionaryExporter typeDictionaryExporter) { diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 2073bd7..fff5347 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -2,17 +2,15 @@ import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; /** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. - *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. + * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationEmbeddedStorageManager * * @author Johannes Rabauer * diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index dfaf8d7..5967cf5 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -3,6 +3,7 @@ import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; @@ -10,21 +11,47 @@ import java.util.function.Supplier; +/** + * Specific implementation of the {@link VersionAgnosticMigrationManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationManager + */ public class MigrationManager extends VersionAgnosticMigrationManager { + /** + * Much more complicated constructor than {@link MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager( Supplier currentVersionGetter, Consumer currentVersionSetter, Consumer currentVersionStorer, - MicroMigrater migrater, - EmbeddedStorageManager storageManager) + MicroMigrater migrater, + EmbeddedStorageManager storageManager + ) { super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link VersionAgnosticMigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager( - Versioned versionedObject, MicroMigrater migrater, - EmbeddedStorageManager storageManager) + Versioned versionedObject, + MicroMigrater migrater , + EmbeddedStorageManager storageManager + ) { super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 4066284..bb8029f 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -10,7 +10,9 @@ * One script is supposed to bring a datastore from a lower version to the target version. * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, * the target version is reached. - * + *

+ * This is a shorthand for {@link VersionAgnosticMigrationScript} for this specific MicroStream version. + * * @author Johannes Rabauer * */ diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 350b09c..53c2c1a 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -27,12 +27,12 @@ /** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. - * + * It simply relays all the commands to the contained {@link EmbeddedStorageManager}. + * + * @see VersionAgnosticTunnelingEmbeddedStorageManager + * * @author Johannes Rabauer * */ @@ -64,6 +64,10 @@ public TunnelingEmbeddedStorageManager( // Simply forward all the methods //////////////////////////////////////////////////////////////// + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#start} + */ @Override public TunnelingEmbeddedStorageManager start() { @@ -71,58 +75,97 @@ public TunnelingEmbeddedStorageManager start() return this; } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#root} + */ @Override public Object root() { return this.nativeManager.root(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#setRoot(Object)} + */ @Override public Object setRoot(Object newRoot) { return this.nativeManager.setRoot(newRoot); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#storeRoot()} + */ @Override public long storeRoot() { return this.nativeManager.storeRoot(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#configuration()} + */ @Override public StorageConfiguration configuration() { return this.nativeManager.configuration(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#typeDictionary()} + */ @Override public StorageTypeDictionary typeDictionary() { return this.nativeManager.typeDictionary(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#shutdown()} + */ @Override public boolean shutdown() { return this.nativeManager.shutdown(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#close()} + */ @Override public void close() throws StorageException { this.nativeManager.close(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createConnection()} + */ @Override public StorageConnection createConnection() { return this.nativeManager.createConnection(); } - + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#viewRoots()} + */ @Override public PersistenceRootsView viewRoots() { return this.nativeManager.viewRoots(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#defaultRoot()} + */ @Override @Deprecated public Reference defaultRoot() @@ -130,90 +173,150 @@ public Reference defaultRoot() return this.nativeManager.defaultRoot(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#database()} + */ @Override public Database database() { return this.nativeManager.database(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isAcceptingTasks()} + */ @Override public boolean isAcceptingTasks() { return this.nativeManager.isAcceptingTasks(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isRunning()} + */ @Override public boolean isRunning() { return this.nativeManager.isRunning(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isStartingUp()} + */ @Override public boolean isStartingUp() { return this.nativeManager.isStartingUp(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isShuttingDown()} + */ @Override public boolean isShuttingDown() { return this.nativeManager.isShuttingDown(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#checkAcceptingTasks()} + */ @Override public void checkAcceptingTasks() { this.nativeManager.checkAcceptingTasks(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#initializationTime()} + */ @Override public long initializationTime() { return this.nativeManager.initializationTime(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#operationModeTime()} + */ @Override public long operationModeTime() { return this.nativeManager.operationModeTime(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isActive()} + */ @Override public boolean isActive() { return this.nativeManager.isActive(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueGarbageCollection(long)} + */ @Override public boolean issueGarbageCollection(long nanoTimeBudget) { return this.nativeManager.issueGarbageCollection(nanoTimeBudget); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFileCheck(long)} + */ @Override public boolean issueFileCheck(long nanoTimeBudget) { return this.nativeManager.issueFileCheck(nanoTimeBudget); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueCacheCheck(long, StorageEntityCacheEvaluator)} + */ @Override public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) { return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createStorageStatistics} + */ @Override public StorageRawFileStatistics createStorageStatistics() { return this.nativeManager.createStorageStatistics(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportChannels(StorageLiveFileProvider)} + */ @Override public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { this.nativeManager.exportChannels(fileProvider, performGarbageCollection); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportTypes(StorageEntityTypeExportFileProvider)} + */ @Override public StorageEntityTypeExportStatistics exportTypes( StorageEntityTypeExportFileProvider exportFileProvider, @@ -222,18 +325,30 @@ public StorageEntityTypeExportStatistics exportTypes( return this.nativeManager.exportTypes(exportFileProvider, isExportType); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#importFiles(XGettingEnum)} + */ @Override public void importFiles(XGettingEnum importFiles) { this.nativeManager.importFiles(importFiles); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#persistenceManager()} + */ @Override public PersistenceManager persistenceManager() { return this.nativeManager.persistenceManager(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#store(Object)} + */ @Override public long store(Object instance) { @@ -245,6 +360,10 @@ public long store(Object instance) return this.nativeManager; } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFullBackup(StorageLiveFileProvider, PersistenceTypeDictionaryExporter)} + */ @Override public void issueFullBackup(StorageLiveFileProvider targetFileProvider, PersistenceTypeDictionaryExporter typeDictionaryExporter) { diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 2073bd7..fff5347 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -2,17 +2,15 @@ import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; /** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. - *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link VersionAgnosticMigrationManager} to do the actual migration. + * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationEmbeddedStorageManager * * @author Johannes Rabauer * diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index dfaf8d7..5967cf5 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -3,6 +3,7 @@ import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; @@ -10,21 +11,47 @@ import java.util.function.Supplier; +/** + * Specific implementation of the {@link VersionAgnosticMigrationManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationManager + */ public class MigrationManager extends VersionAgnosticMigrationManager { + /** + * Much more complicated constructor than {@link MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager( Supplier currentVersionGetter, Consumer currentVersionSetter, Consumer currentVersionStorer, - MicroMigrater migrater, - EmbeddedStorageManager storageManager) + MicroMigrater migrater, + EmbeddedStorageManager storageManager + ) { super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link VersionAgnosticMigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ public MigrationManager( - Versioned versionedObject, MicroMigrater migrater, - EmbeddedStorageManager storageManager) + Versioned versionedObject, + MicroMigrater migrater , + EmbeddedStorageManager storageManager + ) { super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); } diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index 4066284..bb8029f 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -10,7 +10,9 @@ * One script is supposed to bring a datastore from a lower version to the target version. * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, * the target version is reached. - * + *

+ * This is a shorthand for {@link VersionAgnosticMigrationScript} for this specific MicroStream version. + * * @author Johannes Rabauer * */ diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 350b09c..53c2c1a 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -27,12 +27,12 @@ /** - * Wrapper class for the MicroStream {@link software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticEmbeddedStorageManager} interface. + * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

- * Basically it intercepts storing the root object and places a {@link Versioned} - * in front of it. This means the root object of the datastore is then versioned.
- * Internally uses the {@link MigrationManager} to do the actual migration. - * + * It simply relays all the commands to the contained {@link EmbeddedStorageManager}. + * + * @see VersionAgnosticTunnelingEmbeddedStorageManager + * * @author Johannes Rabauer * */ @@ -64,6 +64,10 @@ public TunnelingEmbeddedStorageManager( // Simply forward all the methods //////////////////////////////////////////////////////////////// + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#start} + */ @Override public TunnelingEmbeddedStorageManager start() { @@ -71,58 +75,97 @@ public TunnelingEmbeddedStorageManager start() return this; } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#root} + */ @Override public Object root() { return this.nativeManager.root(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#setRoot(Object)} + */ @Override public Object setRoot(Object newRoot) { return this.nativeManager.setRoot(newRoot); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#storeRoot()} + */ @Override public long storeRoot() { return this.nativeManager.storeRoot(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#configuration()} + */ @Override public StorageConfiguration configuration() { return this.nativeManager.configuration(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#typeDictionary()} + */ @Override public StorageTypeDictionary typeDictionary() { return this.nativeManager.typeDictionary(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#shutdown()} + */ @Override public boolean shutdown() { return this.nativeManager.shutdown(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#close()} + */ @Override public void close() throws StorageException { this.nativeManager.close(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createConnection()} + */ @Override public StorageConnection createConnection() { return this.nativeManager.createConnection(); } - + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#viewRoots()} + */ @Override public PersistenceRootsView viewRoots() { return this.nativeManager.viewRoots(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#defaultRoot()} + */ @Override @Deprecated public Reference defaultRoot() @@ -130,90 +173,150 @@ public Reference defaultRoot() return this.nativeManager.defaultRoot(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#database()} + */ @Override public Database database() { return this.nativeManager.database(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isAcceptingTasks()} + */ @Override public boolean isAcceptingTasks() { return this.nativeManager.isAcceptingTasks(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isRunning()} + */ @Override public boolean isRunning() { return this.nativeManager.isRunning(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isStartingUp()} + */ @Override public boolean isStartingUp() { return this.nativeManager.isStartingUp(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isShuttingDown()} + */ @Override public boolean isShuttingDown() { return this.nativeManager.isShuttingDown(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#checkAcceptingTasks()} + */ @Override public void checkAcceptingTasks() { this.nativeManager.checkAcceptingTasks(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#initializationTime()} + */ @Override public long initializationTime() { return this.nativeManager.initializationTime(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#operationModeTime()} + */ @Override public long operationModeTime() { return this.nativeManager.operationModeTime(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isActive()} + */ @Override public boolean isActive() { return this.nativeManager.isActive(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueGarbageCollection(long)} + */ @Override public boolean issueGarbageCollection(long nanoTimeBudget) { return this.nativeManager.issueGarbageCollection(nanoTimeBudget); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFileCheck(long)} + */ @Override public boolean issueFileCheck(long nanoTimeBudget) { return this.nativeManager.issueFileCheck(nanoTimeBudget); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueCacheCheck(long, StorageEntityCacheEvaluator)} + */ @Override public boolean issueCacheCheck(long nanoTimeBudget, StorageEntityCacheEvaluator entityEvaluator) { return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createStorageStatistics} + */ @Override public StorageRawFileStatistics createStorageStatistics() { return this.nativeManager.createStorageStatistics(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportChannels(StorageLiveFileProvider)} + */ @Override public void exportChannels(StorageLiveFileProvider fileProvider, boolean performGarbageCollection) { this.nativeManager.exportChannels(fileProvider, performGarbageCollection); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportTypes(StorageEntityTypeExportFileProvider)} + */ @Override public StorageEntityTypeExportStatistics exportTypes( StorageEntityTypeExportFileProvider exportFileProvider, @@ -222,18 +325,30 @@ public StorageEntityTypeExportStatistics exportTypes( return this.nativeManager.exportTypes(exportFileProvider, isExportType); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#importFiles(XGettingEnum)} + */ @Override public void importFiles(XGettingEnum importFiles) { this.nativeManager.importFiles(importFiles); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#persistenceManager()} + */ @Override public PersistenceManager persistenceManager() { return this.nativeManager.persistenceManager(); } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#store(Object)} + */ @Override public long store(Object instance) { @@ -245,6 +360,10 @@ public long store(Object instance) return this.nativeManager; } + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFullBackup(StorageLiveFileProvider, PersistenceTypeDictionaryExporter)} + */ @Override public void issueFullBackup(StorageLiveFileProvider targetFileProvider, PersistenceTypeDictionaryExporter typeDictionaryExporter) { diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java index 7d2f53e..eee8c95 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java @@ -1,10 +1,10 @@ package software.xdev.micromigration.migrater.scripts.abstractSuperClass; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.version.MigrationVersion; -public abstract class AbstractScript implements MigrationScript +public abstract class AbstractScript implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java index 9da0eee..f7e4dc2 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.errorThrowing; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class ErrorThrowingScript implements MigrationScript +public class ErrorThrowingScript implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { public ErrorThrowingScript() { diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java index 84c0db9..61c3eef 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.exceptionThrowing; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class ExceptionThrowingScript implements MigrationScript +public class ExceptionThrowingScript implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { public ExceptionThrowingScript() throws Exception { diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java index 54f8efe..0cdd5aa 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.includeSubPackages; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScript implements MigrationScript +public class ValidScript implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java index 27bac0f..9dc57f5 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.includeSubPackages.subpackage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScriptInSubpackage implements MigrationScript +public class ValidScriptInSubpackage implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java index e1061df..a59d620 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScript implements MigrationScript +public class ValidScript implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java index ec15b6c..950c233 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.noCorrectConstructor; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class NoCorrectConstructorScript implements MigrationScript +public class NoCorrectConstructorScript implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { private final String argument; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java index fafad8e..e9f5052 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.migrater.scripts.valid; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class ValidScript implements MigrationScript +public class ValidScript implements + software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() From 677d9bb50a82e3d180484284ed2cd26d86ddde11 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 22 Dec 2022 15:34:22 +0100 Subject: [PATCH 175/306] Script Execution history implemented --- ...nosticMigrationEmbeddedStorageManager.java | 20 ++++++--- .../VersionAgnosticMigrationManager.java | 23 ++++++++++ .../migrater/AbstractMigrater.java | 6 +-- .../migrater/MicroMigrater.java | 9 ++++ .../version/VersionedAndKeeperOfHistory.java | 27 ++++++++++++ .../version/VersionedObjectWithHistory.java | 41 +++++++++++++++++ .../version/VersionedRootWithHistory.java | 44 +++++++++++++++++++ .../integration/MigrationHistoryTest.java | 38 ++++++++++++++++ 8 files changed, 198 insertions(+), 10 deletions(-) create mode 100644 core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java create mode 100644 core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java create mode 100644 core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java create mode 100644 microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java index abc0e28..cae1aa7 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -1,10 +1,13 @@ package software.xdev.micromigration.microstream.versionagnostic; import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedRoot; +import software.xdev.micromigration.version.VersionedRootWithHistory; +import java.util.List; import java.util.Objects; @@ -28,7 +31,7 @@ public abstract class VersionAgnosticMigrationEmbeddedStorageManager implements AutoCloseable { private final MicroMigrater migrater ; - private VersionedRoot versionRoot ; + private VersionedRootWithHistory versionRoot ; private VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager; @@ -68,14 +71,14 @@ protected VersionAgnosticTunnelingEmbeddedStorageManager getTunnelingManager( public T start() { this.tunnelingManager.start(); - if(this.tunnelingManager.root() instanceof VersionedRoot) + if(this.tunnelingManager.root() instanceof VersionedRootWithHistory) { - this.versionRoot = (VersionedRoot)this.tunnelingManager.root(); + this.versionRoot = (VersionedRootWithHistory)this.tunnelingManager.root(); } else { - //Build VersionedRoot around actual root, set by user. - this.versionRoot = new VersionedRoot(this.tunnelingManager.root()); + //Build VersionedRootWithHistory around actual root, set by user. + this.versionRoot = new VersionedRootWithHistory(this.tunnelingManager.root()); this.tunnelingManager.setRoot(versionRoot); this.tunnelingManager.storeRoot(); } @@ -103,6 +106,13 @@ public Object root() { return this.versionRoot.getRoot(); } + /** + * @return the actual root object + */ + public List getMigrationHistory() { + return this.versionRoot.getMigrationHistory(); + } + /** * Sets the actual root element (not the versioned root) * @param newRoot to set diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index b7bc7d2..e33949a 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -1,9 +1,11 @@ package software.xdev.micromigration.microstream.versionagnostic; import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedAndKeeperOfHistory; import java.util.Objects; import java.util.function.Consumer; @@ -86,6 +88,27 @@ public class VersionAgnosticMigrationManager Objects.requireNonNull(versionedObject); } + public VersionAgnosticMigrationManager + ( + final VersionedAndKeeperOfHistory versionedObject, + final MicroMigrater migrater , + final VersionAgnosticMigrationEmbeddedStorageManager storageManager + ) + { + this( + ( ) -> versionedObject.getVersion() , + (version) -> versionedObject.setVersion(version) , + (version) -> storageManager.store(versionedObject), + migrater , + storageManager + ); + Objects.requireNonNull(versionedObject); + migrater.registerNotificationConsumer( + executedScript -> + versionedObject.addExecutedScript(new ScriptExecutionNotificationWithoutScriptReference(executedScript)) + ); + } + /** * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 9c4ec6b..08623e7 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -23,11 +23,7 @@ public abstract class AbstractMigrater implements MicroMigrater { private List> notificationConsumers = new ArrayList<>(); - - /** - * Registers a callback to take action when a script is executed. - * @param notificationConsumer is executed when a script is used from this migrater. - */ + public void registerNotificationConsumer(Consumer notificationConsumer) { this.notificationConsumers.add(notificationConsumer); diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index 300fd41..8159e1d 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -1,11 +1,13 @@ package software.xdev.micromigration.migrater; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithScriptReference; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; import java.util.TreeSet; +import java.util.function.Consumer; /** @@ -83,4 +85,11 @@ > MigrationVersion E storageManager , Object objectToMigrate ); + + /** + * Registers a callback to take action when a script is executed. + * @param notificationConsumer is executed when a script is used from this migrater. + */ + public void registerNotificationConsumer( + Consumer notificationConsumer); } diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java new file mode 100644 index 0000000..a1d4b68 --- /dev/null +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java @@ -0,0 +1,27 @@ +package software.xdev.micromigration.version; + +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; + +import java.util.List; + + +/** + * Interface used by the MigrationManagers for easier versioning of objects + * and to keep and read the migration history. + * + * @author Johannes Rabauer + * + */ +public interface VersionedAndKeeperOfHistory extends Versioned +{ + /** + * Adds the information about the executed script to the history book. + * @param executedScriptInformation information about the executed script + */ + void addExecutedScript(ScriptExecutionNotificationWithoutScriptReference executedScriptInformation); + + /** + * @return the complete migration history. That means information about every executed script. + */ + List getMigrationHistory(); +} diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java new file mode 100644 index 0000000..c981bd9 --- /dev/null +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java @@ -0,0 +1,41 @@ +package software.xdev.micromigration.version; + +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * This class is inserted as the root of the MicroStream datastore and contains only the + * current version, the actual root object and the history of executed scripts. + * + * @author Johannes Rabauer + * + */ +public class VersionedObjectWithHistory extends VersionedObject implements VersionedAndKeeperOfHistory +{ + private final List migrationHistory; + + /** + * @param actualRoot which is stored in the datastore and defined by the user + */ + public VersionedObjectWithHistory(Object actualRoot) + { + super(actualRoot); + this.migrationHistory = new ArrayList<>(); + } + + @Override + public void addExecutedScript(ScriptExecutionNotificationWithoutScriptReference executedScriptInformation) + { + this.migrationHistory.add(Objects.requireNonNull(executedScriptInformation)); + } + + @Override + public List getMigrationHistory() + { + return this.migrationHistory; + } +} diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java new file mode 100644 index 0000000..ac4476b --- /dev/null +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java @@ -0,0 +1,44 @@ +package software.xdev.micromigration.version; + +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * This class is inserted as the root of the MicroStream datastore and contains only the + * current version, the actual root object and the history of executed scripts. + * + * @author Johannes Rabauer + * + */ +public class VersionedRootWithHistory extends VersionedRoot implements VersionedAndKeeperOfHistory +{ + private final List migrationHistory; + + /** + * @param actualRoot which is stored in the datastore and defined by the user + */ + public VersionedRootWithHistory(Object actualRoot) + { + super(actualRoot); + this.migrationHistory = new ArrayList<>(); + } + + @Override + public void addExecutedScript(ScriptExecutionNotificationWithoutScriptReference executedScriptInformation) + { + this.migrationHistory.add(Objects.requireNonNull(executedScriptInformation)); + } + + /** + * @return the complete migration history. That means information about every executed script. + */ + @Override + public List getMigrationHistory() + { + return this.migrationHistory; + } +} diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java new file mode 100644 index 0000000..e7376d7 --- /dev/null +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java @@ -0,0 +1,38 @@ +package software.xdev.micromigration.integration; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; + + +class MigrationHistoryTest +{ + @Test + void testMigrationHistoryWithTwoScripts(@TempDir Path storageFolder) + { + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(2, migrationStorageManager.getMigrationHistory().size()); + assertEquals("SimpleTypedMigrationScript", migrationStorageManager.getMigrationHistory().get(0).getExecutedScriptName()); + } + } + +} From 90f09ee462bd22351d05f0e5b1d5cd759907fe28 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 23 Dec 2022 08:01:26 +0100 Subject: [PATCH 176/306] Cleanup, Refactoring --- .github/workflows/checkBuild.yml | 4 ++-- .github/workflows/release.yml | 2 +- .../VersionAgnosticMigrationManager.java | 8 +++++++ examples/pom.xml | 23 +++++++++++++++++-- .../examples/explicit/MainExplicit.java | 5 +++- .../explicit/scripts/UpdateToV1_0.java | 5 ++-- .../explicit/scripts/UpdateToV1_1.java | 5 ++-- .../notification/MainNotification.java | 4 +++- ...alWithMigrationEmbeddedStorageManager.java | 4 +++- .../practical/embedded/UpdateToV1_0.java | 5 ++-- .../practical/embedded/UpdateToV2_0.java | 5 ++-- .../MainPracticalWithMigrationManager.java | 1 + .../migrationManager/UpdateToV1_0.java | 5 ++-- .../migrationManager/UpdateToV2_0.java | 5 ++-- .../examples/reflective/MainReflective.java | 2 ++ .../reflective/scripts/UpdateToV1_0.java | 5 ++-- .../reflective/scripts/UpdateToV1_1.java | 5 ++-- pom.xml | 1 + 18 files changed, 70 insertions(+), 24 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 2a90003..0799584 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -32,7 +32,7 @@ jobs: java-package: ${{ matrix.java-package }} cache: 'maven' - - name: Build with Maven + - name: Build with maven run: mvn -B clean verify - name: Check for uncommited changes @@ -79,4 +79,4 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file + run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 794e8d2..96e5823 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,7 +93,7 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - run: mvn -B -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy after_release: runs-on: ubuntu-latest needs: [publish_central] diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index e33949a..9ce9449 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -88,6 +88,14 @@ public class VersionAgnosticMigrationManager Objects.requireNonNull(versionedObject); } + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link VersionAgnosticMigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ public VersionAgnosticMigrationManager ( final VersionedAndKeeperOfHistory versionedObject, diff --git a/examples/pom.xml b/examples/pom.xml index 9b01833..735829e 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.7 + 0.0.7-SNAPSHOT MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.7 + 0.0.7-SNAPSHOT micro-migration @@ -26,4 +26,23 @@ ${project.version} + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + + + org.apache.maven.plugins + maven-resources-plugin + + true + + + + diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index 4627949..27b27b7 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -2,13 +2,16 @@ import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_0; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_1; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.migrater.ExplicitMigrater; import java.util.Date; /** * The most basic usage of micro migration. - * Here two {@link software.xdev.micromigration.scripts.MigrationScript}s are explicitly registered + * Here two {@link MigrationScript}s are explicitly registered * and subsequently executed. Easy. * * @author Johannes Rabauer diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 984b100..02decd3 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -1,13 +1,14 @@ package software.xdev.micromigration.examples.explicit.scripts; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_0 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript +public class UpdateToV1_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index c246ebd..7db5b20 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -1,13 +1,14 @@ package software.xdev.micromigration.examples.explicit.scripts; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_1 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript +public class UpdateToV1_1 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index 9eb4a00..588b7eb 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -1,5 +1,7 @@ package software.xdev.micromigration.examples.notification; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; @@ -9,7 +11,7 @@ /** * Shows the basic registration of migration notifications - * ({@link software.xdev.micromigration.notification.ScriptExecutionNotification}). + * ({@link ScriptExecutionNotification}). * * @author Johannes Rabauer */ diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 55ce8f0..4716b4a 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -1,6 +1,8 @@ package software.xdev.micromigration.examples.practical.embedded; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -16,7 +18,7 @@ * @author Johannes Rabauer * */ -public class MainPracticalWithMigrationEmbeddedStorageManager +public class MainPracticalWithMigrationEmbeddedStorageManager { public static void main(String[] args) { diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index 81dd61b..5f72f0c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -3,12 +3,13 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.Address; import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class UpdateToV1_0 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript +public class UpdateToV1_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index 513ea7d..3274773 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -2,12 +2,13 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -public class UpdateToV2_0 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript +public class UpdateToV2_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index 9d66570..8849917 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -3,6 +3,7 @@ import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; +import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.version.VersionedObject; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index 1384fbb..027cbf1 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -3,13 +3,14 @@ import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -public class UpdateToV1_0 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> +public class UpdateToV1_0 implements MigrationScript> { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 13438d7..3eaf293 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -2,13 +2,14 @@ import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -public class UpdateToV2_0 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript, software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager> +public class UpdateToV2_0 implements MigrationScript> { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index fdadcfb..f30faef 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -1,5 +1,7 @@ package software.xdev.micromigration.examples.reflective; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ReflectiveMigrater; import software.xdev.micromigration.migrater.ScriptInstantiationException; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index 5703aa6..8fa8a35 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -1,13 +1,14 @@ package software.xdev.micromigration.examples.reflective.scripts; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_0 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript +public class UpdateToV1_0 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index 48770ca..da1b76c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -1,13 +1,14 @@ package software.xdev.micromigration.examples.reflective.scripts; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; -public class UpdateToV1_1 implements - software.xdev.micromigration.scripts.VersionAgnosticMigrationScript +public class UpdateToV1_1 implements MigrationScript { @Override public MigrationVersion getTargetVersion() diff --git a/pom.xml b/pom.xml index be60a93..c8452de 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,7 @@ core reflection + examples microstream-v5 microstream-v6 microstream-v7 From dd666d3615c8f559a3c908370e28422cd4b80983 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 23 Dec 2022 08:17:52 +0100 Subject: [PATCH 177/306] Added Changelog for 0.0.7 --- CHANGELOG.md | 4 ++++ README.md | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 429500f..7701a9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.7 +* A lot of refactoring of the module structure +* A migration history is now available and automatically stored + ## 0.0.6 * Tried a new release-action...again. diff --git a/README.md b/README.md index 9f1a1a3..8d83521 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Simply add the dependency to your `pom.xml`: software.xdev micro-migration-microstream-v7 - 0.0.6 + 0.0.7 ``` @@ -134,7 +134,7 @@ To use this, you need to add the following dependency to your `pom.xml`: software.xdev micro-migration-reflection - 0.0.6 + 0.0.7 ``` @@ -153,7 +153,7 @@ then use `micro-migration-microstream-v7`) and exclude the dependent version of software.xdev micro-migration-microstream-v7 - 0.0.6 + 0.0.7 one.microstream From 12648cbb24652ebc3e4625f76d6e28a41d67ba7e Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 23 Dec 2022 07:20:52 +0000 Subject: [PATCH 178/306] Release 0.0.7 --- core/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 018961e..6837c57 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-core - 0.0.7-SNAPSHOT + 0.0.7 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.7-SNAPSHOT + 0.0.7 diff --git a/examples/pom.xml b/examples/pom.xml index 735829e..c612d5c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.7-SNAPSHOT + 0.0.7 MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.7-SNAPSHOT + 0.0.7 micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index c1d86de..220a66a 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.7-SNAPSHOT + 0.0.7 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7-SNAPSHOT + 0.0.7 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index a85441d..f0fb219 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.7-SNAPSHOT + 0.0.7 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7-SNAPSHOT + 0.0.7 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index fb16686..180627e 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.7-SNAPSHOT + 0.0.7 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7-SNAPSHOT + 0.0.7 diff --git a/pom.xml b/pom.xml index c8452de..d3d08f8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.7-SNAPSHOT + 0.0.7 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index b70e2ca..3bbb67b 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.7-SNAPSHOT + 0.0.7 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7-SNAPSHOT + 0.0.7 From f2f326e5de314f8eba5441dfb5fe9a0ffeac0af1 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 23 Dec 2022 07:23:53 +0000 Subject: [PATCH 179/306] Preparing for next development iteration --- core/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 6837c57..0cef740 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-core - 0.0.7 + 0.0.8-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.7 + 0.0.8-SNAPSHOT diff --git a/examples/pom.xml b/examples/pom.xml index c612d5c..57dad20 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.7 + 0.0.8-SNAPSHOT MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.7 + 0.0.8-SNAPSHOT micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 220a66a..908393b 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.7 + 0.0.8-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7 + 0.0.8-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index f0fb219..c77ffd8 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.7 + 0.0.8-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7 + 0.0.8-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 180627e..656ea3c 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.7 + 0.0.8-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7 + 0.0.8-SNAPSHOT diff --git a/pom.xml b/pom.xml index d3d08f8..e6fed97 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.7 + 0.0.8-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 3bbb67b..25cf2a2 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.7 + 0.0.8-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.7 + 0.0.8-SNAPSHOT From eb93d535f28e0d73570b1aa5fb83a6838fed956c Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 23 Dec 2022 13:28:43 +0100 Subject: [PATCH 180/306] Thrown out deprecated Reflection Method --- .../xdev/micromigration/migrater/ReflectiveMigrater.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java index 328ea57..7e2d818 100644 --- a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java @@ -1,7 +1,7 @@ package software.xdev.micromigration.migrater; import org.reflections.Reflections; -import org.reflections.scanners.SubTypesScanner; +import org.reflections.scanners.Scanners; import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; import org.reflections.util.FilterBuilder; @@ -36,7 +36,7 @@ public ReflectiveMigrater(final String packagePath) throws ScriptInstantiationEx Reflections reflections = new Reflections( new ConfigurationBuilder() .setUrls(ClasspathHelper.forPackage(packagePath)) - .setScanners(new SubTypesScanner()) + .setScanners(Scanners.SubTypes) //I don't get why you have to filter again, but if you don't, super-packages will get included .filterInputsBy(new FilterBuilder().includePackage(packagePath)) ); From b20549e60aa9e094b289cee4427959cf6405e8e2 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 16 Jan 2023 15:19:58 +0100 Subject: [PATCH 181/306] Updated README --- LICENSE | 2 +- README.md | 35 +++++++++++++++++++++++++++++++---- docs/MigrationSequence_1.png | Bin 4372 -> 11271 bytes docs/MigrationSequence_2.png | Bin 11729 -> 15484 bytes docs/MigrationSequence_3.png | Bin 15863 -> 19428 bytes docs/MigrationSequence_4.png | Bin 20410 -> 28674 bytes 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 6d8d58f..c86eeb4 100644 --- a/LICENSE +++ b/LICENSE @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - Copyright 2013-2018 Docker, Inc. + Copyright 2023 XDEV Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 8d83521..0809c64 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ -![License](https://img.shields.io/github/license/xdev-software/micro-migration) [![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/versions) [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/micro-migration/checkBuild.yml?branch=develop)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) -[![Twitter Follow](https://img.shields.io/twitter/follow/XDEVSoftware)](https://twitter.com/XDEVSoftware) # Micro migration Tiny java library to migrate MicroStream datastores. @@ -168,9 +166,38 @@ then use `micro-migration-microstream-v7`) and exclude the dependent version of ``` Since there is rarely a breaking change, this works 90% of times. -# Links +## Releasing + +Before releasing: + +* Check if the [Check Build](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop)-Action was successful. +* Check the [changelog](CHANGELOG.md) + +If the ``develop`` is ready for release, create a pull request to the ``main``-Branch and merge the changes + +When the release is finished do the following: +* Merge the auto-generated PR (with the incremented version number) back into the ``develop`` +* Login to the [Sonatype repository manager](https://s01.oss.sonatype.org/), check the staged libraries, + close the repository and publish it (after a few minutes). + +## Developing + +### Software Requirements +You should have the following things installed: +* Git +* Java 9 +* Maven + +### Recommended setup +* Install ``IntelliJ`` (Community Edition is sufficient) + * Install the following plugins: + * Import the project + * Ensure that everything is encoded in ``UTF-8`` + * Ensure that the JDK/Java-Version is correct + +## Links - [Javadoc](https://javadoc.io/doc/software.xdev/micro-migration-core/latest/index.html) - [Maven central repository](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/version) -# Contributing +## Contributing We would love your input in any way. More about contributing: [CONTRIBUTING.md](CONTRIBUTING.md) diff --git a/docs/MigrationSequence_1.png b/docs/MigrationSequence_1.png index 822153dcdbf05977beb2bd4527ebe67b2f9d8f06..4b8c8da8a8f367827eed6a19ca0cf4643199c899 100644 GIT binary patch literal 11271 zcmeHrcR1YL*0$cFMX$kV(R-Oeh~9g&XftClIx~8&Q9_7_5+r&Mo#>q)(L$mV(Yxpg z!aI_j=RD{7-ha+@eeZt{*PgQXTK8V--uK$Ge>+B3TZM>#jsOh}jYv&ZQ6Kg0i)sUS z7^v51eF8@`wA-_Oh9*dTus5@thpR2z3C4`{b%Qa(eBicdXg)J#8E~&HE?ccdr#8cyHOX~cBs%_)5 zlGpZM2DRe8tT@|NIX{lk+`=0L({OFxx-2uJr}KT5PLQw2{01LlI8L#^yw8w15JX1|1;8G*AY zmbF=Y7YzJp5_cpTKLPPu9vS9k!G>8Yh6@g92p_c^jrWlRdG%=yxeA<9Q10&Mok%0B z@=}(UpC0!PoGgDoMNq#_6&UN2KJZ+dyJL57w637g!gszDcp+m~hbT*baBS}G8OXcU z_-y;}Hjcs6ry;P}NtY`auhH^-Y0~FpLzAHMPDdPD4s*_xN_i5_oo&hPo*st!xGuHF zB8A)C&)FO@Hxr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z6@pK9yg2W&C8FYwvWR`3{>{k4%`R7F&v>VN=(V`|v)ww;+~CAEdGoACjc4EN*t@zj z!}h5DpPW0%JK8&}H0o*(uJ(=FtYWzT>dlA6at*_R}hAypwiG zJTw9Y7Q?&%$B)LX^-eCpg?_eO^1?sj9zCD0GVl0Y2jFoC|LiMP^d&6MGROrf^>p=f JS?83{1OP;}CKLbw From 33bdd5ce56bde20e30d5c68aa8b926eb2554919e Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 16 Jan 2023 15:22:39 +0100 Subject: [PATCH 182/306] Test if variable is also valid in .md-file --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 359c7e9..5a78a5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ We use GitHub to host code, to track issues and feature requests, as well as acc Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests: -1. Fork the repo and create your branch from `master`. +1. Fork the repo and create your branch from ${{ github.event.repository.default_branch }}. 2. If you've added code that should be tested, add tests. 3. If you've changed APIs, update the documentation. 4. Ensure the test suite passes. From 8895daeea824ca45d669a697a65c89d2845757c0 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 16 Jan 2023 15:23:28 +0100 Subject: [PATCH 183/306] Update Contributing.md because github-actions-variables are not valid in .md-files --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a78a5e..9d779ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ We use GitHub to host code, to track issues and feature requests, as well as acc Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests: -1. Fork the repo and create your branch from ${{ github.event.repository.default_branch }}. +1. Fork the repo and create your branch from `main`. 2. If you've added code that should be tested, add tests. 3. If you've changed APIs, update the documentation. 4. Ensure the test suite passes. From d38f005363b50e09c69044fdfa19332204816550 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 10:29:01 +0100 Subject: [PATCH 184/306] Added Enforcer Plugin --- pom.xml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/pom.xml b/pom.xml index e6fed97..e3f2d28 100644 --- a/pom.xml +++ b/pom.xml @@ -45,6 +45,7 @@ but we are using some functionality from Java 9: https://docs.microstream.one/manual/intro/system-requirements.html --> 9 + 3.8.1 @@ -143,6 +144,56 @@ + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0 + + + + enforce-maven-and-java + + enforce + + + + + + ${maven.version} + + + ${java.version} + + + + + + + require-utf-8 + + enforce + + + + + UTF-8 + *.java + + + + + + + + + org.codehaus.mojo + extra-enforcer-rules + 1.6.1 + + + + org.apache.maven.plugins maven-compiler-plugin From 8a15f10a05271b2f983892cc4807317efa5a5492 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 13:54:47 +0100 Subject: [PATCH 185/306] Added ForbiddenAPIs --- .../migrater/AbstractMigrater.java | 19 ++++++++-- .../examples/explicit/MainExplicit.java | 4 ++- .../explicit/scripts/UpdateToV1_0.java | 3 +- .../explicit/scripts/UpdateToV1_1.java | 3 +- .../notification/MainNotification.java | 5 +-- ...alWithMigrationEmbeddedStorageManager.java | 8 +++-- .../practical/embedded/UpdateToV1_0.java | 6 ++-- .../practical/embedded/UpdateToV2_0.java | 6 ++-- .../MainPracticalWithMigrationManager.java | 8 +++-- .../migrationManager/UpdateToV1_0.java | 6 ++-- .../migrationManager/UpdateToV2_0.java | 6 ++-- .../examples/reflective/MainReflective.java | 3 +- .../reflective/scripts/UpdateToV1_0.java | 3 +- .../reflective/scripts/UpdateToV1_1.java | 3 +- pom.xml | 36 +++++++++++++++++++ .../NoCorrectConstructorScript.java | 4 ++- 16 files changed, 98 insertions(+), 25 deletions(-) diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 08623e7..2595e60 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -6,6 +6,7 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; +import java.time.Clock; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @@ -23,6 +24,8 @@ public abstract class AbstractMigrater implements MicroMigrater { private List> notificationConsumers = new ArrayList<>(); + private Clock clock = Clock.systemDefaultZone(); + public void registerNotificationConsumer(Consumer notificationConsumer) { @@ -78,7 +81,7 @@ public > Migration MigrationVersion versionBeforeUpdate = updateVersionWhichWasExecuted; if(!this.notificationConsumers.isEmpty()) { - startDate = LocalDateTime.now(); + startDate = LocalDateTime.now(this.clock); } updateVersionWhichWasExecuted = migrateWithScript(castedScript, storageManager, objectToMigrate); if(!this.notificationConsumers.isEmpty()) @@ -89,7 +92,7 @@ public > Migration versionBeforeUpdate, updateVersionWhichWasExecuted, startDate, - LocalDateTime.now() + LocalDateTime.now(this.clock) ); this.notificationConsumers.forEach(consumer -> consumer.accept(scriptNotification)); } @@ -133,4 +136,16 @@ protected void checkIfVersionIsAlreadyRegistered(VersionAgnosticMigrationScript< } } } + + /** + * Change used clock for notifications from {@link #registerNotificationConsumer(Consumer)}. + * @param clock is used when a + * {@link software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference} is created + * @return self + */ + public AbstractMigrater withClock(Clock clock) + { + this.clock = clock; + return this; + } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index 27b27b7..1a6df55 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -8,6 +8,8 @@ import software.xdev.micromigration.migrater.ExplicitMigrater; import java.util.Date; +import java.util.logging.Logger; + /** * The most basic usage of micro migration. @@ -26,7 +28,7 @@ public static void main(String[] args) new UpdateToV1_1() ); final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); - System.out.println(storageManager.root()); + Logger.getGlobal().info(storageManager.root().toString()); if(storageManager.root() == null) { storageManager.setRoot("Hello World! @ " + new Date()); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 02decd3..1d18cda 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -6,6 +6,7 @@ import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; +import java.util.logging.Logger; public class UpdateToV1_0 implements MigrationScript @@ -19,7 +20,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context context) { - System.out.println("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index 7db5b20..4ae8bc0 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -6,6 +6,7 @@ import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; +import java.util.logging.Logger; public class UpdateToV1_1 implements MigrationScript @@ -19,7 +20,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context context) { - System.out.println("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index 588b7eb..c6fe3bd 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -7,6 +7,7 @@ import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; +import java.util.logging.Logger; /** @@ -23,10 +24,10 @@ public static void main(String[] args) new MainNotification.UpdateToV1_0() ); migrater.registerNotificationConsumer( - scriptExecutionNotification -> System.out.println("Script " + scriptExecutionNotification.getExecutedScript().getClass().getSimpleName() + " executed.") + scriptExecutionNotification -> Logger.getGlobal().info("Script " + scriptExecutionNotification.getExecutedScript().getClass().getSimpleName() + " executed.") ); final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); - System.out.println(storageManager.root()); + Logger.getGlobal().info(storageManager.root().toString()); if(storageManager.root() == null) { storageManager.setRoot("Hello World! @ " + new Date()); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 4716b4a..8f1d9ca 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -5,6 +5,8 @@ import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; +import java.util.logging.Logger; + /** * A practical example of usage in a few steps: @@ -28,7 +30,7 @@ public static void main(String[] args) { storageManager.setRoot(BusinessBranch.createDummyBranch()); storageManager.storeRoot(); - System.out.println(storageManager.root().toString()); + Logger.getGlobal().info(storageManager.root().toString()); } @@ -36,7 +38,7 @@ public static void main(String[] args) final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV1)) { - System.out.println(storageManager.root().toString()); + Logger.getGlobal().info(storageManager.root().toString()); } @@ -47,7 +49,7 @@ public static void main(String[] args) ); try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV2)) { - System.out.println(storageManager.root().toString()); + Logger.getGlobal().info(storageManager.root().toString()); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index 5f72f0c..4f0b6e5 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -8,6 +8,8 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; +import java.util.logging.Logger; + public class UpdateToV1_0 implements MigrationScript { @@ -20,7 +22,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context context) { - System.out.println("Executing Script for v1.0..."); + Logger.getGlobal().info("Executing Script for v1.0..."); software.xdev.micromigration.examples.practical.v0.BusinessBranch oldBranch = context.getMigratingObject(); BusinessBranch newBranch = new BusinessBranch(); @@ -37,6 +39,6 @@ public void migrate(Context { @@ -19,7 +21,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context context) { - System.out.println("Executing Script for v2.0..."); + Logger.getGlobal().info("Executing Script for v2.0..."); final BusinessBranch branch = context.getMigratingObject(); Customer newCustomer = new Customer(); newCustomer.name = "Stevie Nicks"; @@ -28,6 +30,6 @@ public void migrate(Context con newCustomer.address.city = "Phoenix"; branch.customers.add(newCustomer); context.getStorageManager().store(branch.customers); - System.out.println("Done executing Script for v2.0"); + Logger.getGlobal().info("Done executing Script for v2.0"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index 8849917..d134119 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -7,6 +7,8 @@ import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.version.VersionedObject; +import java.util.logging.Logger; + /** * A practical example of usage in a few steps: @@ -34,7 +36,7 @@ public static void main(String[] args) VersionedObject versionedBranch = new VersionedObject<>(BusinessBranch.createDummyBranch()); storageManager.setRoot(versionedBranch); storageManager.storeRoot(); - System.out.println(storageManager.root().toString()); + Logger.getGlobal().info(storageManager.root().toString()); } @@ -45,7 +47,7 @@ public static void main(String[] args) VersionedObject versionedBranch = (VersionedObject)storageManager.root(); new MigrationManager(versionedBranch, migraterWithV1, storageManager) .migrate(versionedBranch); - System.out.println(storageManager.root().toString()); + Logger.getGlobal().info(storageManager.root().toString()); } @@ -56,7 +58,7 @@ public static void main(String[] args) VersionedObject versionedBranch = (VersionedObject)storageManager.root(); new MigrationManager(versionedBranch, migraterWithV2, storageManager) .migrate(versionedBranch); - System.out.println(storageManager.root().toString()); + Logger.getGlobal().info(storageManager.root().toString()); } } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index 027cbf1..ac9ae49 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -9,6 +9,8 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; +import java.util.logging.Logger; + public class UpdateToV1_0 implements MigrationScript> { @@ -21,7 +23,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context, MigrationEmbeddedStorageManager> context) { - System.out.println("Executing Script for v1.0..."); + Logger.getGlobal().info("Executing Script for v1.0..."); VersionedObject versionedBranch = context.getMigratingObject(); BusinessBranch oldBranch = (BusinessBranch) versionedBranch.getObject(); @@ -40,6 +42,6 @@ public void migrate(Context, MigrationEmbeddedStorageMan } versionedBranch.setObject(newBranch); context.getStorageManager().store(versionedBranch); - System.out.println("Done executing Script for v1.0"); + Logger.getGlobal().info("Done executing Script for v1.0"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 3eaf293..55a63b4 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -8,6 +8,8 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; +import java.util.logging.Logger; + public class UpdateToV2_0 implements MigrationScript> { @@ -20,7 +22,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context, MigrationEmbeddedStorageManager> context) { - System.out.println("Executing Script for v2.0..."); + Logger.getGlobal().info("Executing Script for v2.0..."); VersionedObject versionedBranch = context.getMigratingObject(); final BusinessBranch branch = versionedBranch.getObject(); Customer newCustomer = new Customer(); @@ -30,6 +32,6 @@ public void migrate(Context, MigrationEmbeddedSt newCustomer.address.city = "Phoenix"; branch.customers.add(newCustomer); context.getStorageManager().store(branch.customers); - System.out.println("Done executing Script for v2.0"); + Logger.getGlobal().info("Done executing Script for v2.0"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index f30faef..4174234 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -6,6 +6,7 @@ import software.xdev.micromigration.migrater.ScriptInstantiationException; import java.util.Date; +import java.util.logging.Logger; /** @@ -20,7 +21,7 @@ public static void main(String[] args) try { final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.examples.reflective.scripts"); final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); - System.out.println(storageManager.root()); + Logger.getGlobal().info(storageManager.root().toString()); if(storageManager.root() == null) { storageManager.setRoot("Hello World! @ " + new Date()); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index 8fa8a35..5872137 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -6,6 +6,7 @@ import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; +import java.util.logging.Logger; public class UpdateToV1_0 implements MigrationScript @@ -19,7 +20,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context context) { - System.out.println("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index da1b76c..f6456bd 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -6,6 +6,7 @@ import software.xdev.micromigration.version.MigrationVersion; import java.util.Date; +import java.util.logging.Logger; public class UpdateToV1_1 implements MigrationScript @@ -19,7 +20,7 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context context) { - System.out.println("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); } } diff --git a/pom.xml b/pom.xml index e3f2d28..0035ac0 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,8 @@ https://docs.microstream.one/manual/intro/system-requirements.html --> 9 3.8.1 + ${java.version} + ${java.version} @@ -194,6 +196,40 @@ + + + de.thetaphi + forbiddenapis + 3.4 + + + + jdk-unsafe + jdk-deprecated + + jdk-non-portable + + jdk-reflection + + jdk-system-out + + + + + + check + testCheck + + + + + org.apache.maven.plugins maven-compiler-plugin diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java index 950c233..7a06c30 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java @@ -4,6 +4,8 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; +import java.util.logging.Logger; + public class NoCorrectConstructorScript implements software.xdev.micromigration.scripts.VersionAgnosticMigrationScript @@ -24,6 +26,6 @@ public MigrationVersion getTargetVersion() @Override public void migrate(Context context) { - System.out.println(this.argument); + Logger.getGlobal().info(this.argument); } } From 05cc63c74460d1ceddb4df9321b8515dd79c1454 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 14:27:22 +0100 Subject: [PATCH 186/306] Moved checkstyle --- README.md | 3 + config/checkstyle.xml | 311 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 314 insertions(+) create mode 100644 config/checkstyle.xml diff --git a/README.md b/README.md index 0809c64..deb261a 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,9 @@ You should have the following things installed: ### Recommended setup * Install ``IntelliJ`` (Community Edition is sufficient) * Install the following plugins: + * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields + * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis + * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis. Uses this [checkstyle](config/checkstyle.xml). * Import the project * Ensure that everything is encoded in ``UTF-8`` * Ensure that the JDK/Java-Version is correct diff --git a/config/checkstyle.xml b/config/checkstyle.xml new file mode 100644 index 0000000..710e3e6 --- /dev/null +++ b/config/checkstyle.xml @@ -0,0 +1,311 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ea52ae0723feb505c533c690641701bef7ec8353 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 14:54:04 +0100 Subject: [PATCH 187/306] Added checkstyle-plugin --- pom.xml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/pom.xml b/pom.xml index 0035ac0..ef91ec0 100644 --- a/pom.xml +++ b/pom.xml @@ -230,6 +230,36 @@ + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.2 + + + com.puppycrawl.tools + checkstyle + 8.44 + + + + config/checkstyle.xml + UTF-8 + false + true + false + + + + validate + validate + + check + + + + + org.apache.maven.plugins maven-compiler-plugin From 84fe665338bebdda47eb9dc04dffc73df318024e Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 14:54:38 +0100 Subject: [PATCH 188/306] Added IntelliJ config-files --- .gitignore | 22 ++++- .idea/checkstyle-idea.xml | 20 +++++ .idea/codeStyles/Project.xml | 92 ++++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 ++ .idea/inspectionProfiles/Project_Default.xml | 6 ++ .idea/saveactions_settings.xml | 21 +++++ core/.idea/.gitignore | 10 +++ core/.idea/checkstyle-idea.xml | 16 ++++ core/.idea/encodings.xml | 8 ++ 9 files changed, 197 insertions(+), 3 deletions(-) create mode 100644 .idea/checkstyle-idea.xml create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/saveactions_settings.xml create mode 100644 core/.idea/.gitignore create mode 100644 core/.idea/checkstyle-idea.xml create mode 100644 core/.idea/encodings.xml diff --git a/.gitignore b/.gitignore index 71b513c..57e6912 100644 --- a/.gitignore +++ b/.gitignore @@ -137,6 +137,22 @@ $RECYCLE.BIN/ #MicroStream Datastore default directory /storage/ -#IntelliJ -.idea -*.iml \ No newline at end of file +# == IntelliJ == +*.iml +*.ipr + +# Some files are user/installation independent and are used for configuring the IDE +# See also https://stackoverflow.com/a/35279076 + +.idea/* +!.idea/saveactions_settings.xml +!.idea/checkstyle-idea.xml + +!.idea/inspectionProfiles/ +.idea/inspectionProfiles/* +!.idea/inspectionProfiles/Project_Default.xml + +!.idea/codeStyles/ +.idea/codeStyles/* +!.idea/codeStyles/codeStyleConfig.xml +!.idea/codeStyles/Project.xml \ No newline at end of file diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..82ed5cc --- /dev/null +++ b/.idea/checkstyle-idea.xml @@ -0,0 +1,20 @@ + + + + 10.0 + JavaOnlyWithTests + true + true + + + + \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..4e97375 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,92 @@ + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6a1691d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml new file mode 100644 index 0000000..71a42c4 --- /dev/null +++ b/.idea/saveactions_settings.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/core/.idea/.gitignore b/core/.idea/.gitignore new file mode 100644 index 0000000..0a8642f --- /dev/null +++ b/core/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Zeppelin ignored files +/ZeppelinRemoteNotebooks/ diff --git a/core/.idea/checkstyle-idea.xml b/core/.idea/checkstyle-idea.xml new file mode 100644 index 0000000..7b1556f --- /dev/null +++ b/core/.idea/checkstyle-idea.xml @@ -0,0 +1,16 @@ + + + + 10.3 + JavaOnly + true + + + \ No newline at end of file diff --git a/core/.idea/encodings.xml b/core/.idea/encodings.xml new file mode 100644 index 0000000..1597092 --- /dev/null +++ b/core/.idea/encodings.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From ec54a36b43ff5091ae669d168f6bf361fca05fbb Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 15:16:22 +0100 Subject: [PATCH 189/306] Code formatting with new IntelliJ settings --- ...nosticMigrationEmbeddedStorageManager.java | 51 +++++---- .../VersionAgnosticMigrationManager.java | 16 +-- .../migrater/AbstractMigrater.java | 108 +++++++++--------- .../migrater/ExplicitMigrater.java | 12 +- .../migrater/MicroMigrater.java | 11 +- .../VersionAlreadyRegisteredException.java | 16 +-- .../AbstractScriptExecutionNotification.java | 20 ++-- ...cutionNotificationWithScriptReference.java | 26 ++--- ...ionNotificationWithoutScriptReference.java | 6 +- .../ReflectiveVersionMigrationScript.java | 8 +- .../scripts/SimpleMigrationScript.java | 4 +- .../scripts/SimpleTypedMigrationScript.java | 17 ++- .../VersionAgnosticMigrationScript.java | 4 +- .../version/VersionedAndKeeperOfHistory.java | 4 +- .../version/VersionedObjectWithHistory.java | 8 +- .../micromigration/version/VersionedRoot.java | 23 ++-- .../version/VersionedRootWithHistory.java | 8 +- .../ReflectiveVersionMigrationScriptTest.java | 3 +- .../version/MigrationVersionTest.java | 25 ++-- .../examples/explicit/MainExplicit.java | 8 +- .../explicit/scripts/UpdateToV1_0.java | 10 +- .../explicit/scripts/UpdateToV1_1.java | 10 +- .../notification/MainNotification.java | 10 +- ...alWithMigrationEmbeddedStorageManager.java | 12 +- .../practical/embedded/UpdateToV1_0.java | 14 +-- .../practical/embedded/UpdateToV2_0.java | 8 +- .../MainPracticalWithMigrationManager.java | 18 +-- .../migrationManager/UpdateToV1_0.java | 16 +-- .../migrationManager/UpdateToV2_0.java | 10 +- .../examples/reflective/MainReflective.java | 10 +- .../reflective/scripts/UpdateToV1_0.java | 10 +- .../reflective/scripts/UpdateToV1_1.java | 10 +- .../microstream/MigrationEmbeddedStorage.java | 12 +- .../microstream/MigrationManager.java | 22 ++-- .../TunnelingEmbeddedStorageManager.java | 6 +- ...oduceMigrationOnExistingDatastoreTest.java | 10 +- .../integration/MigrationHistoryTest.java | 9 +- .../MigrationScriptAfterScriptTest.java | 39 ++++--- .../integration/MultipleScriptsTest.java | 9 +- ...oreStuffInMigrationStorageManagerTest.java | 15 +-- .../migrater/ExplicitMigraterTest.java | 9 +- .../microstream/MigrationEmbeddedStorage.java | 6 +- .../microstream/MigrationManager.java | 6 +- .../TunnelingEmbeddedStorageManager.java | 6 +- ...oduceMigrationOnExistingDatastoreTest.java | 15 +-- .../MigrationScriptAfterScriptTest.java | 19 +-- .../integration/MultipleScriptsTest.java | 9 +- ...oreStuffInMigrationStorageManagerTest.java | 13 ++- .../migrater/ExplicitMigraterTest.java | 9 +- .../microstream/MigrationEmbeddedStorage.java | 16 +-- .../microstream/MigrationManager.java | 22 ++-- .../TunnelingEmbeddedStorageManager.java | 6 +- ...oduceMigrationOnExistingDatastoreTest.java | 15 +-- .../MigrationScriptAfterScriptTest.java | 19 +-- .../integration/MultipleScriptsTest.java | 9 +- ...oreStuffInMigrationStorageManagerTest.java | 13 ++- .../migrater/ExplicitMigraterTest.java | 9 +- .../migrater/ReflectiveMigrater.java | 59 +++++----- .../migrater/ReflectiveMigraterTest.java | 15 +-- .../NoCorrectConstructorScript.java | 8 +- 60 files changed, 476 insertions(+), 445 deletions(-) diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java index cae1aa7..a129f49 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream.versionagnostic; +import java.util.List; +import java.util.Objects; + import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; import software.xdev.micromigration.version.MigrationVersion; @@ -7,9 +10,6 @@ import software.xdev.micromigration.version.VersionedRoot; import software.xdev.micromigration.version.VersionedRootWithHistory; -import java.util.List; -import java.util.Objects; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. @@ -30,21 +30,21 @@ public abstract class VersionAgnosticMigrationEmbeddedStorageManager implements AutoCloseable { - private final MicroMigrater migrater ; - private VersionedRootWithHistory versionRoot ; - - private VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager; - + private final MicroMigrater migrater; + private VersionedRootWithHistory versionRoot; + + private final VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager; + /** - * @param tunnelingManager which will be used as the underlying storage manager. - * Almost all methods are only rerouted to this native manager. - * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted - * and a {@link Versioned} is placed between the requests. - * @param migrater which is used as source for the migration scripts + * @param tunnelingManager which will be used as the underlying storage manager. Almost all methods are only + * rerouted to this native manager. Only {@link #start()}, {@link #root()} and + * {@link #setRoot(Object)} are intercepted and a {@link Versioned} is placed between the + * requests. + * @param migrater which is used as source for the migration scripts */ public VersionAgnosticMigrationEmbeddedStorageManager( - VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager, - MicroMigrater migrater + final VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager, + final MicroMigrater migrater ) { this.tunnelingManager = Objects.requireNonNull(tunnelingManager); @@ -79,12 +79,12 @@ public T start() { //Build VersionedRootWithHistory around actual root, set by user. this.versionRoot = new VersionedRootWithHistory(this.tunnelingManager.root()); - this.tunnelingManager.setRoot(versionRoot); + this.tunnelingManager.setRoot(this.versionRoot); this.tunnelingManager.storeRoot(); } new VersionAgnosticMigrationManager( this.versionRoot, - migrater, + this.migrater, this ) .migrate(this.versionRoot.getRoot()); @@ -105,20 +105,23 @@ public MigrationVersion getCurrentVersion() public Object root() { return this.versionRoot.getRoot(); } - + /** * @return the actual root object */ - public List getMigrationHistory() { + public List getMigrationHistory() + { return this.versionRoot.getMigrationHistory(); } - + /** * Sets the actual root element (not the versioned root) + * * @param newRoot to set * @return the set object */ - public Object setRoot(Object newRoot) { + public Object setRoot(final Object newRoot) + { this.versionRoot.setRoot(newRoot); return newRoot; } @@ -131,13 +134,15 @@ public long storeRoot() { this.tunnelingManager.store(this.versionRoot); return this.tunnelingManager.store(this.versionRoot.getRoot()); } - + /** * Stores the objectToStore + * * @param objectToStore which is stored * @return what EmbeddedStorageManager#store returns */ - public long store(Object objectToStore) { + public long store(final Object objectToStore) + { return this.tunnelingManager.store(objectToStore); } diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index 9ce9449..54cc8c6 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -1,5 +1,9 @@ package software.xdev.micromigration.microstream.versionagnostic; +import java.util.Objects; +import java.util.function.Consumer; +import java.util.function.Supplier; + import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; @@ -7,10 +11,6 @@ import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedAndKeeperOfHistory; -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Supplier; - /** * Manages a given object and keeps the version for it. @@ -121,9 +121,9 @@ public class VersionAgnosticMigrationManager * Migrates the given object to the newest possible version, defined by the {@link MicroMigrater}. * @param objectToMigrate is given to the {@link MicroMigrater} for migrating upon */ - public void migrate(Object objectToMigrate) + public void migrate(final Object objectToMigrate) { - final MigrationVersion versionBeforeUpdate = currentVersionGetter.get(); + final MigrationVersion versionBeforeUpdate = this.currentVersionGetter.get(); // Execute Updates final MigrationVersion versionAfterUpdate = this.migrater.migrateToNewest( versionBeforeUpdate, @@ -133,8 +133,8 @@ public void migrate(Object objectToMigrate) //Update stored version, if needed if(!versionAfterUpdate.equals(versionBeforeUpdate)) { - currentVersionSetter.accept(versionAfterUpdate); - currentVersionStorer.accept(versionAfterUpdate); + this.currentVersionSetter.accept(versionAfterUpdate); + this.currentVersionStorer.accept(versionAfterUpdate); } } } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 2595e60..0721da1 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -1,11 +1,5 @@ package software.xdev.micromigration.migrater; -import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; -import software.xdev.micromigration.notification.ScriptExecutionNotificationWithScriptReference; -import software.xdev.micromigration.scripts.Context; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; -import software.xdev.micromigration.version.MigrationVersion; - import java.time.Clock; import java.time.LocalDateTime; import java.util.ArrayList; @@ -14,79 +8,86 @@ import java.util.TreeSet; import java.util.function.Consumer; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithScriptReference; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + /** - * Provides the basic functionality to apply {@link VersionAgnosticMigrationScript}s to - * a datastore. + * Provides the basic functionality to apply {@link VersionAgnosticMigrationScript}s to a datastore. * * @author Johannes Rabauer */ public abstract class AbstractMigrater implements MicroMigrater -{ - private List> notificationConsumers = new ArrayList<>(); +{ + private final List> notificationConsumers = + new ArrayList<>(); private Clock clock = Clock.systemDefaultZone(); - - - public void registerNotificationConsumer(Consumer notificationConsumer) + + @Override + public void registerNotificationConsumer(final Consumer notificationConsumer) { this.notificationConsumers.add(notificationConsumer); } @Override - public > MigrationVersion migrateToNewest( - MigrationVersion fromVersion , - E storageManager, - Object root + public > MigrationVersion migrateToNewest( + final MigrationVersion fromVersion, + final E storageManager, + final Object root ) { Objects.requireNonNull(fromVersion); Objects.requireNonNull(storageManager); - TreeSet> sortedScripts = getSortedScripts(); + final TreeSet> sortedScripts = this.getSortedScripts(); if(sortedScripts.size() > 0) { - return migrateToVersion( - fromVersion , - getSortedScripts().last().getTargetVersion(), - storageManager , + return this.migrateToVersion( + fromVersion, + this.getSortedScripts().last().getTargetVersion(), + storageManager, root ); } return fromVersion; } - + @SuppressWarnings("unchecked") @Override - public > MigrationVersion migrateToVersion - ( - MigrationVersion fromVersion , - MigrationVersion targetVersion , - E storageManager , - Object objectToMigrate - ) + public > MigrationVersion migrateToVersion + ( + final MigrationVersion fromVersion, + final MigrationVersion targetVersion, + final E storageManager, + final Object objectToMigrate + ) { Objects.requireNonNull(fromVersion); Objects.requireNonNull(targetVersion); Objects.requireNonNull(storageManager); MigrationVersion updateVersionWhichWasExecuted = fromVersion; - for (VersionAgnosticMigrationScript script : this.getSortedScripts()) + for(final VersionAgnosticMigrationScript script : this.getSortedScripts()) { - VersionAgnosticMigrationScript castedScript = (VersionAgnosticMigrationScript)script; + final VersionAgnosticMigrationScript castedScript = (VersionAgnosticMigrationScript)script; if(MigrationVersion.COMPARATOR.compare(fromVersion, script.getTargetVersion()) < 0) { if(MigrationVersion.COMPARATOR.compare(script.getTargetVersion(), targetVersion) <= 0) { LocalDateTime startDate = null; - MigrationVersion versionBeforeUpdate = updateVersionWhichWasExecuted; + final MigrationVersion versionBeforeUpdate = updateVersionWhichWasExecuted; if(!this.notificationConsumers.isEmpty()) { startDate = LocalDateTime.now(this.clock); } - updateVersionWhichWasExecuted = migrateWithScript(castedScript, storageManager, objectToMigrate); + updateVersionWhichWasExecuted = + this.migrateWithScript(castedScript, storageManager, objectToMigrate); if(!this.notificationConsumers.isEmpty()) { - ScriptExecutionNotificationWithScriptReference scriptNotification = + final ScriptExecutionNotificationWithScriptReference scriptNotification = new ScriptExecutionNotificationWithScriptReference( script, versionBeforeUpdate, @@ -104,12 +105,12 @@ public > Migration @SuppressWarnings("unchecked") private > MigrationVersion migrateWithScript( - VersionAgnosticMigrationScript script , - E storageManager , - Object objectToMigrate + final VersionAgnosticMigrationScript script, + final E storageManager, + final Object objectToMigrate ) { - T castedObjectToMigrate = (T) objectToMigrate; + final T castedObjectToMigrate = (T)objectToMigrate; script.migrate(new Context<>(castedObjectToMigrate, storageManager)); return script.getTargetVersion(); } @@ -117,33 +118,38 @@ private > Migrat /** * Checks if the given {@link VersionAgnosticMigrationScript} is not already registered in the * {@link #getSortedScripts()}. - * @throws VersionAlreadyRegisteredException if script is already registered. + * * @param scriptToCheck It's target version is checked, if it is not already registered. + * @throws VersionAlreadyRegisteredException if script is already registered. */ - protected void checkIfVersionIsAlreadyRegistered(VersionAgnosticMigrationScript scriptToCheck) + protected void checkIfVersionIsAlreadyRegistered(final VersionAgnosticMigrationScript scriptToCheck) { - //Check if same version is not already registered - for (VersionAgnosticMigrationScript alreadyRegisteredScript : this.getSortedScripts()) + // Check if same version is not already registered + for(final VersionAgnosticMigrationScript alreadyRegisteredScript : this.getSortedScripts()) { - if(MigrationVersion.COMPARATOR.compare(alreadyRegisteredScript.getTargetVersion(), scriptToCheck.getTargetVersion()) == 0) + if(MigrationVersion.COMPARATOR.compare( + alreadyRegisteredScript.getTargetVersion(), + scriptToCheck.getTargetVersion()) == 0) { - //Two scripts with the same version are not allowed to get registered. + // Two scripts with the same version are not allowed to get registered. throw new VersionAlreadyRegisteredException( - alreadyRegisteredScript.getTargetVersion(), - alreadyRegisteredScript, - scriptToCheck + alreadyRegisteredScript.getTargetVersion(), + alreadyRegisteredScript, + scriptToCheck ); } } } - + /** * Change used clock for notifications from {@link #registerNotificationConsumer(Consumer)}. + * * @param clock is used when a - * {@link software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference} is created + * {@link software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference} + * is created * @return self */ - public AbstractMigrater withClock(Clock clock) + public AbstractMigrater withClock(final Clock clock) { this.clock = clock; return this; diff --git a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java index b5ccdec..bdc95d3 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java @@ -1,16 +1,16 @@ package software.xdev.micromigration.migrater; +import java.util.TreeSet; + import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; -import java.util.TreeSet; /** * Contains all the available scripts to migrate the datastore to a certain version. *

* This class needs explicit scripts which are then included in the migration process. - * + * * @author Johannes Rabauer - * */ public class ExplicitMigrater extends AbstractMigrater { @@ -22,11 +22,11 @@ public class ExplicitMigrater extends AbstractMigrater * Versions of the scripts must be unique. That means that no version is allowed multiple times in the migrater. * @throws VersionAlreadyRegisteredException if two scripts have the same version */ - public ExplicitMigrater(VersionAgnosticMigrationScript...scripts) throws VersionAlreadyRegisteredException + public ExplicitMigrater(final VersionAgnosticMigrationScript...scripts) throws VersionAlreadyRegisteredException { - for (VersionAgnosticMigrationScript script : scripts) + for (final VersionAgnosticMigrationScript script : scripts) { - checkIfVersionIsAlreadyRegistered(script); + this.checkIfVersionIsAlreadyRegistered(script); this.sortedScripts.add(script); } } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index 8159e1d..cbdb282 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -1,14 +1,14 @@ package software.xdev.micromigration.migrater; +import java.util.TreeSet; +import java.util.function.Consumer; + import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.notification.ScriptExecutionNotificationWithScriptReference; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.util.TreeSet; -import java.util.function.Consumer; - /** * Executes all the available scripts to migrate the datastore to a certain version. @@ -85,11 +85,12 @@ > MigrationVersion E storageManager , Object objectToMigrate ); - + /** * Registers a callback to take action when a script is executed. + * * @param notificationConsumer is executed when a script is used from this migrater. */ - public void registerNotificationConsumer( + void registerNotificationConsumer( Consumer notificationConsumer); } diff --git a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java index 3901cca..df83e90 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -1,10 +1,10 @@ package software.xdev.micromigration.migrater; +import java.util.Objects; + import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.util.Objects; - /** * Exception that should be used if two scripts with the same version exist. @@ -35,9 +35,9 @@ public class VersionAlreadyRegisteredException extends Error * which should be registered as well */ public VersionAlreadyRegisteredException( - MigrationVersion alreadyRegisteredVersion, - VersionAgnosticMigrationScript alreadyRegisteredScript , - VersionAgnosticMigrationScript newScriptToRegister + final MigrationVersion alreadyRegisteredVersion, + final VersionAgnosticMigrationScript alreadyRegisteredScript, + final VersionAgnosticMigrationScript newScriptToRegister ) { super("Version " + alreadyRegisteredVersion.toString() + " is already registered. Versions must be unique within the migrater."); @@ -51,7 +51,7 @@ public VersionAlreadyRegisteredException( */ public MigrationVersion getAlreadyRegisteredVersion() { - return alreadyRegisteredVersion; + return this.alreadyRegisteredVersion; } /** @@ -59,7 +59,7 @@ public MigrationVersion getAlreadyRegisteredVersion() */ public VersionAgnosticMigrationScript getAlreadyRegisteredScript() { - return alreadyRegisteredScript; + return this.alreadyRegisteredScript; } /** @@ -68,6 +68,6 @@ public VersionAgnosticMigrationScript getAlreadyRegisteredScript() */ public VersionAgnosticMigrationScript getNewScriptToRegister() { - return newScriptToRegister; + return this.newScriptToRegister; } } diff --git a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java index c26a7f4..9275b80 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java +++ b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java @@ -1,10 +1,10 @@ package software.xdev.micromigration.notification; +import java.time.LocalDateTime; + import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.MigrationVersion; -import java.time.LocalDateTime; - /** * Contains data about the execution of a script by a {@link MicroMigrater}. @@ -25,10 +25,10 @@ public abstract class AbstractScriptExecutionNotification * @param endDate time when the script has finished */ public AbstractScriptExecutionNotification( - MigrationVersion sourceVersion , - MigrationVersion targetVersion , - LocalDateTime startDate , - LocalDateTime endDate + final MigrationVersion sourceVersion , + final MigrationVersion targetVersion , + final LocalDateTime startDate , + final LocalDateTime endDate ) { super(); @@ -43,7 +43,7 @@ public AbstractScriptExecutionNotification( */ public MigrationVersion getSourceVersion() { - return sourceVersion; + return this.sourceVersion; } /** @@ -51,7 +51,7 @@ public MigrationVersion getSourceVersion() */ public MigrationVersion getTargetVersion() { - return targetVersion; + return this.targetVersion; } /** @@ -59,7 +59,7 @@ public MigrationVersion getTargetVersion() */ public LocalDateTime getStartDate() { - return startDate; + return this.startDate; } /** @@ -67,6 +67,6 @@ public LocalDateTime getStartDate() */ public LocalDateTime getEndDate() { - return endDate; + return this.endDate; } } diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java index cb21885..e4490a9 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.notification; +import java.time.LocalDateTime; + import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.time.LocalDateTime; - /** * Contains data about the execution of a script by a {@link MicroMigrater}. * @@ -14,20 +14,20 @@ public class ScriptExecutionNotificationWithScriptReference extends AbstractScriptExecutionNotification { private final VersionAgnosticMigrationScript executedScript; - + /** * @param executedScript script that was executed - * @param sourceVersion original version of the object before executing the script - * @param targetVersion version of the object after executing the script - * @param startDate time when the script was started - * @param endDate time when the script has finished + * @param sourceVersion original version of the object before executing the script + * @param targetVersion version of the object after executing the script + * @param startDate time when the script was started + * @param endDate time when the script has finished */ public ScriptExecutionNotificationWithScriptReference( - VersionAgnosticMigrationScript executedScript, - MigrationVersion sourceVersion , - MigrationVersion targetVersion , - LocalDateTime startDate , - LocalDateTime endDate + final VersionAgnosticMigrationScript executedScript, + final MigrationVersion sourceVersion, + final MigrationVersion targetVersion, + final LocalDateTime startDate, + final LocalDateTime endDate ) { super( @@ -44,7 +44,7 @@ public ScriptExecutionNotificationWithScriptReference( */ public VersionAgnosticMigrationScript getExecutedScript() { - return executedScript; + return this.executedScript; } } diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java index 4f599b3..c0cd327 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java @@ -18,7 +18,7 @@ public class ScriptExecutionNotificationWithoutScriptReference extends AbstractScriptExecutionNotification { private final String executedScriptName; - + /** * @param originalNotification where the reference to the script is deleted and the class name is extracted. */ @@ -26,8 +26,8 @@ public ScriptExecutionNotificationWithoutScriptReference(final ScriptExecutionNo { super( originalNotification.getSourceVersion(), - originalNotification.getTargetVersion(), - originalNotification.getStartDate() , + originalNotification.getTargetVersion(), + originalNotification.getStartDate(), originalNotification.getEndDate() ); this.executedScriptName = originalNotification.getExecutedScript().getClass().getSimpleName(); diff --git a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java index edf1253..2e5e389 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -1,10 +1,10 @@ package software.xdev.micromigration.scripts; +import java.util.ArrayList; + import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; -import java.util.ArrayList; - /** * Script which creates the target version of the script through the class name. @@ -42,7 +42,7 @@ public abstract class ReflectiveVersionMigrationScript> implements VersionAgnosticMigrationScript +public class SimpleTypedMigrationScript> + implements VersionAgnosticMigrationScript { private final MigrationVersion version ; private final Consumer> consumer; @@ -41,7 +40,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { this.consumer.accept(context); } diff --git a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java index 16e6375..d5f92dd 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java @@ -1,10 +1,10 @@ package software.xdev.micromigration.scripts; +import java.util.Comparator; + import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; -import java.util.Comparator; - /** * Interface for scripts to migrate / update datastores. diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java index a1d4b68..77b2a7f 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java @@ -1,9 +1,9 @@ package software.xdev.micromigration.version; -import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; - import java.util.List; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; + /** * Interface used by the MigrationManagers for easier versioning of objects diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java index c981bd9..9cd5326 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.version; -import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; + /** * This class is inserted as the root of the MicroStream datastore and contains only the @@ -21,14 +21,14 @@ public class VersionedObjectWithHistory extends VersionedObject implements Versi /** * @param actualRoot which is stored in the datastore and defined by the user */ - public VersionedObjectWithHistory(Object actualRoot) + public VersionedObjectWithHistory(final Object actualRoot) { super(actualRoot); this.migrationHistory = new ArrayList<>(); } @Override - public void addExecutedScript(ScriptExecutionNotificationWithoutScriptReference executedScriptInformation) + public void addExecutedScript(final ScriptExecutionNotificationWithoutScriptReference executedScriptInformation) { this.migrationHistory.add(Objects.requireNonNull(executedScriptInformation)); } diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java index a0eee3f..475390e 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java @@ -3,28 +3,27 @@ import java.util.Objects; /** - * This class is inserted as the root of the MicroStream datastore and contains only the - * current version and the actual root object. - * + * This class is inserted as the root of the MicroStream datastore and contains only the current version and the actual + * root object. + * * @author Johannes Rabauer - * */ -public class VersionedRoot implements Versioned +public class VersionedRoot implements Versioned { private MigrationVersion currentVersion; - private Object actualRoot ; - + private Object actualRoot; + /** * @param actualRoot which is stored in the datastore and defined by the user */ - public VersionedRoot(Object actualRoot) + public VersionedRoot(final Object actualRoot) { - this.actualRoot = actualRoot ; + this.actualRoot = actualRoot; this.currentVersion = new MigrationVersion(0); } @Override - public void setVersion(MigrationVersion version) + public void setVersion(final MigrationVersion version) { Objects.requireNonNull(version); this.currentVersion = version; @@ -35,11 +34,11 @@ public MigrationVersion getVersion() { return this.currentVersion; } - + /** * @param actualRoot which is stored in the datastore and defined by the user */ - public void setRoot(Object actualRoot) + public void setRoot(final Object actualRoot) { this.actualRoot = actualRoot; } diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java index ac4476b..881afeb 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java @@ -1,11 +1,11 @@ package software.xdev.micromigration.version; -import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; - import java.util.ArrayList; import java.util.List; import java.util.Objects; +import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; + /** * This class is inserted as the root of the MicroStream datastore and contains only the @@ -21,14 +21,14 @@ public class VersionedRootWithHistory extends VersionedRoot implements Versioned /** * @param actualRoot which is stored in the datastore and defined by the user */ - public VersionedRootWithHistory(Object actualRoot) + public VersionedRootWithHistory(final Object actualRoot) { super(actualRoot); this.migrationHistory = new ArrayList<>(); } @Override - public void addExecutedScript(ScriptExecutionNotificationWithoutScriptReference executedScriptInformation) + public void addExecutedScript(final ScriptExecutionNotificationWithoutScriptReference executedScriptInformation) { this.migrationHistory.add(Objects.requireNonNull(executedScriptInformation)); } diff --git a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index b63f364..f3b4fa4 100644 --- a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -2,6 +2,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; + import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; @@ -126,7 +127,7 @@ void testInvalildName_v___InvalidClassName() public static class ReflectiveVersionMigrationScriptDummy extends ReflectiveVersionMigrationScript> { @Override - public void migrate(Context> context) { + public void migrate(final Context> context) { //Dummy } } diff --git a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java index a4c502e..5fb0285 100644 --- a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java +++ b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java @@ -3,45 +3,44 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import software.xdev.micromigration.version.MigrationVersion; class MigrationVersionTest { - + @Test - void testToString_v1() + void testToString_v1() { - MigrationVersion version = new MigrationVersion(1); + final MigrationVersion version = new MigrationVersion(1); assertEquals("v1", version.toString()); } @Test - void testToString_v11() + void testToString_v11() { - MigrationVersion version = new MigrationVersion(1,1); + final MigrationVersion version = new MigrationVersion(1, 1); assertEquals("v1.1", version.toString()); } @Test - void testToString_v111() + void testToString_v111() { - MigrationVersion version = new MigrationVersion(1,1,1); + final MigrationVersion version = new MigrationVersion(1, 1, 1); assertEquals("v1.1.1", version.toString()); } @Test - void testToString_v0() + void testToString_v0() { - MigrationVersion version = new MigrationVersion(0); + final MigrationVersion version = new MigrationVersion(0); assertEquals("v0", version.toString()); } @Test - void testToString_vNull() + void testToString_vNull() { - MigrationVersion version = new MigrationVersion(); + final MigrationVersion version = new MigrationVersion(); assertEquals("v0", version.toString()); } - + } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index 1a6df55..94dd857 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.examples.explicit; +import java.util.Date; +import java.util.logging.Logger; + import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_0; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_1; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; @@ -7,9 +10,6 @@ import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.migrater.ExplicitMigrater; -import java.util.Date; -import java.util.logging.Logger; - /** * The most basic usage of micro migration. @@ -21,7 +21,7 @@ */ public class MainExplicit { - public static void main(String[] args) + public static void main(final String[] args) { final ExplicitMigrater migrater = new ExplicitMigrater( new UpdateToV1_0(), diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 1d18cda..984730c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -1,13 +1,13 @@ package software.xdev.micromigration.examples.explicit.scripts; +import java.util.Date; +import java.util.logging.Logger; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.Date; -import java.util.logging.Logger; - public class UpdateToV1_0 implements MigrationScript { @@ -18,9 +18,9 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { - Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + this.getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index 4ae8bc0..6f9b20f 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -1,13 +1,13 @@ package software.xdev.micromigration.examples.explicit.scripts; +import java.util.Date; +import java.util.logging.Logger; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.Date; -import java.util.logging.Logger; - public class UpdateToV1_1 implements MigrationScript { @@ -18,9 +18,9 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { - Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + this.getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index c6fe3bd..fdec4cc 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -1,14 +1,14 @@ package software.xdev.micromigration.examples.notification; +import java.util.Date; +import java.util.logging.Logger; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.Date; -import java.util.logging.Logger; - /** * Shows the basic registration of migration notifications @@ -18,7 +18,7 @@ */ public class MainNotification { - public static void main(String[] args) + public static void main(final String[] args) { final ExplicitMigrater migrater = new ExplicitMigrater( new MainNotification.UpdateToV1_0() @@ -46,7 +46,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 8f1d9ca..815bcae 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -1,12 +1,12 @@ package software.xdev.micromigration.examples.practical.embedded; +import java.util.logging.Logger; + import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; -import java.util.logging.Logger; - /** * A practical example of usage in a few steps: @@ -22,11 +22,11 @@ */ public class MainPracticalWithMigrationEmbeddedStorageManager { - public static void main(String[] args) + public static void main(final String[] args) { //V0.0 final ExplicitMigrater emptyMigrater = new ExplicitMigrater(); - try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(emptyMigrater)) + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(emptyMigrater)) { storageManager.setRoot(BusinessBranch.createDummyBranch()); storageManager.storeRoot(); @@ -36,7 +36,7 @@ public static void main(String[] args) //V1.0 final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); - try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV1)) + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV1)) { Logger.getGlobal().info(storageManager.root().toString()); } @@ -47,7 +47,7 @@ public static void main(String[] args) new UpdateToV1_0(), new UpdateToV2_0() ); - try(MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV2)) + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV2)) { Logger.getGlobal().info(storageManager.root().toString()); } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index 4f0b6e5..6b24a5b 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -1,5 +1,7 @@ package software.xdev.micromigration.examples.practical.embedded; +import java.util.logging.Logger; + import software.xdev.micromigration.examples.practical.v1AndHigher.Address; import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; @@ -8,8 +10,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.logging.Logger; - public class UpdateToV1_0 implements MigrationScript { @@ -20,15 +20,15 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { Logger.getGlobal().info("Executing Script for v1.0..."); - software.xdev.micromigration.examples.practical.v0.BusinessBranch oldBranch = context.getMigratingObject(); - BusinessBranch newBranch = + final software.xdev.micromigration.examples.practical.v0.BusinessBranch oldBranch = context.getMigratingObject(); + final BusinessBranch newBranch = new BusinessBranch(); - for (software.xdev.micromigration.examples.practical.v0.Customer oldCustomer : oldBranch.customers) + for (final software.xdev.micromigration.examples.practical.v0.Customer oldCustomer : oldBranch.customers) { - Customer newCustomer = + final Customer newCustomer = new Customer(); newCustomer.name = oldCustomer.name; newCustomer.address = new Address(); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index 4547555..90db78a 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -1,5 +1,7 @@ package software.xdev.micromigration.examples.practical.embedded; +import java.util.logging.Logger; + import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; @@ -7,8 +9,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.logging.Logger; - public class UpdateToV2_0 implements MigrationScript { @@ -19,11 +19,11 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { Logger.getGlobal().info("Executing Script for v2.0..."); final BusinessBranch branch = context.getMigratingObject(); - Customer newCustomer = new Customer(); + final Customer newCustomer = new Customer(); newCustomer.name = "Stevie Nicks"; newCustomer.address.number = 5; newCustomer.address.street = "Fleetwood Street"; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index d134119..5ede2ec 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -1,5 +1,7 @@ package software.xdev.micromigration.examples.practical.migrationManager; +import java.util.logging.Logger; + import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; @@ -7,8 +9,6 @@ import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.version.VersionedObject; -import java.util.logging.Logger; - /** * A practical example of usage in a few steps: @@ -28,12 +28,12 @@ public class MainPracticalWithMigrationManager * Suppressed Warning "unchecked" because it is given, that the correct object is returned. */ @SuppressWarnings("unchecked") - public static void main(String[] args) + public static void main(final String[] args) { //V0.0 - try(EmbeddedStorageManager storageManager = EmbeddedStorage.start()) + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start()) { - VersionedObject versionedBranch = new VersionedObject<>(BusinessBranch.createDummyBranch()); + final VersionedObject versionedBranch = new VersionedObject<>(BusinessBranch.createDummyBranch()); storageManager.setRoot(versionedBranch); storageManager.storeRoot(); Logger.getGlobal().info(storageManager.root().toString()); @@ -41,10 +41,10 @@ public static void main(String[] args) //V1.0 - try(EmbeddedStorageManager storageManager = EmbeddedStorage.start()) + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start()) { final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); - VersionedObject versionedBranch = (VersionedObject)storageManager.root(); + final VersionedObject versionedBranch = (VersionedObject)storageManager.root(); new MigrationManager(versionedBranch, migraterWithV1, storageManager) .migrate(versionedBranch); Logger.getGlobal().info(storageManager.root().toString()); @@ -52,10 +52,10 @@ public static void main(String[] args) //V2.0 - try(EmbeddedStorageManager storageManager = EmbeddedStorage.start()) + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start()) { final ExplicitMigrater migraterWithV2 = new ExplicitMigrater(new UpdateToV1_0(), new UpdateToV2_0()); - VersionedObject versionedBranch = (VersionedObject)storageManager.root(); + final VersionedObject versionedBranch = (VersionedObject)storageManager.root(); new MigrationManager(versionedBranch, migraterWithV2, storageManager) .migrate(versionedBranch); Logger.getGlobal().info(storageManager.root().toString()); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index ac9ae49..265d54f 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -1,5 +1,7 @@ package software.xdev.micromigration.examples.practical.migrationManager; +import java.util.logging.Logger; + import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; @@ -9,8 +11,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -import java.util.logging.Logger; - public class UpdateToV1_0 implements MigrationScript> { @@ -21,17 +21,17 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context, MigrationEmbeddedStorageManager> context) + public void migrate(final Context, MigrationEmbeddedStorageManager> context) { Logger.getGlobal().info("Executing Script for v1.0..."); - VersionedObject versionedBranch = context.getMigratingObject(); - BusinessBranch oldBranch = + final VersionedObject versionedBranch = context.getMigratingObject(); + final BusinessBranch oldBranch = (BusinessBranch) versionedBranch.getObject(); - software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch newBranch = + final software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch newBranch = new software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch(); - for (Customer oldCustomer : oldBranch.customers) + for (final Customer oldCustomer : oldBranch.customers) { - software.xdev.micromigration.examples.practical.v1AndHigher.Customer newCustomer = + final software.xdev.micromigration.examples.practical.v1AndHigher.Customer newCustomer = new software.xdev.micromigration.examples.practical.v1AndHigher.Customer(); newCustomer.name = oldCustomer.name; newCustomer.address = new Address(); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 55a63b4..9f46884 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -1,5 +1,7 @@ package software.xdev.micromigration.examples.practical.migrationManager; +import java.util.logging.Logger; + import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; @@ -8,8 +10,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; -import java.util.logging.Logger; - public class UpdateToV2_0 implements MigrationScript> { @@ -20,12 +20,12 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context, MigrationEmbeddedStorageManager> context) + public void migrate(final Context, MigrationEmbeddedStorageManager> context) { Logger.getGlobal().info("Executing Script for v2.0..."); - VersionedObject versionedBranch = context.getMigratingObject(); + final VersionedObject versionedBranch = context.getMigratingObject(); final BusinessBranch branch = versionedBranch.getObject(); - Customer newCustomer = new Customer(); + final Customer newCustomer = new Customer(); newCustomer.name = "Stevie Nicks"; newCustomer.address.number = 5; newCustomer.address.street = "Fleetwood Street"; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index 4174234..4b766de 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -1,13 +1,13 @@ package software.xdev.micromigration.examples.reflective; +import java.util.Date; +import java.util.logging.Logger; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ReflectiveMigrater; import software.xdev.micromigration.migrater.ScriptInstantiationException; -import java.util.Date; -import java.util.logging.Logger; - /** * Shows the usage of the {@link ReflectiveMigrater}. Very simple. @@ -16,7 +16,7 @@ */ public class MainReflective { - public static void main(String[] args) + public static void main(final String[] args) { try { final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.examples.reflective.scripts"); @@ -29,7 +29,7 @@ public static void main(String[] args) storageManager.storeRoot(); storageManager.shutdown(); } - catch (IllegalArgumentException | SecurityException | ScriptInstantiationException e) + catch (final IllegalArgumentException | SecurityException | ScriptInstantiationException e) { throw new Error("Could not initiate migration script", e); } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index 5872137..0ffc05c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -1,13 +1,13 @@ package software.xdev.micromigration.examples.reflective.scripts; +import java.util.Date; +import java.util.logging.Logger; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.Date; -import java.util.logging.Logger; - public class UpdateToV1_0 implements MigrationScript { @@ -18,9 +18,9 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { - Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + this.getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.0"); } } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index f6456bd..a6f7cd9 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -1,13 +1,13 @@ package software.xdev.micromigration.examples.reflective.scripts; +import java.util.Date; +import java.util.logging.Logger; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.Date; -import java.util.logging.Logger; - public class UpdateToV1_1 implements MigrationScript { @@ -18,9 +18,9 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { - Logger.getGlobal().info("Update " + getTargetVersion().toString() + " executed."); + Logger.getGlobal().info("Update " + this.getTargetVersion().toString() + " executed."); context.getStorageManager().setRoot("Hello World! @ " + new Date() + " Update 1.1"); } } diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 6eb8cf1..6fd7d63 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -3,12 +3,12 @@ import java.nio.file.Path; import java.util.Objects; -import software.xdev.micromigration.migrater.MicroMigrater; import one.microstream.afs.nio.types.NioFileSystem; import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import one.microstream.storage.types.Storage; import one.microstream.storage.types.StorageConfiguration; +import software.xdev.micromigration.migrater.MicroMigrater; /** @@ -29,7 +29,7 @@ public class MigrationEmbeddedStorage * @param migrater which is used as source for the migration scripts * @return the created storage manager with the given migrater */ - public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) + public static final MigrationEmbeddedStorageManager start(final MicroMigrater migrater) { Objects.requireNonNull(migrater); return new MigrationEmbeddedStorageManager( @@ -50,8 +50,8 @@ public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater */ @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start( - Path storageDirectory, - MicroMigrater migrater + final Path storageDirectory, + final MicroMigrater migrater ) { Objects.requireNonNull(migrater); @@ -63,9 +63,9 @@ public static final MigrationEmbeddedStorageManager start( ).start(); } - private static EmbeddedStorageManager createStorageManager(Path storageDirectory) + private static EmbeddedStorageManager createStorageManager(final Path storageDirectory) { - NioFileSystem fileSystem = NioFileSystem.New(); + final NioFileSystem fileSystem = NioFileSystem.New(); return EmbeddedStorageFoundation.New() .setConfiguration( StorageConfiguration.Builder() diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 5967cf5..8365e4a 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.util.function.Consumer; +import java.util.function.Supplier; + import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; @@ -7,9 +10,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import java.util.function.Consumer; -import java.util.function.Supplier; - /** * Specific implementation of the {@link VersionAgnosticMigrationManager} for one @@ -29,11 +29,11 @@ public class MigrationManager extends VersionAgnosticMigrationManager currentVersionGetter, - Consumer currentVersionSetter, - Consumer currentVersionStorer, - MicroMigrater migrater, - EmbeddedStorageManager storageManager + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater, + final EmbeddedStorageManager storageManager ) { super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); @@ -48,9 +48,9 @@ public MigrationManager( * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. */ public MigrationManager( - Versioned versionedObject, - MicroMigrater migrater , - EmbeddedStorageManager storageManager + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager ) { super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 53c2c1a..7f1c871 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.util.Objects; +import java.util.function.Predicate; + import one.microstream.afs.types.AFile; import one.microstream.collections.types.XGettingEnum; import one.microstream.persistence.binary.types.Binary; @@ -22,9 +25,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; -import java.util.Objects; -import java.util.function.Predicate; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 9651585..3496c2e 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -5,17 +5,17 @@ import java.io.IOException; import java.nio.file.Path; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.migrater.ExplicitMigrater; -import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; -import software.xdev.micromigration.version.MigrationVersion; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; class IntroduceMigrationOnExistingDatastoreTest diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java index e7376d7..49828d0 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java @@ -1,7 +1,12 @@ package software.xdev.micromigration.integration; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -9,10 +14,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class MigrationHistoryTest { diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index e714a11..7bdf97d 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,10 +1,18 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationManager; @@ -15,17 +23,10 @@ import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedObject; -import java.io.IOException; -import java.nio.file.Path; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - class MigrationScriptAfterScriptTest { @Test - void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) throws IOException { //First run without any migration script final ExplicitMigrater firstMigrater = new ExplicitMigrater(); @@ -65,7 +66,7 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem } @Test - void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException + void testMigrationWithScriptExecutionNotification(@TempDir final Path storageFolder) throws IOException { final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( new MigrationVersion(1), @@ -89,12 +90,12 @@ void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) t } @Test - void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir final Path storageFolder) throws IOException { //First run without any migration script - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { - VersionedObject firstRoot = new VersionedObject<>(0); + final VersionedObject firstRoot = new VersionedObject<>(0); storageManager.setRoot(firstRoot); storageManager.storeRoot(); assertEquals(Integer.valueOf(0), firstRoot.getObject()); @@ -107,7 +108,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { new MigrationManager( (Versioned) storageManager.root(), @@ -116,7 +117,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ) .migrate(storageManager.root()); @SuppressWarnings("unchecked") - VersionedObject currentRoot = (VersionedObject)storageManager.root(); + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(1), currentRoot.getObject()); assertEquals(new MigrationVersion(1), currentRoot.getVersion()); } @@ -127,7 +128,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { new MigrationManager( (Versioned) storageManager.root(), @@ -136,13 +137,13 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ) .migrate(storageManager.root()); @SuppressWarnings("unchecked") - VersionedObject currentRoot = (VersionedObject)storageManager.root(); + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(2), currentRoot.getObject()); assertEquals(new MigrationVersion(2), currentRoot.getVersion()); } } - private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(Path storageFolder) + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(final Path storageFolder) { return EmbeddedStorage.start(storageFolder); } diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 115ba3b..86cf670 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,8 +1,13 @@ package software.xdev.micromigration.integration; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -11,10 +16,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class MultipleScriptsTest { diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index f7f3c9f..75606f9 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,7 +1,14 @@ package software.xdev.micromigration.integration; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -9,12 +16,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.io.IOException; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - class StoreStuffInMigrationStorageManagerTest { @@ -29,7 +30,7 @@ private static class ChildClass } @Test - void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException + void testStoringSomethingAfterUpdating(@TempDir final Path storageFolder) throws IOException { final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( new MigrationVersion(1), diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index be6360c..5bf03c7 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,18 +1,19 @@ package software.xdev.micromigration.migrater; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class ExplicitMigraterTest { diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index dcc90d1..c677448 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.nio.file.Path; +import java.util.Objects; + import one.microstream.afs.nio.types.NioFileSystem; import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -7,9 +10,6 @@ import one.microstream.storage.types.StorageConfiguration; import software.xdev.micromigration.migrater.MicroMigrater; -import java.nio.file.Path; -import java.util.Objects; - /** * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 5967cf5..87632fd 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.util.function.Consumer; +import java.util.function.Supplier; + import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; @@ -7,9 +10,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import java.util.function.Consumer; -import java.util.function.Supplier; - /** * Specific implementation of the {@link VersionAgnosticMigrationManager} for one diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 53c2c1a..7f1c871 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.util.Objects; +import java.util.function.Predicate; + import one.microstream.afs.types.AFile; import one.microstream.collections.types.XGettingEnum; import one.microstream.persistence.binary.types.Binary; @@ -22,9 +25,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; -import java.util.Objects; -import java.util.function.Predicate; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index ebd46b8..9645dba 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,20 +1,21 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; -import java.io.IOException; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class IntroduceMigrationOnExistingDatastoreTest { diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index e714a11..ac83ff2 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,10 +1,18 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationManager; @@ -15,13 +23,6 @@ import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedObject; -import java.io.IOException; -import java.nio.file.Path; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - class MigrationScriptAfterScriptTest { @Test diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 0c431fb..469edde 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,8 +1,13 @@ package software.xdev.micromigration.integration; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -11,10 +16,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class MultipleScriptsTest { diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index f7f3c9f..7bec51b 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,7 +1,14 @@ package software.xdev.micromigration.integration; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -9,12 +16,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.io.IOException; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - class StoreStuffInMigrationStorageManagerTest { diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index be6360c..5bf03c7 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,18 +1,19 @@ package software.xdev.micromigration.migrater; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class ExplicitMigraterTest { diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index dcc90d1..8d0ca1d 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.nio.file.Path; +import java.util.Objects; + import one.microstream.afs.nio.types.NioFileSystem; import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; import one.microstream.storage.embedded.types.EmbeddedStorageManager; @@ -7,9 +10,6 @@ import one.microstream.storage.types.StorageConfiguration; import software.xdev.micromigration.migrater.MicroMigrater; -import java.nio.file.Path; -import java.util.Objects; - /** * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for @@ -29,7 +29,7 @@ public class MigrationEmbeddedStorage * @param migrater which is used as source for the migration scripts * @return the created storage manager with the given migrater */ - public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater) + public static final MigrationEmbeddedStorageManager start(final MicroMigrater migrater) { Objects.requireNonNull(migrater); return new MigrationEmbeddedStorageManager( @@ -50,8 +50,8 @@ public static final MigrationEmbeddedStorageManager start(MicroMigrater migrater */ @SuppressWarnings("resource") public static final MigrationEmbeddedStorageManager start( - Path storageDirectory, - MicroMigrater migrater + final Path storageDirectory, + final MicroMigrater migrater ) { Objects.requireNonNull(migrater); @@ -63,9 +63,9 @@ public static final MigrationEmbeddedStorageManager start( ).start(); } - private static EmbeddedStorageManager createStorageManager(Path storageDirectory) + private static EmbeddedStorageManager createStorageManager(final Path storageDirectory) { - NioFileSystem fileSystem = NioFileSystem.New(); + final NioFileSystem fileSystem = NioFileSystem.New(); return EmbeddedStorageFoundation.New() .setConfiguration( StorageConfiguration.Builder() diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 5967cf5..8365e4a 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.util.function.Consumer; +import java.util.function.Supplier; + import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; import software.xdev.micromigration.migrater.MicroMigrater; @@ -7,9 +10,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; -import java.util.function.Consumer; -import java.util.function.Supplier; - /** * Specific implementation of the {@link VersionAgnosticMigrationManager} for one @@ -29,11 +29,11 @@ public class MigrationManager extends VersionAgnosticMigrationManager currentVersionGetter, - Consumer currentVersionSetter, - Consumer currentVersionStorer, - MicroMigrater migrater, - EmbeddedStorageManager storageManager + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater, + final EmbeddedStorageManager storageManager ) { super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); @@ -48,9 +48,9 @@ public MigrationManager( * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. */ public MigrationManager( - Versioned versionedObject, - MicroMigrater migrater , - EmbeddedStorageManager storageManager + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager ) { super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 53c2c1a..7f1c871 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,5 +1,8 @@ package software.xdev.micromigration.microstream; +import java.util.Objects; +import java.util.function.Predicate; + import one.microstream.afs.types.AFile; import one.microstream.collections.types.XGettingEnum; import one.microstream.persistence.binary.types.Binary; @@ -22,9 +25,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; -import java.util.Objects; -import java.util.function.Predicate; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index ebd46b8..9645dba 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,20 +1,21 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; -import java.io.IOException; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class IntroduceMigrationOnExistingDatastoreTest { diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index e714a11..ac83ff2 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,10 +1,18 @@ package software.xdev.micromigration.integration; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.concurrent.atomic.AtomicBoolean; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationManager; @@ -15,13 +23,6 @@ import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedObject; -import java.io.IOException; -import java.nio.file.Path; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - class MigrationScriptAfterScriptTest { @Test diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 0c431fb..469edde 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,8 +1,13 @@ package software.xdev.micromigration.integration; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -11,10 +16,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class MultipleScriptsTest { diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index f7f3c9f..7bec51b 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,7 +1,14 @@ package software.xdev.micromigration.integration; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; @@ -9,12 +16,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; -import java.io.IOException; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - class StoreStuffInMigrationStorageManagerTest { diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index be6360c..5bf03c7 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,18 +1,19 @@ package software.xdev.micromigration.migrater; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; -import java.nio.file.Path; - -import static org.junit.jupiter.api.Assertions.assertEquals; - class ExplicitMigraterTest { diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java index 7e2d818..b7e4dc5 100644 --- a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java @@ -1,72 +1,77 @@ package software.xdev.micromigration.migrater; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Modifier; +import java.util.TreeSet; + import org.reflections.Reflections; import org.reflections.scanners.Scanners; import org.reflections.util.ClasspathHelper; import org.reflections.util.ConfigurationBuilder; import org.reflections.util.FilterBuilder; -import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Modifier; -import java.util.TreeSet; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; /** * Contains all the available scripts to migrate the datastore to a certain version. *

* Searches all implementation of {@link VersionAgnosticMigrationScript} in the specified package * and it's the sub packages. - * + * * @author Johannes Rabauer - * + * */ public class ReflectiveMigrater extends AbstractMigrater { - private final TreeSet> sortedScripts = new TreeSet<>( + private final TreeSet> sortedScripts = new TreeSet<>( VersionAgnosticMigrationScript.COMPARATOR); /** - * @param packagePath defines the package in which {@link VersionAgnosticMigrationScript}s will be searched. - * Also searches through all sub packages of packagePath + * @param packagePath defines the package in which {@link VersionAgnosticMigrationScript}s will be searched. Also + * searches through all sub packages of packagePath * @throws ScriptInstantiationException if a class in the given package could not be instantiated */ @SuppressWarnings("rawtypes") - public ReflectiveMigrater(final String packagePath) throws ScriptInstantiationException + public ReflectiveMigrater(final String packagePath) throws ScriptInstantiationException { - Reflections reflections = new Reflections( + final Reflections reflections = new Reflections( new ConfigurationBuilder() .setUrls(ClasspathHelper.forPackage(packagePath)) .setScanners(Scanners.SubTypes) - //I don't get why you have to filter again, but if you don't, super-packages will get included + // I don't get why you have to filter again, but if you don't, super-packages will get included .filterInputsBy(new FilterBuilder().includePackage(packagePath)) ); - for (Class scriptClass : reflections.getSubTypesOf( + for(final Class scriptClass : reflections.getSubTypesOf( VersionAgnosticMigrationScript.class)) { - //Only instanciate non abstract classes + // Only instanciate non abstract classes if(!Modifier.isAbstract(scriptClass.getModifiers())) { - VersionAgnosticMigrationScript instanciatedScript = instanciateClass(scriptClass); - checkIfVersionIsAlreadyRegistered(instanciatedScript); + final VersionAgnosticMigrationScript instanciatedScript = this.instanciateClass(scriptClass); + this.checkIfVersionIsAlreadyRegistered(instanciatedScript); this.sortedScripts.add(instanciatedScript); } } } - + @SuppressWarnings("rawtypes") - private VersionAgnosticMigrationScript instanciateClass(Class scriptClass) throws ScriptInstantiationException + private VersionAgnosticMigrationScript instanciateClass(final Class scriptClass) + throws ScriptInstantiationException { - try { + try + { return scriptClass.getDeclaredConstructor().newInstance(); - } catch ( - InstantiationException | - IllegalAccessException | - IllegalArgumentException | - InvocationTargetException | - NoSuchMethodException | - SecurityException e - ) { + } + catch( + final InstantiationException | + IllegalAccessException | + IllegalArgumentException | + InvocationTargetException | + NoSuchMethodException | + SecurityException e + ) + { throw new ScriptInstantiationException("Could not instanciate class " + scriptClass.getName(), e); } } diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java b/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java index 306a143..18c3a3f 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java @@ -4,6 +4,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; + import software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass.v1_ValidScript; import software.xdev.micromigration.migrater.scripts.includeSubPackages.subpackage.ValidScriptInSubpackage; import software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid.ValidScript; @@ -13,7 +14,7 @@ class ReflectiveMigraterTest { @Test void testValidScript() throws ScriptInstantiationException { - ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.valid"); + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.valid"); assertEquals(1, migrater.getSortedScripts().size()); assertEquals( software.xdev.micromigration.migrater.scripts.valid.ValidScript.class, @@ -23,7 +24,7 @@ void testValidScript() throws ScriptInstantiationException { @Test void testValidScriptWithIrrelevantClasses() throws ScriptInstantiationException { - ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid"); + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid"); assertEquals(1, migrater.getSortedScripts().size()); assertEquals( ValidScript.class, @@ -33,7 +34,7 @@ void testValidScriptWithIrrelevantClasses() throws ScriptInstantiationException @Test void testValidScriptWithSubpackages() throws ScriptInstantiationException { - ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.includeSubPackages"); + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.includeSubPackages"); assertEquals(2, migrater.getSortedScripts().size()); assertEquals( software.xdev.micromigration.migrater.scripts.includeSubPackages.ValidScript.class, @@ -47,7 +48,7 @@ void testValidScriptWithSubpackages() throws ScriptInstantiationException { @Test void testPackageWithNoScript() throws ScriptInstantiationException { - ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.packageNotExisting"); + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.packageNotExisting"); assertEquals(0, migrater.getSortedScripts().size()); } @@ -74,7 +75,7 @@ void testNoCorrectConstructor() throws ScriptInstantiationException { @Test void testAbstractSuperClass() throws ScriptInstantiationException { - ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.abstractSuperClass"); + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.abstractSuperClass"); assertEquals(1, migrater.getSortedScripts().size()); assertEquals( software.xdev.micromigration.migrater.scripts.abstractSuperClass.ValidScript.class, @@ -84,7 +85,7 @@ void testAbstractSuperClass() throws ScriptInstantiationException { @Test void testReflectiveVersion() throws ScriptInstantiationException { - ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.reflectiveVersion"); + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.reflectiveVersion"); assertEquals(1, migrater.getSortedScripts().size()); assertEquals( software.xdev.micromigration.migrater.scripts.reflectiveVersion.v1_ValidScript.class, @@ -94,7 +95,7 @@ void testReflectiveVersion() throws ScriptInstantiationException { @Test void testReflectiveSuperClass() throws ScriptInstantiationException { - ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass"); + final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass"); assertEquals(1, migrater.getSortedScripts().size()); assertEquals( v1_ValidScript.class, diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java index 7a06c30..c5c7f19 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java @@ -1,18 +1,18 @@ package software.xdev.micromigration.migrater.scripts.noCorrectConstructor; +import java.util.logging.Logger; + import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; -import java.util.logging.Logger; - public class NoCorrectConstructorScript implements software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { private final String argument; - public NoCorrectConstructorScript(String argument) + public NoCorrectConstructorScript(final String argument) { this.argument = argument; } @@ -24,7 +24,7 @@ public MigrationVersion getTargetVersion() } @Override - public void migrate(Context context) + public void migrate(final Context context) { Logger.getGlobal().info(this.argument); } From a060c47147c55b370a564bcb8011c0311f982f9d Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 15:37:05 +0100 Subject: [PATCH 190/306] Delete codeql.yml --- .github/workflows/codeql.yml | 76 ------------------------------------ 1 file changed, 76 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 70a157d..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,76 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "develop", main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "develop" ] - schedule: - - cron: '27 16 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'java' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" From b6103ba525416b3b320de4d60f4be5f6ca3f9aa1 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Tue, 17 Jan 2023 15:39:36 +0100 Subject: [PATCH 191/306] Added Licenses in Files --- ...nosticMigrationEmbeddedStorageManager.java | 15 +++++++++ .../VersionAgnosticMigrationManager.java | 15 +++++++++ ...nosticTunnelingEmbeddedStorageManager.java | 15 +++++++++ .../migrater/AbstractMigrater.java | 15 +++++++++ .../migrater/ExplicitMigrater.java | 15 +++++++++ .../migrater/MicroMigrater.java | 15 +++++++++ .../VersionAlreadyRegisteredException.java | 15 +++++++++ .../AbstractScriptExecutionNotification.java | 15 +++++++++ ...cutionNotificationWithScriptReference.java | 15 +++++++++ ...ionNotificationWithoutScriptReference.java | 15 +++++++++ .../xdev/micromigration/scripts/Context.java | 15 +++++++++ .../ReflectiveVersionMigrationScript.java | 15 +++++++++ .../scripts/SimpleMigrationScript.java | 15 +++++++++ .../scripts/SimpleTypedMigrationScript.java | 15 +++++++++ .../VersionAgnosticMigrationScript.java | 15 +++++++++ .../version/MigrationVersion.java | 15 +++++++++ .../micromigration/version/Versioned.java | 15 +++++++++ .../version/VersionedAndKeeperOfHistory.java | 15 +++++++++ .../version/VersionedObject.java | 15 +++++++++ .../version/VersionedObjectWithHistory.java | 15 +++++++++ .../micromigration/version/VersionedRoot.java | 15 +++++++++ .../version/VersionedRootWithHistory.java | 15 +++++++++ .../ReflectiveVersionMigrationScriptTest.java | 15 +++++++++ .../version/MigrationVersionTest.java | 15 +++++++++ .../examples/explicit/MainExplicit.java | 15 +++++++++ .../explicit/scripts/UpdateToV1_0.java | 15 +++++++++ .../explicit/scripts/UpdateToV1_1.java | 15 +++++++++ .../notification/MainNotification.java | 15 +++++++++ ...alWithMigrationEmbeddedStorageManager.java | 15 +++++++++ .../practical/embedded/UpdateToV1_0.java | 15 +++++++++ .../practical/embedded/UpdateToV2_0.java | 15 +++++++++ .../MainPracticalWithMigrationManager.java | 15 +++++++++ .../migrationManager/UpdateToV1_0.java | 15 +++++++++ .../migrationManager/UpdateToV2_0.java | 15 +++++++++ .../examples/practical/v0/BusinessBranch.java | 15 +++++++++ .../examples/practical/v0/Customer.java | 15 +++++++++ .../practical/v1AndHigher/Address.java | 15 +++++++++ .../practical/v1AndHigher/BusinessBranch.java | 15 +++++++++ .../practical/v1AndHigher/Customer.java | 15 +++++++++ .../examples/reflective/MainReflective.java | 15 +++++++++ .../reflective/scripts/UpdateToV1_0.java | 15 +++++++++ .../reflective/scripts/UpdateToV1_1.java | 15 +++++++++ .../microstream/MigrationEmbeddedStorage.java | 15 +++++++++ .../MigrationEmbeddedStorageManager.java | 15 +++++++++ .../microstream/MigrationManager.java | 15 +++++++++ .../microstream/MigrationScript.java | 15 +++++++++ .../TunnelingEmbeddedStorageManager.java | 15 +++++++++ .../microstream/package-info.java | 15 +++++++++ ...oduceMigrationOnExistingDatastoreTest.java | 15 +++++++++ .../integration/MigrationHistoryTest.java | 15 +++++++++ .../MigrationScriptAfterScriptTest.java | 15 +++++++++ .../integration/MultipleScriptsTest.java | 15 +++++++++ ...oreStuffInMigrationStorageManagerTest.java | 15 +++++++++ .../migrater/ExplicitMigraterTest.java | 15 +++++++++ .../testUtil/MicroMigrationScriptDummy.java | 15 +++++++++ .../microstream/MigrationEmbeddedStorage.java | 15 +++++++++ .../MigrationEmbeddedStorageManager.java | 15 +++++++++ .../microstream/MigrationManager.java | 15 +++++++++ .../microstream/MigrationScript.java | 15 +++++++++ .../TunnelingEmbeddedStorageManager.java | 15 +++++++++ .../microstream/package-info.java | 15 +++++++++ ...oduceMigrationOnExistingDatastoreTest.java | 15 +++++++++ .../MigrationScriptAfterScriptTest.java | 15 +++++++++ .../integration/MultipleScriptsTest.java | 15 +++++++++ ...oreStuffInMigrationStorageManagerTest.java | 15 +++++++++ .../migrater/ExplicitMigraterTest.java | 15 +++++++++ .../testUtil/MicroMigrationScriptDummy.java | 15 +++++++++ .../microstream/MigrationEmbeddedStorage.java | 15 +++++++++ .../MigrationEmbeddedStorageManager.java | 15 +++++++++ .../microstream/MigrationManager.java | 15 +++++++++ .../microstream/MigrationScript.java | 15 +++++++++ .../TunnelingEmbeddedStorageManager.java | 15 +++++++++ .../microstream/package-info.java | 15 +++++++++ ...oduceMigrationOnExistingDatastoreTest.java | 15 +++++++++ .../MigrationScriptAfterScriptTest.java | 15 +++++++++ .../integration/MultipleScriptsTest.java | 15 +++++++++ ...oreStuffInMigrationStorageManagerTest.java | 15 +++++++++ .../migrater/ExplicitMigraterTest.java | 15 +++++++++ .../testUtil/MicroMigrationScriptDummy.java | 15 +++++++++ pom.xml | 31 +++++++++++++++++++ .../migrater/ReflectiveMigrater.java | 15 +++++++++ .../ScriptInstantiationException.java | 15 +++++++++ .../migrater/ReflectiveMigraterTest.java | 15 +++++++++ .../AbstractScript.java | 15 +++++++++ .../v1_ValidScript.java | 15 +++++++++ .../abstractSuperClass/AbstractScript.java | 15 +++++++++ .../abstractSuperClass/ValidScript.java | 15 +++++++++ .../errorThrowing/ErrorThrowingScript.java | 15 +++++++++ .../ExceptionThrowingScript.java | 15 +++++++++ .../includeSubPackages/ValidScript.java | 15 +++++++++ .../subpackage/ValidScriptInSubpackage.java | 15 +++++++++ .../IrrelevantClass.java | 15 +++++++++ .../ValidScript.java | 15 +++++++++ .../NoCorrectConstructorScript.java | 15 +++++++++ .../reflectiveVersion/v1_ValidScript.java | 15 +++++++++ .../migrater/scripts/valid/ValidScript.java | 15 +++++++++ 96 files changed, 1456 insertions(+) diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java index a129f49..c02220a 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream.versionagnostic; import java.util.List; diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index 54cc8c6..aed00af 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream.versionagnostic; import java.util.Objects; diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java index a36fe1e..204dfb9 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream.versionagnostic; /** diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 0721da1..39ba287 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import java.time.Clock; diff --git a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java index bdc95d3..a0dc843 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import java.util.TreeSet; diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index cbdb282..dd81a06 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import java.util.TreeSet; diff --git a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java index df83e90..981b2d9 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import java.util.Objects; diff --git a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java index 9275b80..9167caa 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java +++ b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.notification; import java.time.LocalDateTime; diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java index e4490a9..e89837e 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.notification; import java.time.LocalDateTime; diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java index c0cd327..2898286 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.notification; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/Context.java b/core/src/main/java/software/xdev/micromigration/scripts/Context.java index 49fcfa7..d3a1ae2 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/Context.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/Context.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.scripts; /** diff --git a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java index 2e5e389..4c77161 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.scripts; import java.util.ArrayList; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java index c4a2e8c..da34941 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.scripts; import java.util.function.Consumer; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java index 0e9de96..7ddc77b 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.scripts; import java.util.Objects; diff --git a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java index d5f92dd..da7bfb9 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.scripts; import java.util.Comparator; diff --git a/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java b/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java index a6389ad..2793dad 100644 --- a/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java +++ b/core/src/main/java/software/xdev/micromigration/version/MigrationVersion.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; import java.util.Arrays; diff --git a/core/src/main/java/software/xdev/micromigration/version/Versioned.java b/core/src/main/java/software/xdev/micromigration/version/Versioned.java index fa098ce..3e5de7f 100644 --- a/core/src/main/java/software/xdev/micromigration/version/Versioned.java +++ b/core/src/main/java/software/xdev/micromigration/version/Versioned.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; /** diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java index 77b2a7f..41801c8 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; import java.util.List; diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java b/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java index 777ac01..28e837b 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedObject.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; import java.util.Objects; diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java index 9cd5326..a7b3155 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; import java.util.ArrayList; diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java index 475390e..511ef0e 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedRoot.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; import java.util.Objects; diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java index 881afeb..9df87fd 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; import java.util.ArrayList; diff --git a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java index f3b4fa4..52156a1 100644 --- a/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java +++ b/core/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.scripts; import org.junit.jupiter.api.Assertions; diff --git a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java index 5fb0285..4ecc1ef 100644 --- a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java +++ b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.version; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index 94dd857..a25c6a3 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.explicit; import java.util.Date; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 984730c..f45dcbd 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.explicit.scripts; import java.util.Date; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index 6f9b20f..ce92361 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.explicit.scripts; import java.util.Date; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index fdec4cc..f69eb20 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.notification; import java.util.Date; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 815bcae..3ee5ae9 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.embedded; import java.util.logging.Logger; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index 6b24a5b..89522bd 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.embedded; import java.util.logging.Logger; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index 90db78a..881c1f1 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.embedded; import java.util.logging.Logger; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index 5ede2ec..b400c7d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.migrationManager; import java.util.logging.Logger; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index 265d54f..261053d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.migrationManager; import java.util.logging.Logger; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 9f46884..7ceef0a 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.migrationManager; import java.util.logging.Logger; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java index 8b23e7d..4c37386 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.v0; import java.util.ArrayList; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java index 7aba0cc..e4eb6e3 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.v0; public class Customer diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java index 9494acc..8902c9d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.v1AndHigher; public class Address diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java index 1937d38..5f5827c 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.v1AndHigher; import java.util.ArrayList; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java index b8b7e60..995cf02 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.practical.v1AndHigher; public class Customer diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index 4b766de..d79cc65 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.reflective; import java.util.Date; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index 0ffc05c..c979ac1 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.reflective.scripts; import java.util.Date; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index a6f7cd9..dd755b0 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.examples.reflective.scripts; import java.util.Date; diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 6fd7d63..90befea 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.nio.file.Path; diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index fff5347..9dd783e 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import one.microstream.storage.embedded.types.EmbeddedStorageManager; diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 8365e4a..f767f2f 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.util.function.Consumer; diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index bb8029f..eee3c4b 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import software.xdev.micromigration.scripts.Context; diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 7f1c871..7a1989e 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.util.Objects; diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/package-info.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/package-info.java index f152f60..a8d1099 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/package-info.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/package-info.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * Provides classes to use micro migration for MicroStream v5 */ diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 3496c2e..de65428 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java index 49828d0..60e0093 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index 7bdf97d..d5b6a8a 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 86cf670..d0f3d20 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 75606f9..954a35e 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 5bf03c7..155fc92 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index 1f6b8d9..53e15c3 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.testUtil; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index c677448..bee3536 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.nio.file.Path; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index fff5347..9dd783e 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import one.microstream.storage.embedded.types.EmbeddedStorageManager; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 87632fd..8ff3c6b 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.util.function.Consumer; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index bb8029f..eee3c4b 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import software.xdev.micromigration.scripts.Context; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 7f1c871..7a1989e 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.util.Objects; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java index e6ed3ba..a246d18 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * Provides classes to use micro migration for MicroStream v6 */ diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 9645dba..ef7d33b 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index ac83ff2..5c9c99c 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 469edde..76ead5d 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 7bec51b..c641e87 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 5bf03c7..155fc92 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index 1f6b8d9..53e15c3 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.testUtil; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 8d0ca1d..b455afb 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.nio.file.Path; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index fff5347..9dd783e 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import one.microstream.storage.embedded.types.EmbeddedStorageManager; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 8365e4a..f767f2f 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.util.function.Consumer; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index bb8029f..eee3c4b 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import software.xdev.micromigration.scripts.Context; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 7f1c871..7a1989e 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.microstream; import java.util.Objects; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java index 0d32617..82c7e38 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/package-info.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * Provides classes to use micro migration for MicroStream v7 */ diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index 9645dba..ef7d33b 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index ac83ff2..5c9c99c 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 469edde..76ead5d 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 7bec51b..c641e87 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.integration; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 5bf03c7..155fc92 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index 1f6b8d9..53e15c3 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.testUtil; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/pom.xml b/pom.xml index ef91ec0..ed4b119 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,7 @@ Multimodule project for Micro Migration pom + 2021 https://github.com/xdev-software/micro-migration @@ -286,6 +287,36 @@ org.apache.maven.plugins maven-resources-plugin + + + + com.mycila + license-maven-plugin + 4.1 + + + ${project.organization.url} + + + +

com/mycila/maven/plugin/license/templates/APACHE-2.txt
+ + src/main/java/** + src/test/java/** + + + + + + + first + + format + + process-sources + + + diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java index b7e4dc5..1b86713 100644 --- a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import java.lang.reflect.InvocationTargetException; diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java index cf1c283..779b725 100644 --- a/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ScriptInstantiationException.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; /** diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java b/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java index 18c3a3f..0554c1e 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/ReflectiveMigraterTest.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java index 2012fb0..db56b1f 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/AbstractScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java index 8c6f56a..412dc4b 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractReflectiveSuperClass/v1_ValidScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.abstractReflectiveSuperClass; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java index eee8c95..aa45495 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/AbstractScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.abstractSuperClass; import software.xdev.micromigration.version.MigrationVersion; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java index 3c9c569..64be92e 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/abstractSuperClass/ValidScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.abstractSuperClass; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java index f7e4dc2..b62127b 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.errorThrowing; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java index 61c3eef..7889868 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.exceptionThrowing; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java index 0cdd5aa..7bc2895 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.includeSubPackages; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java index 9dc57f5..3feef58 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.includeSubPackages.subpackage; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java index 5c49e7f..18eb5c5 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/IrrelevantClass.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid; public class IrrelevantClass { diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java index a59d620..fb0a069 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.moreClassesIncludingValid; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java index c5c7f19..d87a60e 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/noCorrectConstructor/NoCorrectConstructorScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.noCorrectConstructor; import java.util.logging.Logger; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java index a905aed..761f3e5 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/reflectiveVersion/v1_ValidScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.reflectiveVersion; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; diff --git a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java index e9f5052..f713506 100644 --- a/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java +++ b/reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java @@ -1,3 +1,18 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package software.xdev.micromigration.migrater.scripts.valid; import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; From 4a9e0a8eef86f9e97b4837974f6c56a3b7b1af7b Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 18 Jan 2023 13:57:24 +0100 Subject: [PATCH 192/306] Added Modernizer to Plugins --- pom.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pom.xml b/pom.xml index ed4b119..9cabb9e 100644 --- a/pom.xml +++ b/pom.xml @@ -147,6 +147,32 @@ + + + + org.gaul + modernizer-maven-plugin + 2.4.0 + + ${java.version} + + + + modernizer + verify + + modernizer + + + + + org.apache.maven.plugins From e5eb44b1a87134204c109c0d25055a097f44cc6a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 18 Jan 2023 14:08:50 +0100 Subject: [PATCH 193/306] Update pom.xml --- pom.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 9cabb9e..38f88d9 100644 --- a/pom.xml +++ b/pom.xml @@ -148,11 +148,12 @@ - From b02d1a6952cc285c8fa37f439a9b786cd6d17e6a Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 18 Jan 2023 14:25:27 +0100 Subject: [PATCH 194/306] Added impsort-plugin --- ...nosticMigrationEmbeddedStorageManager.java | 1 - .../VersionAgnosticMigrationManager.java | 1 - .../migrater/AbstractMigrater.java | 1 - .../migrater/ExplicitMigrater.java | 1 - .../migrater/MicroMigrater.java | 1 - .../VersionAlreadyRegisteredException.java | 1 - .../AbstractScriptExecutionNotification.java | 1 - ...ionNotificationWithoutScriptReference.java | 1 - .../ReflectiveVersionMigrationScript.java | 1 - .../scripts/SimpleMigrationScript.java | 1 - .../scripts/SimpleTypedMigrationScript.java | 1 - .../VersionAgnosticMigrationScript.java | 1 - .../version/VersionedAndKeeperOfHistory.java | 1 - .../version/VersionedObjectWithHistory.java | 1 - .../version/VersionedRootWithHistory.java | 1 - .../version/MigrationVersionTest.java | 1 - .../examples/explicit/MainExplicit.java | 1 - .../explicit/scripts/UpdateToV1_0.java | 1 - .../explicit/scripts/UpdateToV1_1.java | 1 - .../notification/MainNotification.java | 1 - ...alWithMigrationEmbeddedStorageManager.java | 1 - .../practical/embedded/UpdateToV1_0.java | 1 - .../practical/embedded/UpdateToV2_0.java | 1 - .../MainPracticalWithMigrationManager.java | 1 - .../migrationManager/UpdateToV1_0.java | 1 - .../migrationManager/UpdateToV2_0.java | 1 - .../practical/v1AndHigher/BusinessBranch.java | 1 - .../examples/reflective/MainReflective.java | 1 - .../reflective/scripts/UpdateToV1_0.java | 1 - .../reflective/scripts/UpdateToV1_1.java | 1 - .../microstream/MigrationEmbeddedStorage.java | 1 - .../MigrationEmbeddedStorageManager.java | 1 - .../microstream/MigrationManager.java | 1 - .../microstream/MigrationScript.java | 1 - .../TunnelingEmbeddedStorageManager.java | 1 - ...oduceMigrationOnExistingDatastoreTest.java | 1 - .../integration/MigrationHistoryTest.java | 1 - .../integration/MultipleScriptsTest.java | 1 - ...oreStuffInMigrationStorageManagerTest.java | 1 - .../migrater/ExplicitMigraterTest.java | 1 - .../testUtil/MicroMigrationScriptDummy.java | 1 - .../microstream/MigrationEmbeddedStorage.java | 1 - .../MigrationEmbeddedStorageManager.java | 1 - .../microstream/MigrationManager.java | 1 - .../microstream/MigrationScript.java | 1 - .../TunnelingEmbeddedStorageManager.java | 1 - ...oduceMigrationOnExistingDatastoreTest.java | 1 - .../integration/MultipleScriptsTest.java | 1 - ...oreStuffInMigrationStorageManagerTest.java | 1 - .../migrater/ExplicitMigraterTest.java | 1 - .../testUtil/MicroMigrationScriptDummy.java | 1 - .../microstream/MigrationEmbeddedStorage.java | 1 - .../MigrationEmbeddedStorageManager.java | 1 - .../microstream/MigrationManager.java | 1 - .../microstream/MigrationScript.java | 1 - .../TunnelingEmbeddedStorageManager.java | 1 - ...oduceMigrationOnExistingDatastoreTest.java | 1 - .../integration/MultipleScriptsTest.java | 1 - ...oreStuffInMigrationStorageManagerTest.java | 1 - .../migrater/ExplicitMigraterTest.java | 1 - .../testUtil/MicroMigrationScriptDummy.java | 1 - pom.xml | 22 +++++++++++++++++++ .../migrater/ReflectiveMigraterTest.java | 1 - .../AbstractScript.java | 1 - .../v1_ValidScript.java | 1 - .../abstractSuperClass/AbstractScript.java | 1 - .../abstractSuperClass/ValidScript.java | 1 - .../errorThrowing/ErrorThrowingScript.java | 1 - .../ExceptionThrowingScript.java | 1 - .../includeSubPackages/ValidScript.java | 1 - .../subpackage/ValidScriptInSubpackage.java | 1 - .../ValidScript.java | 1 - .../NoCorrectConstructorScript.java | 1 - .../reflectiveVersion/v1_ValidScript.java | 1 - .../migrater/scripts/valid/ValidScript.java | 1 - 75 files changed, 22 insertions(+), 74 deletions(-) diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java index c02220a..6f0286a 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -25,7 +25,6 @@ import software.xdev.micromigration.version.VersionedRoot; import software.xdev.micromigration.version.VersionedRootWithHistory; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java index aed00af..7d3a614 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationManager.java @@ -26,7 +26,6 @@ import software.xdev.micromigration.version.Versioned; import software.xdev.micromigration.version.VersionedAndKeeperOfHistory; - /** * Manages a given object and keeps the version for it. *

diff --git a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java index 39ba287..03aea7f 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java @@ -29,7 +29,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - /** * Provides the basic functionality to apply {@link VersionAgnosticMigrationScript}s to a datastore. * diff --git a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java index a0dc843..68da7c6 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java @@ -19,7 +19,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; - /** * Contains all the available scripts to migrate the datastore to a certain version. *

diff --git a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java index dd81a06..4131751 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java @@ -24,7 +24,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - /** * Executes all the available scripts to migrate the datastore to a certain version. * diff --git a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java index 981b2d9..dc6ffb5 100644 --- a/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java +++ b/core/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - /** * Exception that should be used if two scripts with the same version exist. * @author Johannes Rabauer diff --git a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java index 9167caa..eca18a0 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java +++ b/core/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.MigrationVersion; - /** * Contains data about the execution of a script by a {@link MicroMigrater}. * diff --git a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java index 2898286..6adabac 100644 --- a/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java +++ b/core/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java @@ -17,7 +17,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; - /** * Same as {@link ScriptExecutionNotificationWithScriptReference} but instead of referencing * the {@link VersionAgnosticMigrationScript} directly, only the name of the script is diff --git a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java index 4c77161..acc76e0 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; - /** * Script which creates the target version of the script through the class name. *

diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java index da34941..c831458 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; - /** * Provides a simple way to create a migration script with the necessary version * and {@link Consumer}. diff --git a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java index 7ddc77b..025b4e5 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java @@ -21,7 +21,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; - /** * Provides a simple way to create a migration script with the necessary version and {@link Consumer}. * diff --git a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java index da7bfb9..a0ede14 100644 --- a/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java +++ b/core/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; import software.xdev.micromigration.version.MigrationVersion; - /** * Interface for scripts to migrate / update datastores. *

diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java index 41801c8..4658cc1 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java @@ -19,7 +19,6 @@ import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; - /** * Interface used by the MigrationManagers for easier versioning of objects * and to keep and read the migration history. diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java index a7b3155..51366cd 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java @@ -21,7 +21,6 @@ import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; - /** * This class is inserted as the root of the MicroStream datastore and contains only the * current version, the actual root object and the history of executed scripts. diff --git a/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java index 9df87fd..85db37b 100644 --- a/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java +++ b/core/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java @@ -21,7 +21,6 @@ import software.xdev.micromigration.notification.ScriptExecutionNotificationWithoutScriptReference; - /** * This class is inserted as the root of the MicroStream datastore and contains only the * current version, the actual root object and the history of executed scripts. diff --git a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java index 4ecc1ef..ad3a991 100644 --- a/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java +++ b/core/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java @@ -19,7 +19,6 @@ import org.junit.jupiter.api.Test; - class MigrationVersionTest { diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index a25c6a3..697e7fa 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -25,7 +25,6 @@ import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.migrater.ExplicitMigrater; - /** * The most basic usage of micro migration. * Here two {@link MigrationScript}s are explicitly registered diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index f45dcbd..6f8f0b3 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -23,7 +23,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; - public class UpdateToV1_0 implements MigrationScript { @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index ce92361..3ef3428 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -23,7 +23,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; - public class UpdateToV1_1 implements MigrationScript { @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index f69eb20..070e38b 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -24,7 +24,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; - /** * Shows the basic registration of migration notifications * ({@link ScriptExecutionNotification}). diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 3ee5ae9..02d05f6 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -22,7 +22,6 @@ import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; - /** * A practical example of usage in a few steps: *

    diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index 89522bd..e6dc246 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -25,7 +25,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; - public class UpdateToV1_0 implements MigrationScript { @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index 881c1f1..c547e70 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -24,7 +24,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; - public class UpdateToV2_0 implements MigrationScript { @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index b400c7d..babc3f3 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -24,7 +24,6 @@ import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.version.VersionedObject; - /** * A practical example of usage in a few steps: *
      diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index 261053d..b75efb9 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -26,7 +26,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; - public class UpdateToV1_0 implements MigrationScript> { @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 7ceef0a..8a1b737 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -25,7 +25,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; - public class UpdateToV2_0 implements MigrationScript> { @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java index 5f5827c..27f58e7 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.List; - public class BusinessBranch { public final List customers = new ArrayList<>(); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index d79cc65..c524c0e 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -23,7 +23,6 @@ import software.xdev.micromigration.migrater.ReflectiveMigrater; import software.xdev.micromigration.migrater.ScriptInstantiationException; - /** * Shows the usage of the {@link ReflectiveMigrater}. Very simple. * diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index c979ac1..00e83c9 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -23,7 +23,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; - public class UpdateToV1_0 implements MigrationScript { @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index dd755b0..17b9d7d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -23,7 +23,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; - public class UpdateToV1_1 implements MigrationScript { @Override diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index 90befea..2f6d436 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -25,7 +25,6 @@ import one.microstream.storage.types.StorageConfiguration; import software.xdev.micromigration.migrater.MicroMigrater; - /** * Provides static utility calls to create the {@link software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager} for * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 9dd783e..02ddae5 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; - /** * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one * specific MicroStream version. diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index f767f2f..5d45118 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -25,7 +25,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; - /** * Specific implementation of the {@link VersionAgnosticMigrationManager} for one * specific MicroStream version. diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index eee3c4b..c3962de 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -18,7 +18,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; - /** * Interface for scripts to migrate / update datastores. *

      diff --git a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 7a1989e..096f3c4 100644 --- a/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -40,7 +40,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

      diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index de65428..29861e6 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -32,7 +32,6 @@ import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; - class IntroduceMigrationOnExistingDatastoreTest { final static String ROOT = "OriginalRoot"; diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java index 60e0093..139a4c5 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java @@ -29,7 +29,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - class MigrationHistoryTest { @Test diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index d0f3d20..7b95013 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - class MultipleScriptsTest { @Test diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index 954a35e..77e339e 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - class StoreStuffInMigrationStorageManagerTest { private static class RootClass diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 155fc92..d2c0f15 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -29,7 +29,6 @@ import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; - class ExplicitMigraterTest { diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index 53e15c3..2d75dff 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index bee3536..a633755 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -25,7 +25,6 @@ import one.microstream.storage.types.StorageConfiguration; import software.xdev.micromigration.migrater.MicroMigrater; - /** * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 9dd783e..02ddae5 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; - /** * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one * specific MicroStream version. diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index 8ff3c6b..2ff6d52 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -25,7 +25,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; - /** * Specific implementation of the {@link VersionAgnosticMigrationManager} for one * specific MicroStream version. diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index eee3c4b..c3962de 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -18,7 +18,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; - /** * Interface for scripts to migrate / update datastores. *

      diff --git a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 7a1989e..096f3c4 100644 --- a/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -40,7 +40,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

      diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index ef7d33b..00118e9 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; - class IntroduceMigrationOnExistingDatastoreTest { final static String ROOT = "OriginalRoot"; diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 76ead5d..57964f3 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - class MultipleScriptsTest { @Test diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index c641e87..c519a20 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - class StoreStuffInMigrationStorageManagerTest { private static class RootClass diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 155fc92..d2c0f15 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -29,7 +29,6 @@ import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; - class ExplicitMigraterTest { diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index 53e15c3..2d75dff 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java index b455afb..ea59546 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -25,7 +25,6 @@ import one.microstream.storage.types.StorageConfiguration; import software.xdev.micromigration.migrater.MicroMigrater; - /** * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java index 9dd783e..02ddae5 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.migrater.MicroMigrater; import software.xdev.micromigration.version.Versioned; - /** * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one * specific MicroStream version. diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java index f767f2f..5d45118 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -25,7 +25,6 @@ import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.Versioned; - /** * Specific implementation of the {@link VersionAgnosticMigrationManager} for one * specific MicroStream version. diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java index eee3c4b..c3962de 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -18,7 +18,6 @@ import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; - /** * Interface for scripts to migrate / update datastores. *

      diff --git a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java index 7a1989e..096f3c4 100644 --- a/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java +++ b/microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -40,7 +40,6 @@ import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; import software.xdev.micromigration.version.Versioned; - /** * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. *

      diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java index ef7d33b..00118e9 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; - class IntroduceMigrationOnExistingDatastoreTest { final static String ROOT = "OriginalRoot"; diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java index 76ead5d..57964f3 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - class MultipleScriptsTest { @Test diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java index c641e87..c519a20 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -31,7 +31,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - class StoreStuffInMigrationStorageManagerTest { private static class RootClass diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java index 155fc92..d2c0f15 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -29,7 +29,6 @@ import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; import software.xdev.micromigration.version.MigrationVersion; - class ExplicitMigraterTest { diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java index 53e15c3..2d75dff 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -20,7 +20,6 @@ import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; import software.xdev.micromigration.version.MigrationVersion; - public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript { private final MigrationVersion version; diff --git a/pom.xml b/pom.xml index 38f88d9..113caa7 100644 --- a/pom.xml +++ b/pom.xml @@ -148,6 +148,28 @@ + + + net.revelc.code + impsort-maven-plugin + 1.8.0 + + java.,javax.,org.,com. + java,* + + + + sort-imports + + sort + + + + + @@ -289,7 +289,7 @@ com.puppycrawl.tools checkstyle - 8.44 + 10.6.0 @@ -313,7 +313,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.0 + 3.10.1 ${java.version} ${java.version} From c88d015446bcd3669013b3661c5303eb1d4bc7a6 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 1 Feb 2023 09:09:50 +0100 Subject: [PATCH 197/306] Add Nexus Snapshot url --- .github/workflows/checkBuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 0799584..cd32bc6 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -79,4 +79,5 @@ jobs: JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_SNAPSHOT_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/ run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file From c29afd5a9eb2706667453f64aa9559a5b232319c Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 6 Feb 2023 11:51:49 +0100 Subject: [PATCH 198/306] Added Logo --- README.md | 1 + docs/Logo.png | Bin 0 -> 27055 bytes docs/Logo2.png | Bin 0 -> 28242 bytes 3 files changed, 1 insertion(+) create mode 100644 docs/Logo.png create mode 100644 docs/Logo2.png diff --git a/README.md b/README.md index deb261a..e04d365 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) # Micro migration +![Logo](./docs/Logo.png) Tiny java library to migrate MicroStream datastores. Applies migration scripts on the datastores to keep them up to date. diff --git a/docs/Logo.png b/docs/Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..199eebdcc6876f470637837c18d8cfd0a6ad43b3 GIT binary patch literal 27055 zcmeEuby!s0+b)fisDL1?A}I(+BdyXQFoZB5okMp^skDT2N)9me(4cg843wbH?+z4`lUnSov1H%(?bQ{uNgjrRYrKek9b^A1yA3Q zT7CV7Y5?D#YPR)JdxYs*WBY6N!*j7u7!q%l>e=^c6e*dhaV5f!*7dZYjGn z68kKKv11Xm!hFnN^yKw>LSvGm3aI%g^nBF2?<}B^#sHWb@{1Nrx4aSU?t9V2dyJ@e z-?jw$Jo@KD%m0@@T*mVjX@h@9`BG_BQMeGcjW7xGs%mFTUbX&mKmNIOy;1DGh1Yxl zJVv+dwE}PNRC$SPJNM4iDEw}7P@L~EQVG_0H}Zef+NdD3p4z-}JM^1bUJXmuxwy$c zn_FIOQ?GYY=H9UXeD(@_jo5Q)zn?uBzg6dSKs{5hn^<85NvJSis<_*BAKH72vWJz5 zBHWTr+n17A25cU361!w@?TC0h4*QsR2FKM;4KDkg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VdUx7rVd@$lXOSUdP2_zUU;ysLjN@ve&k5c|Ks5`aXRawSHAxT6wXGT literal 0 HcmV?d00001 diff --git a/docs/Logo2.png b/docs/Logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..b154b331ec1f4a3f3e2f3d84abe4b50730dcc881 GIT binary patch literal 28242 zcmeFZWmJ@H)HZw}C@4zEEg=mmEg~S&NDLw|An8y7(k0!YqBMvSDh)~xJ%FS^C`d_3 z%TPl*G(&yo#U1bS{r%Rv*7xVR*YX~jx#rBhkA3W8Zw%MeP`+^P@;L~CE~wm9ybnPn z>=1Oyh3pJ?$Dcn>7`za<-B*@}io2K=zz-zWchv7dP+2Vbf!S&B^V!FDAGkr#MR)iQ z(S#MNHv~D(t0>;l@iti*C$BX22oNOjP{dGuQMyRQP81a?_dJ{EFaC^Q{WdR$G9RCL zcuvV->RlGM4dum*uUc&1q|bfJc9G-Lv>|cI!aHz{Ac1S z6DC8(Jyp?OBM(PN%eStn-8Fnrbu{yRnDF}A2LUK!=qx*wF*SiIZXD#4V=;g47=Gkx4+i(4Hs&n`fDihye-5$Tm z1<5@Kp@KA@e$M>5m>l%zo)U4hPR!Z;!0V$nL&hN&Ax(I=zu0p0>$g7<4=;XDtr#k< zMc{gfIpTlq{!yqnD{S?Majm{$ff3S#z@zTm_biHQ*BY1ghXmRu4tlYbNhX-yl&|H{ z)<<`4xeOU6oI4#%0k*|P`kC15S$AjGgx{Y#r_Ms(RLF=R3mbKefzP!1@Dh26hM!q< z^gK(lIQ zLe+{Gx^x~p_7gKlZgJk)|DrVSi68h384q{Nr=~Y}ba($`p-(rEH2)bF zyP6an&2>7;&*(779k<$s`wwDbL z_QsZ_wR7G}Lp`S86gN}zJn`7sB%`SO(xnYy)4E@z>` zFL%ixUlX+^gYB)RZztzUx_EUk;*IYjPmVRzvjI{Ju&D|YPx~R*h@5ZQ?~=7+_(rvr;gN;!S}}I3g9kC zN*z3`ns~vOBLLal;shfx6t30@Vlup7qsu>i;&~a?^?{Rz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)mtCWI&QhVFM^|C-zK+gv(eHz{VEDma`({)u+FK_tC zm81JCAGK3WV+^I}XoiqoCctX%?bSOa)IzM;9e-Z0#`H(j1d|HXbNr>F17Fwz+zVNB zN5DQDY+zDP1^aS5r*1m@UJ59Eahoq_tkTgnP**ZgP%{EdOz9aQ>Px5sJIgOm?Ee7s zsHqP>SnTD&=ckuSe0NriJZX0WmOO-Oz(@{vimprpEGZqGscqe+3V6Ml2Zjq?uKs^{ eIaRWFbVfq9h7u=i6%XE)P7i9JRjB#!<^KSn8Px&+ literal 0 HcmV?d00001 From 414f582e84199fb9a44b9ff040e7dd2ed13e3302 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 6 Feb 2023 11:54:00 +0100 Subject: [PATCH 199/306] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e04d365..72c93b0 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) -# Micro migration -![Logo](./docs/Logo.png) + +#![Logo](./docs/Logo.png) Tiny java library to migrate MicroStream datastores. Applies migration scripts on the datastores to keep them up to date. From 8c2ba3a9fb45b72d04c2b8ddd1760c399411b01e Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 6 Feb 2023 12:04:35 +0100 Subject: [PATCH 200/306] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 72c93b0..c438c50 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) -#![Logo](./docs/Logo.png) +# XDEV MicroMigration Logo Tiny java library to migrate MicroStream datastores. Applies migration scripts on the datastores to keep them up to date. From db1538e6833bc26cc745c8e6ee4a87253e1ff1a5 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Mon, 6 Feb 2023 12:04:52 +0100 Subject: [PATCH 201/306] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c438c50..d06cc82 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) -# XDEV MicroMigration Logo +# XDEV MicroMigration Logo Tiny java library to migrate MicroStream datastores. Applies migration scripts on the datastores to keep them up to date. From 450cfc82bed0675610427e35b7719a639320d952 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Thu, 9 Feb 2023 16:00:55 +0100 Subject: [PATCH 202/306] Added getNativeStorageManager --- CHANGELOG.md | 3 + ...nosticMigrationEmbeddedStorageManager.java | 13 +++- .../MigrationScriptAfterScriptTest.java | 73 ++++++++++++++----- .../MigrationScriptAfterScriptTest.java | 65 +++++++++++++---- .../MigrationScriptAfterScriptTest.java | 65 +++++++++++++---- 5 files changed, 166 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7701a9c..770ae36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.0.8 +* Access to the native embedded manager is now possible in the scripts (see ``VersionAgnosticMigrationEmbeddedStorageManager#getNativeStorageManager``) + ## 0.0.7 * A lot of refactoring of the module structure * A migration history is now available and automatically stored diff --git a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java index 6f0286a..06c30af 100644 --- a/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java +++ b/core/src/main/java/software/xdev/micromigration/microstream/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java @@ -46,7 +46,6 @@ public abstract class VersionAgnosticMigrationEmbeddedStorageManager { private final MicroMigrater migrater; private VersionedRootWithHistory versionRoot; - private final VersionAgnosticTunnelingEmbeddedStorageManager tunnelingManager; /** @@ -64,7 +63,15 @@ public VersionAgnosticMigrationEmbeddedStorageManager( this.tunnelingManager = Objects.requireNonNull(tunnelingManager); this.migrater = Objects.requireNonNull(migrater); } - + + /** + * @return the native MicroStream EmbeddedStorageManager + */ + public E getNativeStorageManager() + { + return this.getTunnelingManager().getNativeStorageManager(); + } + /** * @return the used {@link VersionAgnosticTunnelingEmbeddedStorageManager} */ @@ -72,7 +79,7 @@ protected VersionAgnosticTunnelingEmbeddedStorageManager getTunnelingManager( { return this.tunnelingManager; } - + /** * Checks if the root object is of the instance of {@link Versioned}. * If it is not, the root will be replaced with the versioned root and the actual root object diff --git a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index d5b6a8a..02ee701 100644 --- a/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -20,12 +20,15 @@ import java.io.IOException; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import one.microstream.persistence.types.Storer; import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; @@ -43,9 +46,11 @@ class MigrationScriptAfterScriptTest @Test void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) throws IOException { - //First run without any migration script + // First run without any migration script final ExplicitMigrater firstMigrater = new ExplicitMigrater(); - try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, firstMigrater)) + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + firstMigrater)) { migrationStorageManager.setRoot(0); migrationStorageManager.storeRoot(); @@ -53,44 +58,76 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem Assertions.assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); } - - //Run with one migration script - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(1), + // Run with one migration script + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) - ); + ); final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); - try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + secondMigrater)) { assertEquals(1, migrationStorageManager.root()); Assertions.assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); } - - //Run with two migration scripts - final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(2), + // Run with two migration scripts + final VersionAgnosticMigrationScript secondScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(2), (context) -> context.getStorageManager().setRoot(2) - ); + ); final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); - try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + thirdMigrater)) { assertEquals(2, migrationStorageManager.root()); Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); } } + @Test + void testMigrationAndUseStorer(@TempDir final Path storageFolder) throws IOException + { + final List firstList = new ArrayList<>(); + // Run with one migration script + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> + { + context.getStorageManager().setRoot(firstList); + firstList.add("1"); + final Storer storer = context.getStorageManager().getNativeStorageManager().createStorer(); + storer.store(firstList); + storer.commit(); + } + ); + + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + migrater)) + { + assertEquals(1, ((List)migrationStorageManager.root()).size()); + } + } + @Test void testMigrationWithScriptExecutionNotification(@TempDir final Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(1), + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) - ); + ); final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); final AtomicBoolean notificationReceived = new AtomicBoolean(false); migrater.registerNotificationConsumer( - notification -> + notification -> { Assertions.assertEquals(firstScript, notification.getExecutedScript()); Assertions.assertEquals(new MigrationVersion(0), notification.getSourceVersion()); diff --git a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index 5c9c99c..f67ca77 100644 --- a/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -20,12 +20,15 @@ import java.io.IOException; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import one.microstream.persistence.types.Storer; import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; @@ -41,7 +44,7 @@ class MigrationScriptAfterScriptTest { @Test - void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) throws IOException { //First run without any migration script final ExplicitMigrater firstMigrater = new ExplicitMigrater(); @@ -69,11 +72,13 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(2), - (context) -> context.getStorageManager().setRoot(2) + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) ); final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); - try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + thirdMigrater)) { assertEquals(2, migrationStorageManager.root()); Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); @@ -81,12 +86,40 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem } @Test - void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException + void testMigrationAndUseStorer(@TempDir final Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(1), + final List firstList = new ArrayList<>(); + // Run with one migration script + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> + { + context.getStorageManager().setRoot(firstList); + firstList.add("1"); + final Storer storer = context.getStorageManager().getNativeStorageManager().createStorer(); + storer.store(firstList); + storer.commit(); + } + ); + + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + migrater)) + { + assertEquals(1, ((List)migrationStorageManager.root()).size()); + } + } + + @Test + void testMigrationWithScriptExecutionNotification(@TempDir final Path storageFolder) throws IOException + { + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) - ); + ); final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); final AtomicBoolean notificationReceived = new AtomicBoolean(false); migrater.registerNotificationConsumer( @@ -105,12 +138,12 @@ void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) t } @Test - void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir final Path storageFolder) throws IOException { //First run without any migration script - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { - VersionedObject firstRoot = new VersionedObject<>(0); + final VersionedObject firstRoot = new VersionedObject<>(0); storageManager.setRoot(firstRoot); storageManager.storeRoot(); assertEquals(Integer.valueOf(0), firstRoot.getObject()); @@ -123,7 +156,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { new MigrationManager( (Versioned) storageManager.root(), @@ -132,7 +165,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ) .migrate(storageManager.root()); @SuppressWarnings("unchecked") - VersionedObject currentRoot = (VersionedObject)storageManager.root(); + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(1), currentRoot.getObject()); assertEquals(new MigrationVersion(1), currentRoot.getVersion()); } @@ -143,7 +176,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { new MigrationManager( (Versioned) storageManager.root(), @@ -152,13 +185,13 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ) .migrate(storageManager.root()); @SuppressWarnings("unchecked") - VersionedObject currentRoot = (VersionedObject)storageManager.root(); + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(2), currentRoot.getObject()); assertEquals(new MigrationVersion(2), currentRoot.getVersion()); } } - private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(Path storageFolder) + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(final Path storageFolder) { return EmbeddedStorage.start(storageFolder); } diff --git a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java index 5c9c99c..f67ca77 100644 --- a/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java +++ b/microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -20,12 +20,15 @@ import java.io.IOException; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import one.microstream.persistence.types.Storer; import one.microstream.storage.embedded.types.EmbeddedStorage; import one.microstream.storage.embedded.types.EmbeddedStorageManager; import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; @@ -41,7 +44,7 @@ class MigrationScriptAfterScriptTest { @Test - void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) throws IOException { //First run without any migration script final ExplicitMigrater firstMigrater = new ExplicitMigrater(); @@ -69,11 +72,13 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem //Run with two migration scripts final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(2), - (context) -> context.getStorageManager().setRoot(2) + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) ); final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); - try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, thirdMigrater)) + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + thirdMigrater)) { assertEquals(2, migrationStorageManager.root()); Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); @@ -81,12 +86,40 @@ void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@Tem } @Test - void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) throws IOException + void testMigrationAndUseStorer(@TempDir final Path storageFolder) throws IOException { - final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( - new MigrationVersion(1), + final List firstList = new ArrayList<>(); + // Run with one migration script + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> + { + context.getStorageManager().setRoot(firstList); + firstList.add("1"); + final Storer storer = context.getStorageManager().getNativeStorageManager().createStorer(); + storer.store(firstList); + storer.commit(); + } + ); + + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + migrater)) + { + assertEquals(1, ((List)migrationStorageManager.root()).size()); + } + } + + @Test + void testMigrationWithScriptExecutionNotification(@TempDir final Path storageFolder) throws IOException + { + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), (context) -> context.getStorageManager().setRoot(1) - ); + ); final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); final AtomicBoolean notificationReceived = new AtomicBoolean(false); migrater.registerNotificationConsumer( @@ -105,12 +138,12 @@ void testMigrationWithScriptExecutionNotification(@TempDir Path storageFolder) t } @Test - void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir Path storageFolder) throws IOException + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir final Path storageFolder) throws IOException { //First run without any migration script - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { - VersionedObject firstRoot = new VersionedObject<>(0); + final VersionedObject firstRoot = new VersionedObject<>(0); storageManager.setRoot(firstRoot); storageManager.storeRoot(); assertEquals(Integer.valueOf(0), firstRoot.getObject()); @@ -123,7 +156,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem new MigrationVersion(1), (context) -> context.getMigratingObject().setObject(1) ); - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { new MigrationManager( (Versioned) storageManager.root(), @@ -132,7 +165,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ) .migrate(storageManager.root()); @SuppressWarnings("unchecked") - VersionedObject currentRoot = (VersionedObject)storageManager.root(); + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(1), currentRoot.getObject()); assertEquals(new MigrationVersion(1), currentRoot.getVersion()); } @@ -143,7 +176,7 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem new MigrationVersion(2), (context) -> context.getMigratingObject().setObject(2) ); - try(final EmbeddedStorageManager storageManager = startEmbeddedStorageManagerWithPath(storageFolder)) + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) { new MigrationManager( (Versioned) storageManager.root(), @@ -152,13 +185,13 @@ void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@Tem ) .migrate(storageManager.root()); @SuppressWarnings("unchecked") - VersionedObject currentRoot = (VersionedObject)storageManager.root(); + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); assertEquals(Integer.valueOf(2), currentRoot.getObject()); assertEquals(new MigrationVersion(2), currentRoot.getVersion()); } } - private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(Path storageFolder) + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(final Path storageFolder) { return EmbeddedStorage.start(storageFolder); } From 38cd1f62c87bc09f67d29d8b241241a8630eb608 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 10 Feb 2023 06:57:03 +0100 Subject: [PATCH 203/306] Update release.yml --- .github/workflows/release.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96e5823..33d6d26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,14 @@ name: Publish package to the Maven Central Repository on: push: branches: [ main ] + +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + +permissions: + contents: write + pull-requests: write + jobs: check_build: runs-on: ubuntu-latest @@ -47,14 +55,15 @@ jobs: - name: Create Release id: create_release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: shogo82148/actions-create-release@v1 with: tag_name: v${{ steps.version.outputs.release }} - name: v${{ steps.version.outputs.release }} - target_commitish: main + release_name: v${{ steps.version.outputs.release }} + commitish: main body: | + ## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) + See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. + ## Installation Add the following lines to your pom: ```XML @@ -64,8 +73,6 @@ jobs: ${{ steps.version.outputs.release }} ``` - draft: false - prerelease: false publish_central: runs-on: ubuntu-latest needs: [prepare_release] From 06f9a02005ff1d88fb11283ad4189af3bce478d6 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 10 Feb 2023 05:59:02 +0000 Subject: [PATCH 204/306] Release 0.0.8 --- core/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 0cef740..cc74f06 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-core - 0.0.8-SNAPSHOT + 0.0.8 MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.8-SNAPSHOT + 0.0.8 diff --git a/examples/pom.xml b/examples/pom.xml index 57dad20..7c76e7d 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.8-SNAPSHOT + 0.0.8 MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.8-SNAPSHOT + 0.0.8 micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 908393b..98e84aa 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.8-SNAPSHOT + 0.0.8 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8-SNAPSHOT + 0.0.8 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index c77ffd8..2efd008 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.8-SNAPSHOT + 0.0.8 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8-SNAPSHOT + 0.0.8 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 656ea3c..2e59be3 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.8-SNAPSHOT + 0.0.8 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8-SNAPSHOT + 0.0.8 diff --git a/pom.xml b/pom.xml index f61bd6e..55dc467 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.8-SNAPSHOT + 0.0.8 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 25cf2a2..2739a85 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.8-SNAPSHOT + 0.0.8 MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8-SNAPSHOT + 0.0.8 From d24c85ab534d894fb14056f92dd4dbd2bc795eab Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 10 Feb 2023 06:03:12 +0000 Subject: [PATCH 205/306] Preparing for next development iteration --- core/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index cc74f06..fd5026c 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-core - 0.0.8 + 0.0.9-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.8 + 0.0.9-SNAPSHOT diff --git a/examples/pom.xml b/examples/pom.xml index 7c76e7d..900476c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.8 + 0.0.9-SNAPSHOT MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.8 + 0.0.9-SNAPSHOT micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 98e84aa..4512bc8 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.8 + 0.0.9-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8 + 0.0.9-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 2efd008..d15b185 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.8 + 0.0.9-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8 + 0.0.9-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 2e59be3..e392b73 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.8 + 0.0.9-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8 + 0.0.9-SNAPSHOT diff --git a/pom.xml b/pom.xml index 55dc467..e07a650 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.8 + 0.0.9-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index 2739a85..d9457a3 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.8 + 0.0.9-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.8 + 0.0.9-SNAPSHOT From 8c670240d547d37059bb4ddbf8f31ff2793c9ad0 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Fri, 10 Feb 2023 07:15:56 +0100 Subject: [PATCH 206/306] Update README.md --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d06cc82..a78c3ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/versions) +[![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.com/artifact/software.xdev/micro-migration/0.0.4/versions) [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/micro-migration/checkBuild.yml?branch=develop)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) @@ -39,11 +39,13 @@ the version, suited to the current code. ### Maven Simply add the dependency to your `pom.xml`: + ```xml + - software.xdev - micro-migration-microstream-v7 - 0.0.7 + software.xdev + micro-migration-microstream-v7 + 0.0.8 ``` @@ -129,11 +131,13 @@ final ReflectiveMigrater migrater = new ReflectiveMigrater("software.xdev.microm Since the `ReflectiveMigrater` uses the [Reflections library](https://github.com/ronmamo/reflections) it is extracted to its [own module](https://github.com/xdev-software/micro-migration/tree/main/reflection). To use this, you need to add the following dependency to your `pom.xml`: + ```xml + - software.xdev - micro-migration-reflection - 0.0.7 + software.xdev + micro-migration-reflection + 0.0.8 ``` @@ -151,9 +155,9 @@ then use `micro-migration-microstream-v7`) and exclude the dependent version of ```xml software.xdev - micro-migration-microstream-v7 - 0.0.7 - + micro-migration-microstream-v7 + 0.0.8 + one.microstream microstream-storage-embedded From af1082a0afed4f22f8766c9b1d4e9b15bd90c4f6 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer Date: Wed, 22 Feb 2023 14:16:55 +0100 Subject: [PATCH 207/306] Added definition of annotation processor of microstream --- microstream-v5/pom.xml | 27 +++++++++++++++++++++++++++ microstream-v6/pom.xml | 27 +++++++++++++++++++++++++++ microstream-v7/pom.xml | 27 +++++++++++++++++++++++++++ pom.xml | 16 ++++++++++------ 4 files changed, 91 insertions(+), 6 deletions(-) diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 4512bc8..630e458 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -18,6 +18,33 @@ 0.0.9-SNAPSHOT + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + UTF-8 + + + + one.microstream + microstream-base + ${microstream.version} + + + + + + + software.xdev diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index d15b185..30becc4 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -18,6 +18,33 @@ 0.0.9-SNAPSHOT + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + UTF-8 + + + + one.microstream + microstream-base + ${microstream.version} + + + + + + + software.xdev diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index e392b73..8a1e713 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -18,6 +18,33 @@ 0.0.9-SNAPSHOT + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + UTF-8 + + + + one.microstream + microstream-base + ${microstream.version} + + + + + + + software.xdev diff --git a/pom.xml b/pom.xml index e07a650..e4e7774 100644 --- a/pom.xml +++ b/pom.xml @@ -143,6 +143,16 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + ${java.version} + ${java.version} + UTF-8 + + @@ -313,12 +323,6 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 - - ${java.version} - ${java.version} - UTF-8 - maven-surefire-plugin From 25b6c85dcfe402b8053ed0e17d6124cfae6b950c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:08:24 +0000 Subject: [PATCH 208/306] Bump maven-compiler-plugin from 3.10.1 to 3.11.0 in /reflection Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4e7774..cb68b67 100644 --- a/pom.xml +++ b/pom.xml @@ -146,7 +146,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 ${java.version} ${java.version} From 825afbf9c349a4f17a1a5f75eec6afb2927d806c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:08:52 +0000 Subject: [PATCH 209/306] Bump maven-javadoc-plugin from 3.4.1 to 3.5.0 in /microstream-v6 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.1 to 3.5.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.1...maven-javadoc-plugin-3.5.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4e7774..062a98d 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 ${java.version} UTF-8 From d4e3ada882b4027e429b27394ef1b108ef3c9c53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 13:07:26 +0000 Subject: [PATCH 210/306] Bump jreleaser-maven-plugin from 1.4.0 to 1.5.1 in /core Bumps [jreleaser-maven-plugin](https://github.com/jreleaser/jreleaser) from 1.4.0 to 1.5.1. - [Release notes](https://github.com/jreleaser/jreleaser/releases) - [Changelog](https://github.com/jreleaser/jreleaser/blob/main/jreleaser.yml) - [Commits](https://github.com/jreleaser/jreleaser/compare/v1.4.0...v1.5.1) --- updated-dependencies: - dependency-name: org.jreleaser:jreleaser-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4e7774..ee5fc48 100644 --- a/pom.xml +++ b/pom.xml @@ -120,7 +120,7 @@ org.jreleaser jreleaser-maven-plugin - 1.4.0 + 1.5.1 From 46a06d016c45525e6cc5bd4cf314b4037f149e95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:42:35 +0000 Subject: [PATCH 211/306] Bump checkstyle from 10.6.0 to 10.9.3 in /microstream-v5 Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 10.6.0 to 10.9.3. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.6.0...checkstyle-10.9.3) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4e7774..bde9824 100644 --- a/pom.xml +++ b/pom.xml @@ -299,7 +299,7 @@ com.puppycrawl.tools checkstyle - 10.6.0 + 10.9.3 From 6826886d322ece9923d5a8fdef28ce45b83564e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 13:47:39 +0000 Subject: [PATCH 212/306] Bump modernizer-maven-plugin from 2.5.0 to 2.6.0 in /reflection Bumps [modernizer-maven-plugin](https://github.com/gaul/modernizer-maven-plugin) from 2.5.0 to 2.6.0. - [Release notes](https://github.com/gaul/modernizer-maven-plugin/releases) - [Commits](https://github.com/gaul/modernizer-maven-plugin/compare/modernizer-maven-plugin-2.5.0...modernizer-maven-plugin-2.6.0) --- updated-dependencies: - dependency-name: org.gaul:modernizer-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4e7774..3324be2 100644 --- a/pom.xml +++ b/pom.xml @@ -191,7 +191,7 @@ org.gaul modernizer-maven-plugin - 2.5.0 + 2.6.0 ${java.version} From a576d1c6c08f6b56525541d3b8dc974d72c5940e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 13:02:13 +0000 Subject: [PATCH 213/306] Bump maven-enforcer-plugin from 3.1.0 to 3.3.0 in /microstream-v5 Bumps [maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.1.0 to 3.3.0. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.1.0...enforcer-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4e7774..5129da0 100644 --- a/pom.xml +++ b/pom.xml @@ -210,7 +210,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.3.0 From 7fb45623a5ab0baa1cee6b554cef51043c3f7957 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 13:05:09 +0000 Subject: [PATCH 214/306] Bump maven-checkstyle-plugin from 3.1.2 to 3.2.2 in /core Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.1.2 to 3.2.2. - [Release notes](https://github.com/apache/maven-checkstyle-plugin/releases) - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.1.2...maven-checkstyle-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4e7774..44c38f3 100644 --- a/pom.xml +++ b/pom.xml @@ -294,7 +294,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.2 + 3.2.2 com.puppycrawl.tools From caa47772e3a6c486fc80186db9b1b847c59fac52 Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:50:55 +0200 Subject: [PATCH 215/306] Added support for MicroStream v8 --- .github/workflows/release.yml | 2 +- README.md | 24 +- examples/pom.xml | 2 +- microstream-v8/pom.xml | 65 +++ .../microstream/MigrationEmbeddedStorage.java | 104 +++++ .../MigrationEmbeddedStorageManager.java | 49 +++ .../microstream/MigrationManager.java | 72 ++++ .../microstream/MigrationScript.java | 34 ++ .../TunnelingEmbeddedStorageManager.java | 382 ++++++++++++++++++ .../microstream/package-info.java | 19 + ...oduceMigrationOnExistingDatastoreTest.java | 56 +++ .../MigrationScriptAfterScriptTest.java | 199 +++++++++ .../integration/MultipleScriptsTest.java | 90 +++++ ...oreStuffInMigrationStorageManagerTest.java | 74 ++++ .../migrater/ExplicitMigraterTest.java | 88 ++++ .../testUtil/MicroMigrationScriptDummy.java | 42 ++ pom.xml | 1 + 17 files changed, 1292 insertions(+), 11 deletions(-) create mode 100644 microstream-v8/pom.xml create mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java create mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java create mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java create mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java create mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java create mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/package-info.java create mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java create mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java create mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java create mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java create mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java create mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33d6d26..0e2cd58 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: ```XML software.xdev - micro-migration-microstream-v7 + micro-migration-microstream-v8 ${{ steps.version.outputs.release }} ``` diff --git a/README.md b/README.md index a78c3ab..904063d 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Simply add the dependency to your `pom.xml`: software.xdev - micro-migration-microstream-v7 + micro-migration-microstream-v8 0.0.8 ``` @@ -142,16 +142,22 @@ To use this, you need to add the following dependency to your `pom.xml`: ``` ## Supported MicroStream versions + Micro migration currently supports the following MicroStream versions: -| MicroStream Version | Micro migration artifact Id | +| MicroStream Version | Micro migration artifact Id | | --- | --- | -| [05.00.02-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | micro-migration-microstream-v5 | -| [06.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | micro-migration-microstream-v6 | -| [07.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | micro-migration-microstream-v7 | - -If you are using a different, not listed version of MicroStream, this shouldn't be a problem. -Usually you can simply use the closest Micro migration version (f.e. you are using MicroStream `07.00.00-MS-GA`, -then use `micro-migration-microstream-v7`) and exclude the dependent version of MicroStream vom Micro migration: +| [05.00.02-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | +micro-migration-microstream-v5 | +| [06.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | +micro-migration-microstream-v6 | +| [07.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | +micro-migration-microstream-v7 | +| [08.01.01-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/08.01.01-MS-GA) | +micro-migration-microstream-v8 | + +If you are using a different, not listed version of MicroStream, this shouldn't be a problem. +Usually you can simply use the closest Micro migration version (f.e. you are using MicroStream `08.00.00-MS-GA`, +then use `micro-migration-microstream-v8`) and exclude the dependent version of MicroStream vom Micro migration: ```xml software.xdev diff --git a/examples/pom.xml b/examples/pom.xml index 900476c..555af8d 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -17,7 +17,7 @@ software.xdev - micro-migration-microstream-v7 + micro-migration-microstream-v8 ${project.version} diff --git a/microstream-v8/pom.xml b/microstream-v8/pom.xml new file mode 100644 index 0000000..1d206c6 --- /dev/null +++ b/microstream-v8/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + software.xdev + micro-migration-microstream-v8 + 0.0.9-SNAPSHOT + MicroMigration-for-MicroStreamV8 + Provides the micro migration support for MicroStream version 8 + + + 08.01.01-MS-GA + + + + software.xdev + micro-migration + 0.0.9-SNAPSHOT + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + UTF-8 + + + + one.microstream + microstream-base + ${microstream.version} + + + + + + + + + + software.xdev + micro-migration-core + ${project.version} + + + one.microstream + microstream-storage-embedded + ${microstream.version} + + + one.microstream + microstream-configuration + ${microstream.version} + + + diff --git a/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java new file mode 100644 index 0000000..ea59546 --- /dev/null +++ b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java @@ -0,0 +1,104 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.microstream; + +import java.nio.file.Path; +import java.util.Objects; + +import one.microstream.afs.nio.types.NioFileSystem; +import one.microstream.storage.embedded.types.EmbeddedStorageFoundation; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.types.Storage; +import one.microstream.storage.types.StorageConfiguration; +import software.xdev.micromigration.migrater.MicroMigrater; + +/** + * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link one.microstream.storage.embedded.types.EmbeddedStorage}. + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorage +{ + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

      Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + public static final MigrationEmbeddedStorageManager start(final MicroMigrater migrater) + { + Objects.requireNonNull(migrater); + return new MigrationEmbeddedStorageManager( + createStorageManager(), + migrater + ).start(); + } + + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

      Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param storageDirectory is used as the base directory for the datastore + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start( + final Path storageDirectory, + final MicroMigrater migrater + ) + { + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageDirectory); + + return new MigrationEmbeddedStorageManager( + createStorageManager(storageDirectory), + migrater + ).start(); + } + + private static EmbeddedStorageManager createStorageManager(final Path storageDirectory) + { + final NioFileSystem fileSystem = NioFileSystem.New(); + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder() + .setStorageFileProvider( + Storage.FileProviderBuilder(fileSystem) + .setDirectory(fileSystem.ensureDirectoryPath(storageDirectory.toAbsolutePath().toString())) + .createFileProvider() + ) + .createConfiguration() + ) + .createEmbeddedStorageManager(); + } + + private static EmbeddedStorageManager createStorageManager() + { + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder().createConfiguration() + ) + .createEmbeddedStorageManager(); + } +} diff --git a/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..02ddae5 --- /dev/null +++ b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java @@ -0,0 +1,49 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.microstream; + +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.Versioned; + +/** + * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationEmbeddedStorageManager + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorageManager + extends VersionAgnosticMigrationEmbeddedStorageManager +{ + /** + * @param nativeManager which will be used as the underlying storage manager. + * Almost all methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + * @param migrater which is used as source for the migration scripts + */ + public MigrationEmbeddedStorageManager( + EmbeddedStorageManager nativeManager, + MicroMigrater migrater + ) + { + super(new TunnelingEmbeddedStorageManager(nativeManager), migrater); + } +} diff --git a/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java new file mode 100644 index 0000000..5d45118 --- /dev/null +++ b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java @@ -0,0 +1,72 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.microstream; + +import java.util.function.Consumer; +import java.util.function.Supplier; + +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; + +/** + * Specific implementation of the {@link VersionAgnosticMigrationManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationManager + */ +public class MigrationManager extends VersionAgnosticMigrationManager +{ + /** + * Much more complicated constructor than {@link MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManager( + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater, + final EmbeddedStorageManager storageManager + ) + { + super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } + + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link VersionAgnosticMigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManager( + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } +} diff --git a/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java new file mode 100644 index 0000000..c3962de --- /dev/null +++ b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.microstream; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; + +/** + * Interface for scripts to migrate / update datastores. + *

      + * One script is supposed to bring a datastore from a lower version to the target version. + * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, + * the target version is reached. + *

      + * This is a shorthand for {@link VersionAgnosticMigrationScript} for this specific MicroStream version. + * + * @author Johannes Rabauer + * + */ +public interface MigrationScript extends VersionAgnosticMigrationScript +{} diff --git a/microstream-v8/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java new file mode 100644 index 0000000..29f3b6d --- /dev/null +++ b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java @@ -0,0 +1,382 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.microstream; + +import java.nio.ByteBuffer; +import java.util.Objects; +import java.util.function.Predicate; + +import one.microstream.afs.types.AFile; +import one.microstream.collections.types.XGettingEnum; +import one.microstream.persistence.binary.types.Binary; +import one.microstream.persistence.types.PersistenceManager; +import one.microstream.persistence.types.PersistenceRootsView; +import one.microstream.persistence.types.PersistenceTypeDictionaryExporter; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import one.microstream.storage.exceptions.StorageException; +import one.microstream.storage.types.Database; +import one.microstream.storage.types.StorageConfiguration; +import one.microstream.storage.types.StorageConnection; +import one.microstream.storage.types.StorageEntityCacheEvaluator; +import one.microstream.storage.types.StorageEntityTypeExportFileProvider; +import one.microstream.storage.types.StorageEntityTypeExportStatistics; +import one.microstream.storage.types.StorageEntityTypeHandler; +import one.microstream.storage.types.StorageLiveFileProvider; +import one.microstream.storage.types.StorageRawFileStatistics; +import one.microstream.storage.types.StorageTypeDictionary; +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; + +/** + * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. + *

      + * It simply relays all the commands to the contained {@link EmbeddedStorageManager}. + * + * @see VersionAgnosticTunnelingEmbeddedStorageManager + * + * @author Johannes Rabauer + * + */ +public class TunnelingEmbeddedStorageManager + implements + EmbeddedStorageManager, + VersionAgnosticTunnelingEmbeddedStorageManager +{ + /** + * The underlying, actual MicroStream EmbeddedStorageManager + */ + protected final EmbeddedStorageManager nativeManager; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * All methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + */ + public TunnelingEmbeddedStorageManager( + final EmbeddedStorageManager nativeManager + ) + { + Objects.requireNonNull(nativeManager); + this.nativeManager = nativeManager; + } + + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#start} + */ + @Override + public TunnelingEmbeddedStorageManager start() + { + this.nativeManager.start(); + return this; + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#root} + */ + @Override + public Object root() { + return this.nativeManager.root(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#setRoot(Object)} + */ + @Override + public Object setRoot(final Object newRoot) { + return this.nativeManager.setRoot(newRoot); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#storeRoot()} + */ + @Override + public long storeRoot() { + return this.nativeManager.storeRoot(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#configuration()} + */ + @Override + public StorageConfiguration configuration() + { + return this.nativeManager.configuration(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#typeDictionary()} + */ + @Override + public StorageTypeDictionary typeDictionary() + { + return this.nativeManager.typeDictionary(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#shutdown()} + */ + @Override + public boolean shutdown() + { + return this.nativeManager.shutdown(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#close()} + */ + @Override + public void close() throws StorageException + { + this.nativeManager.close(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createConnection()} + */ + @Override + public StorageConnection createConnection() + { + return this.nativeManager.createConnection(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#viewRoots()} + */ + @Override + public PersistenceRootsView viewRoots() + { + return this.nativeManager.viewRoots(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#database()} + */ + @Override + public Database database() + { + return this.nativeManager.database(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isAcceptingTasks()} + */ + @Override + public boolean isAcceptingTasks() + { + return this.nativeManager.isAcceptingTasks(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isRunning()} + */ + @Override + public boolean isRunning() + { + return this.nativeManager.isRunning(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isStartingUp()} + */ + @Override + public boolean isStartingUp() + { + return this.nativeManager.isStartingUp(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isShuttingDown()} + */ + @Override + public boolean isShuttingDown() + { + return this.nativeManager.isShuttingDown(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#checkAcceptingTasks()} + */ + @Override + public void checkAcceptingTasks() + { + this.nativeManager.checkAcceptingTasks(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#initializationTime()} + */ + @Override + public long initializationTime() + { + return this.nativeManager.initializationTime(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#operationModeTime()} + */ + @Override + public long operationModeTime() + { + return this.nativeManager.operationModeTime(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isActive()} + */ + @Override + public boolean isActive() + { + return this.nativeManager.isActive(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueGarbageCollection(long)} + */ + @Override + public boolean issueGarbageCollection(final long nanoTimeBudget) + { + return this.nativeManager.issueGarbageCollection(nanoTimeBudget); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFileCheck(long)} + */ + @Override + public boolean issueFileCheck(final long nanoTimeBudget) + { + return this.nativeManager.issueFileCheck(nanoTimeBudget); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueCacheCheck(long, StorageEntityCacheEvaluator)} + */ + @Override + public boolean issueCacheCheck(final long nanoTimeBudget, final StorageEntityCacheEvaluator entityEvaluator) + { + return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createStorageStatistics} + */ + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.nativeManager.createStorageStatistics(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportChannels(StorageLiveFileProvider)} + */ + @Override + public void exportChannels(final StorageLiveFileProvider fileProvider, final boolean performGarbageCollection) + { + this.nativeManager.exportChannels(fileProvider, performGarbageCollection); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportTypes(StorageEntityTypeExportFileProvider)} + */ + @Override + public StorageEntityTypeExportStatistics exportTypes( + final StorageEntityTypeExportFileProvider exportFileProvider, + final Predicate isExportType) + { + return this.nativeManager.exportTypes(exportFileProvider, isExportType); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#importFiles(XGettingEnum)} + */ + @Override + public void importFiles(final XGettingEnum importFiles) + { + this.nativeManager.importFiles(importFiles); + } + + @Override + public void importData(final XGettingEnum xGettingEnum) + { + this.nativeManager.importData(xGettingEnum); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#persistenceManager()} + */ + @Override + public PersistenceManager persistenceManager() + { + return this.nativeManager.persistenceManager(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#store(Object)} + */ + @Override + public long store(final Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.nativeManager; + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFullBackup(StorageLiveFileProvider, PersistenceTypeDictionaryExporter)} + */ + @Override + public void issueFullBackup( + final StorageLiveFileProvider targetFileProvider, + final PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); + } +} diff --git a/microstream-v8/src/main/java/software/xdev/micromigration/microstream/package-info.java b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/package-info.java new file mode 100644 index 0000000..82c7e38 --- /dev/null +++ b/microstream-v8/src/main/java/software/xdev/micromigration/microstream/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Provides classes to use micro migration for MicroStream v7 + */ + diff --git a/microstream-v8/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/microstream-v8/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java new file mode 100644 index 0000000..00118e9 --- /dev/null +++ b/microstream-v8/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -0,0 +1,56 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; + +class IntroduceMigrationOnExistingDatastoreTest +{ + final static String ROOT = "OriginalRoot"; + + @Test + void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) throws IOException + { + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) + { + storageManager.setRoot(ROOT); + storageManager.storeRoot(); + } + + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(ROOT, migrationStorageManager.root()); + assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); + } + } +} diff --git a/microstream-v8/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/microstream-v8/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java new file mode 100644 index 0000000..f67ca77 --- /dev/null +++ b/microstream-v8/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -0,0 +1,199 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import one.microstream.persistence.types.Storer; +import one.microstream.storage.embedded.types.EmbeddedStorage; +import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.microstream.MigrationManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedObject; + +class MigrationScriptAfterScriptTest +{ + @Test + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) throws IOException + { + //First run without any migration script + final ExplicitMigrater firstMigrater = new ExplicitMigrater(); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, firstMigrater)) + { + migrationStorageManager.setRoot(0); + migrationStorageManager.storeRoot(); + assertEquals(0, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); + } + + + //Run with one migration script + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + { + assertEquals(1, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); + } + + + //Run with two migration scripts + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + thirdMigrater)) + { + assertEquals(2, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationAndUseStorer(@TempDir final Path storageFolder) throws IOException + { + final List firstList = new ArrayList<>(); + // Run with one migration script + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> + { + context.getStorageManager().setRoot(firstList); + firstList.add("1"); + final Storer storer = context.getStorageManager().getNativeStorageManager().createStorer(); + storer.store(firstList); + storer.commit(); + } + ); + + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + migrater)) + { + assertEquals(1, ((List)migrationStorageManager.root()).size()); + } + } + + @Test + void testMigrationWithScriptExecutionNotification(@TempDir final Path storageFolder) throws IOException + { + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + final AtomicBoolean notificationReceived = new AtomicBoolean(false); + migrater.registerNotificationConsumer( + notification -> + { + Assertions.assertEquals(firstScript, notification.getExecutedScript()); + Assertions.assertEquals(new MigrationVersion(0), notification.getSourceVersion()); + Assertions.assertEquals(new MigrationVersion(1), notification.getTargetVersion()); + notificationReceived.set(true); + } + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertTrue(notificationReceived.get()); + } + } + + @Test + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir final Path storageFolder) throws IOException + { + //First run without any migration script + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) + { + final VersionedObject firstRoot = new VersionedObject<>(0); + storageManager.setRoot(firstRoot); + storageManager.storeRoot(); + assertEquals(Integer.valueOf(0), firstRoot.getObject()); + assertEquals(new MigrationVersion(0), firstRoot.getVersion()); + } + + + //Run with one migration script + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getMigratingObject().setObject(1) + ); + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManager( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(1), currentRoot.getObject()); + assertEquals(new MigrationVersion(1), currentRoot.getVersion()); + } + + + //Run with two migration scripts + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getMigratingObject().setObject(2) + ); + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManager( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript, secondScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(2), currentRoot.getObject()); + assertEquals(new MigrationVersion(2), currentRoot.getVersion()); + } + } + + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(final Path storageFolder) + { + return EmbeddedStorage.start(storageFolder); + } + +} diff --git a/microstream-v8/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/microstream-v8/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java new file mode 100644 index 0000000..57964f3 --- /dev/null +++ b/microstream-v8/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -0,0 +1,90 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +class MultipleScriptsTest +{ + @Test + void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir Path storageFolder) + { + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(2, migrationStorageManager.root()); + assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationWithTwoScriptsWithSameVersion(@TempDir Path storageFolder) + { + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(2) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript) + ); + } + + @Test + void testMigrationWithThreeScriptsWithSameVersion(@TempDir Path storageFolder) + { + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(3) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript, thirdScript) + ); + } +} diff --git a/microstream-v8/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/microstream-v8/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java new file mode 100644 index 0000000..c519a20 --- /dev/null +++ b/microstream-v8/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -0,0 +1,74 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +class StoreStuffInMigrationStorageManagerTest +{ + private static class RootClass + { + private final ChildClass child = new ChildClass(); + } + + private static class ChildClass + { + private int i = 0; + } + + @Test + void testStoringSomethingAfterUpdating(@TempDir Path storageFolder) throws IOException + { + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> {} + ); + final ExplicitMigrater migrater = new ExplicitMigrater(script); + //Create new store and change stored object + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + migrationStorageManager.setRoot(new RootClass()); + migrationStorageManager.storeRoot(); + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertEquals(0, storedRoot.child.i); + ((RootClass)migrationStorageManager.root()).child.i = 1; + migrationStorageManager.store(storedRoot.child); + assertEquals(1, storedRoot.child.i); + } + //Check if stored object is correct + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertNotNull(storedRoot); + assertEquals(1, storedRoot.child.i); + } + } + +} diff --git a/microstream-v8/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/microstream-v8/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java new file mode 100644 index 0000000..d2c0f15 --- /dev/null +++ b/microstream-v8/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -0,0 +1,88 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.migrater; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; + +class ExplicitMigraterTest +{ + + @Test + void testGetSortedScripts_empty() + { + final ExplicitMigrater migrater = new ExplicitMigrater(); + assertEquals(0,migrater.getSortedScripts().size()); + } + + @Test + void testGetSortedScripts_sorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)), + new MicroMigrationScriptDummy(new MigrationVersion(2)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testGetSortedScripts_unsorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(2)), + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testWrongTypedVersionedScript(@TempDir Path storageFolder) + { + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(storageFolder, new ExplicitMigrater())) + { + storageManager.setRoot("SomeString"); + storageManager.storeRoot(); + } + final ExplicitMigrater migrater = new ExplicitMigrater( + new SimpleTypedMigrationScript( + new MigrationVersion(1), + (context) -> { + context.getStorageManager().setRoot(context.getMigratingObject() + 1); + } + ) + ); + Assertions.assertThrows(ClassCastException.class, () -> + { + MigrationEmbeddedStorage.start(storageFolder, migrater); + } + ); + + } + +} diff --git a/microstream-v8/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/microstream-v8/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java new file mode 100644 index 0000000..2d75dff --- /dev/null +++ b/microstream-v8/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -0,0 +1,42 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.testUtil; + +import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript +{ + private final MigrationVersion version; + + public MicroMigrationScriptDummy(MigrationVersion version) + { + this.version = version; + } + + @Override + public MigrationVersion getTargetVersion() + { + return this.version; + } + + @Override + public void migrate(Context context) { + // Don't do anything. + } +} diff --git a/pom.xml b/pom.xml index a33810f..6f9477b 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,7 @@ microstream-v5 microstream-v6 microstream-v7 + microstream-v8 From 7f8b919274f013e7df64b2d36861d9176c95c6af Mon Sep 17 00:00:00 2001 From: Johannes Rabauer <8188460+JohannesRabauer@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:55:14 +0200 Subject: [PATCH 216/306] Fix README --- .idea/saveactions_settings.xml | 1 - README.md | 14 +++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml index 71a42c4..42b6fc4 100644 --- a/.idea/saveactions_settings.xml +++ b/.idea/saveactions_settings.xml @@ -5,7 +5,6 @@ From 047a37030c74e5946399154cc2527e2747cdd618 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:37:26 +0000 Subject: [PATCH 232/306] Bump maven-surefire-plugin from 2.22.2 to 3.1.2 in /core Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 2.22.2 to 3.1.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-2.22.2...surefire-3.1.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..cef98c5 100644 --- a/pom.xml +++ b/pom.xml @@ -327,7 +327,7 @@ maven-surefire-plugin - 2.22.2 + 3.1.2 org.apache.maven.plugins From 21bc0ba02a8790b058a383fb8ca41937f89874b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:37:42 +0000 Subject: [PATCH 233/306] Bump maven-checkstyle-plugin from 3.2.2 to 3.3.0 in /core Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.2.2 to 3.3.0. - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.2.2...maven-checkstyle-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..50e9630 100644 --- a/pom.xml +++ b/pom.xml @@ -295,7 +295,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.2 + 3.3.0 com.puppycrawl.tools From 82d899200b2541857be866aff3cfb96ea5e1f9fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:37:50 +0000 Subject: [PATCH 234/306] Bump impsort-maven-plugin from 1.8.0 to 1.9.0 in /core Bumps [impsort-maven-plugin](https://github.com/revelc/impsort-maven-plugin) from 1.8.0 to 1.9.0. - [Commits](https://github.com/revelc/impsort-maven-plugin/compare/impsort-maven-plugin-1.8.0...impsort-maven-plugin-1.9.0) --- updated-dependencies: - dependency-name: net.revelc.code:impsort-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..3eb2b25 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ net.revelc.code impsort-maven-plugin - 1.8.0 + 1.9.0 java.,javax.,org.,com. java,* From ad671efe3e3c5c4cbc5645e1305c8b2e6add6255 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:49:40 +0000 Subject: [PATCH 235/306] Bump maven-source-plugin from 3.2.1 to 3.3.0 in /reflection Bumps [maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.2.1 to 3.3.0. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.2.1...maven-source-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..6aa9543 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-source From 4ce68f2bb376f273918a5d4a3f0e6e9d898f25e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:50:06 +0000 Subject: [PATCH 236/306] Bump impsort-maven-plugin from 1.8.0 to 1.9.0 in /reflection Bumps [impsort-maven-plugin](https://github.com/revelc/impsort-maven-plugin) from 1.8.0 to 1.9.0. - [Commits](https://github.com/revelc/impsort-maven-plugin/compare/impsort-maven-plugin-1.8.0...impsort-maven-plugin-1.9.0) --- updated-dependencies: - dependency-name: net.revelc.code:impsort-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..3eb2b25 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ net.revelc.code impsort-maven-plugin - 1.8.0 + 1.9.0 java.,javax.,org.,com. java,* From b1f07ac5b91864d901caf07702a94af54c1ae7e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:06:10 +0000 Subject: [PATCH 237/306] Bump org.junit.jupiter:junit-jupiter-engine in /reflection Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.9.2 to 5.10.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.2...r5.10.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..62f3bf5 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.10.0 test From 8785f0b86439a7a25a44295c5061ea1aebb4e12e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:17:19 +0000 Subject: [PATCH 238/306] Bump org.junit.jupiter:junit-jupiter-engine in /microstream-v7 Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.9.2 to 5.10.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.2...r5.10.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..62f3bf5 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.10.0 test From 6976fc00b0c3b95c4d41ce04be75431cd5c5047d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:17:44 +0000 Subject: [PATCH 239/306] Bump org.junit.jupiter:junit-jupiter-api in /microstream-v7 Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.9.2 to 5.10.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.2...r5.10.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-api dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..d39c454 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ org.junit.jupiter junit-jupiter-api - 5.9.2 + 5.10.0 test From f96ca10160cb4472c53a1b15ec3bd1ab070e8e9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:20:31 +0000 Subject: [PATCH 240/306] Bump org.junit.jupiter:junit-jupiter-api in /microstream-v5 Bumps [org.junit.jupiter:junit-jupiter-api](https://github.com/junit-team/junit5) from 5.9.2 to 5.10.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.2...r5.10.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-api dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..d39c454 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ org.junit.jupiter junit-jupiter-api - 5.9.2 + 5.10.0 test From dce36bbe387a18addb0f379821973659cf06a102 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 12:35:46 +0000 Subject: [PATCH 241/306] Bump org.junit.jupiter:junit-jupiter-engine in /microstream-v6 Bumps [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.9.2 to 5.10.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.2...r5.10.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..62f3bf5 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.10.0 test From 3bc41fd0a82a220d62fedcaf39cacad9cd58b6a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:10:09 +0000 Subject: [PATCH 242/306] Bump org.jreleaser:jreleaser-maven-plugin from 1.4.0 to 1.8.0 in /core Bumps [org.jreleaser:jreleaser-maven-plugin](https://github.com/jreleaser/jreleaser) from 1.4.0 to 1.8.0. - [Release notes](https://github.com/jreleaser/jreleaser/releases) - [Changelog](https://github.com/jreleaser/jreleaser/blob/main/jreleaser.yml) - [Commits](https://github.com/jreleaser/jreleaser/compare/v1.4.0...v1.8.0) --- updated-dependencies: - dependency-name: org.jreleaser:jreleaser-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..40022d0 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ org.jreleaser jreleaser-maven-plugin - 1.4.0 + 1.8.0 From 0fa05af37ec6982c24b684d97b44c565d8d9a578 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:27:20 +0000 Subject: [PATCH 243/306] Bump org.jreleaser:jreleaser-maven-plugin in /microstream-v5 Bumps [org.jreleaser:jreleaser-maven-plugin](https://github.com/jreleaser/jreleaser) from 1.4.0 to 1.8.0. - [Release notes](https://github.com/jreleaser/jreleaser/releases) - [Changelog](https://github.com/jreleaser/jreleaser/blob/main/jreleaser.yml) - [Commits](https://github.com/jreleaser/jreleaser/compare/v1.4.0...v1.8.0) --- updated-dependencies: - dependency-name: org.jreleaser:jreleaser-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..40022d0 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ org.jreleaser jreleaser-maven-plugin - 1.4.0 + 1.8.0 From 2760bd047943694be5cda9f8e37ba311e5bbd283 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:30:17 +0000 Subject: [PATCH 244/306] Bump org.jreleaser:jreleaser-maven-plugin in /reflection Bumps [org.jreleaser:jreleaser-maven-plugin](https://github.com/jreleaser/jreleaser) from 1.4.0 to 1.8.0. - [Release notes](https://github.com/jreleaser/jreleaser/releases) - [Changelog](https://github.com/jreleaser/jreleaser/blob/main/jreleaser.yml) - [Commits](https://github.com/jreleaser/jreleaser/compare/v1.4.0...v1.8.0) --- updated-dependencies: - dependency-name: org.jreleaser:jreleaser-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..40022d0 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ org.jreleaser jreleaser-maven-plugin - 1.4.0 + 1.8.0 From f58d201e7d50a0faaaeac2d3523d38209c70c3ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:39:20 +0000 Subject: [PATCH 245/306] Bump org.jreleaser:jreleaser-maven-plugin in /examples Bumps [org.jreleaser:jreleaser-maven-plugin](https://github.com/jreleaser/jreleaser) from 1.4.0 to 1.8.0. - [Release notes](https://github.com/jreleaser/jreleaser/releases) - [Changelog](https://github.com/jreleaser/jreleaser/blob/main/jreleaser.yml) - [Commits](https://github.com/jreleaser/jreleaser/compare/v1.4.0...v1.8.0) --- updated-dependencies: - dependency-name: org.jreleaser:jreleaser-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..40022d0 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ org.jreleaser jreleaser-maven-plugin - 1.4.0 + 1.8.0 From 37965926552edfe43a4cc1025675c8600eaa9d3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 12:55:57 +0000 Subject: [PATCH 246/306] Bump org.jreleaser:jreleaser-maven-plugin in /microstream-v6 Bumps [org.jreleaser:jreleaser-maven-plugin](https://github.com/jreleaser/jreleaser) from 1.4.0 to 1.8.0. - [Release notes](https://github.com/jreleaser/jreleaser/releases) - [Changelog](https://github.com/jreleaser/jreleaser/blob/main/jreleaser.yml) - [Commits](https://github.com/jreleaser/jreleaser/compare/v1.4.0...v1.8.0) --- updated-dependencies: - dependency-name: org.jreleaser:jreleaser-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..40022d0 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ org.jreleaser jreleaser-maven-plugin - 1.4.0 + 1.8.0 From b1cdd20df93d546f7941ee572923cbcf8c088e27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:13:22 +0000 Subject: [PATCH 247/306] Bump de.thetaphi:forbiddenapis from 3.4 to 3.6 in /core Bumps [de.thetaphi:forbiddenapis](https://github.com/policeman-tools/forbidden-apis) from 3.4 to 3.6. - [Commits](https://github.com/policeman-tools/forbidden-apis/compare/3.4...3.6) --- updated-dependencies: - dependency-name: de.thetaphi:forbiddenapis dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..94b5d2f 100644 --- a/pom.xml +++ b/pom.xml @@ -264,7 +264,7 @@ de.thetaphi forbiddenapis - 3.4 + 3.6 From 0e19aede40bebd988a735c6c454776f5620b0f2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:21:14 +0000 Subject: [PATCH 248/306] Bump com.mycila:license-maven-plugin from 4.1 to 4.3 in /microstream-v7 Bumps com.mycila:license-maven-plugin from 4.1 to 4.3. --- updated-dependencies: - dependency-name: com.mycila:license-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..077d547 100644 --- a/pom.xml +++ b/pom.xml @@ -346,7 +346,7 @@ com.mycila license-maven-plugin - 4.1 + 4.3 ${project.organization.url} From 85fb6e5e393dbffb7fbf39b69e40880db67bf982 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:35:29 +0000 Subject: [PATCH 249/306] Bump de.thetaphi:forbiddenapis from 3.4 to 3.6 in /reflection Bumps [de.thetaphi:forbiddenapis](https://github.com/policeman-tools/forbidden-apis) from 3.4 to 3.6. - [Commits](https://github.com/policeman-tools/forbidden-apis/compare/3.4...3.6) --- updated-dependencies: - dependency-name: de.thetaphi:forbiddenapis dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..94b5d2f 100644 --- a/pom.xml +++ b/pom.xml @@ -264,7 +264,7 @@ de.thetaphi forbiddenapis - 3.4 + 3.6 From 1d39aba446fa95e2c3907023bdaa6e8ac6078686 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:40:21 +0000 Subject: [PATCH 250/306] Bump de.thetaphi:forbiddenapis from 3.4 to 3.6 in /microstream-v5 Bumps [de.thetaphi:forbiddenapis](https://github.com/policeman-tools/forbidden-apis) from 3.4 to 3.6. - [Commits](https://github.com/policeman-tools/forbidden-apis/compare/3.4...3.6) --- updated-dependencies: - dependency-name: de.thetaphi:forbiddenapis dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..94b5d2f 100644 --- a/pom.xml +++ b/pom.xml @@ -264,7 +264,7 @@ de.thetaphi forbiddenapis - 3.4 + 3.6 From 7e097b59baa4cbba2e82f019e710ec3f3c243cf3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:05:23 +0000 Subject: [PATCH 251/306] Bump de.thetaphi:forbiddenapis from 3.4 to 3.6 in /examples Bumps [de.thetaphi:forbiddenapis](https://github.com/policeman-tools/forbidden-apis) from 3.4 to 3.6. - [Commits](https://github.com/policeman-tools/forbidden-apis/compare/3.4...3.6) --- updated-dependencies: - dependency-name: de.thetaphi:forbiddenapis dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ae0a6c..94b5d2f 100644 --- a/pom.xml +++ b/pom.xml @@ -264,7 +264,7 @@ de.thetaphi forbiddenapis - 3.4 + 3.6 From 9068ee3c999c7fb2368356a9ac86756e29865c1e Mon Sep 17 00:00:00 2001 From: AB Date: Fri, 19 Jan 2024 09:43:03 +0100 Subject: [PATCH 252/306] Rework workflows + secrets --- .github/workflows/checkBuild.yml | 24 ----------------------- .github/workflows/publish-dry-run.yml | 28 +++++++++++++++++++++++++++ .github/workflows/release.yml | 7 +++---- 3 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/publish-dry-run.yml diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index cd32bc6..981cbff 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -57,27 +57,3 @@ jobs: with: name: jars-java-${{ matrix.java }} path: target/*.jar - - publish-dry-run: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Java - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - cache: 'maven' - - name: Publish project - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_SNAPSHOT_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/ - run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy \ No newline at end of file diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml new file mode 100644 index 0000000..37c3172 --- /dev/null +++ b/.github/workflows/publish-dry-run.yml @@ -0,0 +1,28 @@ +name: Publish dry run + +on: + workflow_dispatch: + +jobs: + publish-dry-run: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: 'maven' + - name: Publish project + env: + JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_SNAPSHOT_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/ + run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e2cd58..44a44cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,9 +97,8 @@ jobs: JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} + JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy after_release: runs-on: ubuntu-latest @@ -128,4 +127,4 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} destination_branch: "develop" pr_title: "Sync back" - pr_body: "An automated PR to sync changes back" \ No newline at end of file + pr_body: "An automated PR to sync changes back" From 47ab37b6fd3fb237b4330ff06a062914708c5033 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 12 Feb 2024 08:15:14 +0100 Subject: [PATCH 253/306] EclipseStore support implemented --- CHANGELOG.md | 4 + README.md | 59 +-- SECURITY.md | 26 +- core/pom.xml | 4 +- eclipse-store-v1/pom.xml | 52 +++ .../store/MigrationEmbeddedStorage.java | 106 +++++ .../MigrationEmbeddedStorageManager.java | 50 +++ .../eclipse/store/MigrationManager.java | 73 ++++ .../eclipse/store/MigrationScript.java | 34 ++ .../TunnelingEmbeddedStorageManager.java | 389 ++++++++++++++++++ .../eclipse/store/package-info.java | 19 + ...oduceMigrationOnExistingDatastoreTest.java | 56 +++ .../MigrationScriptAfterScriptTest.java | 199 +++++++++ .../integration/MultipleScriptsTest.java | 90 ++++ ...oreStuffInMigrationStorageManagerTest.java | 74 ++++ .../migrater/ExplicitMigraterTest.java | 88 ++++ .../testUtil/MicroMigrationScriptDummy.java | 42 ++ examples/pom.xml | 4 +- microstream-v5/pom.xml | 4 +- microstream-v6/pom.xml | 4 +- microstream-v7/pom.xml | 4 +- microstream-v8/pom.xml | 4 +- pom.xml | 3 +- reflection/README.md | 4 +- reflection/pom.xml | 4 +- .../migrater/ReflectiveMigrater.java | 2 +- 26 files changed, 1342 insertions(+), 56 deletions(-) create mode 100644 eclipse-store-v1/pom.xml create mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorage.java create mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorageManager.java create mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationManager.java create mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationScript.java create mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/TunnelingEmbeddedStorageManager.java create mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/package-info.java create mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java create mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java create mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java create mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java create mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java create mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java diff --git a/CHANGELOG.md b/CHANGELOG.md index f0aafab..5d04927 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.0 +* Added support for EclipseStore v1 +* Updated plenty of libraries + ## 0.0.9 * Added support for MicroStream v8 diff --git a/README.md b/README.md index b175a45..846f615 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ # XDEV MicroMigration Logo -Tiny java library to migrate MicroStream datastores. +Tiny java library to migrate MicroStream and EclipseStore datastores. Applies migration scripts on the datastores to keep them up to date. ## Intro @@ -13,12 +13,12 @@ When you think about default database setup, you probably imagine something like ![Imaginative system layout](./docs/MigrationSequence_1.png "Imaginative system layout") -Yet in reality most workflows involve different systems like test systems and prodution systems. +Yet in reality most workflows involve different systems like test systems and production systems. In code this workflow is represented with version-control systems and different branches. ![Code workflow](./docs/MigrationSequence_2.png "Code workflow") -For this code workflow to behave correctly, for each system a seperate datastore is needed. +For this code workflow to behave correctly, for each system a separate datastore is needed. To keep these datastores to represent the correspondend data for the code is a hassle. ![Code workflow with datastore](./docs/MigrationSequence_3.png "Code workflow with datastore") @@ -27,9 +27,9 @@ That's why migration frameworks like [Flyway](https://flywaydb.org) and [Liquiba Unfortunately both these frameworks are designed to support any type of SQL databases but no NoSQL databases like [MicroStream](https://microstream.one/). This led to the creation of this library. -This library delivers an easy concept to keep your MicroStream datastore versioned +This library delivers an easy concept to keep your MicroStream / EclipseStore datastore versioned with migration scripts written in plain java. -It's easy to create code, that automatically brings an datastore with an older version to +It's easy to create code, that automatically brings a datastore with an older version to the version, suited to the current code. ![Migrate datastore to new version](./docs/MigrationSequence_4.png "Migrate datastore to new version") @@ -44,8 +44,8 @@ Simply add the dependency to your `pom.xml`: software.xdev - micro-migration-microstream-v8 - 0.0.9 + micro-migration-eclipse-store-v1 + 1.0.0 ``` @@ -53,7 +53,7 @@ Simply add the dependency to your `pom.xml`: There are two possible usages with the Micro migration library: The **first**, easier approach is to use the `MigrationEmbeddedStorageManager`. -It can be used on a brand new datastore or introduced later, after a MicroStream datastore is already in use. +It can be used on a brand new datastore or introduced later, after a MicroStream/EclipseStore datastore is already in use. Only the storage manager (`MigrationEmbeddedStorageManager`) knows about the versioning. The rest of application does not know about the version and can have no regards about it. @@ -137,38 +137,43 @@ To use this, you need to add the following dependency to your `pom.xml`: software.xdev micro-migration-reflection - 0.0.9 + 1.0.0 ``` -## Supported MicroStream versions +## Supported MicroStream / EclipseStore versions + +Micro migration currently supports the following MicroStream / EclipseStore versions: -Micro migration currently supports the following MicroStream versions: | MicroStream Version | Micro migration artifact Id | | --- | --- | -| [05.00.02-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | micro-migration-microstream-v5 | -| [06.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | micro-migration-microstream-v6 | -| [07.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | micro-migration-microstream-v7 | -| [08.01.01-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/08.01.01-MS-GA) | micro-migration-microstream-v8 | +| [05.00.02-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | micro-migration-microstream-v5 | +| [06.01.00-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | micro-migration-microstream-v6 | +| [07.01.00-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | micro-migration-microstream-v7 | +| [08.01.01-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/08.01.01-MS-GA) | micro-migration-microstream-v8 | + +| EclipseStore Version | Micro migration artifact Id | +|------------------------------------------------------------------------------------------------------------|----------------------------------| +| [1.1.0](https://central.sonatype.com/artifact/org.eclipse.store/storage/1.1.0) | micro-migration-eclipse-store-v1 | If you are using a different, not listed version of MicroStream, this shouldn't be a problem. Usually you can simply use the closest Micro migration version (f.e. you are using MicroStream `08.00.00-MS-GA`, then use `micro-migration-microstream-v8`) and exclude the dependent version of MicroStream vom Micro migration: ```xml - software.xdev - micro-migration-microstream-v8 - 0.0.9 + software.xdev + micro-migration-eclipse-store-v1 + 1.0.0 - - one.microstream - microstream-storage-embedded - - - one.microstream - microstream-configuration - - + + org.eclipse.store + storage-embedded + + + org.eclipse.store + storage-embedded-configuration + + ``` Since there is rarely a breaking change, this works 90% of times. diff --git a/SECURITY.md b/SECURITY.md index 811f773..4bd09db 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,19 +2,23 @@ ## Supported Versions -| Version | Supported | -| ------- | ------------------ | -| < 0.0.6 | :x: | -| > 0.0.6 | :white_check_mark: | +| Version | Supported | +|-----------| ------------------ | +| < 1.0.0 | :x: | +| \>= 1.0.0 | :white_check_mark: | -## Supported MicroStream versions -Micro migration currently supports the following MicroStream versions: -| MicroStream Version | Micro migration artifact Id | +Micro migration currently supports the following MicroStream / EclipseStore versions: + +| MicroStream Version | Micro migration artifact Id | | --- | --- | -| [05.00.02-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | micro-migration-microstream-v5 | -| [06.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | micro-migration-microstream-v6 | -| [07.01.00-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | micro-migration-microstream-v7 | -| [08.01.01-MS-GA](https://central.sonatype.dev/artifact/one.microstream/microstream-storage/08.01.01-MS-GA) | micro-migration-microstream-v8 | +| [05.00.02-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/05.00.02-MS-GA) | micro-migration-microstream-v5 | +| [06.01.00-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/06.01.00-MS-GA) | micro-migration-microstream-v6 | +| [07.01.00-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/07.01.00-MS-GA) | micro-migration-microstream-v7 | +| [08.01.01-MS-GA](https://central.sonatype.com/artifact/one.microstream/microstream-storage/08.01.01-MS-GA) | micro-migration-microstream-v8 | + +| EclipseStore Version | Micro migration artifact Id | +|------------------------------------------------------------------------------------------------------------|----------------------------------| +| [1.1.0](https://central.sonatype.com/artifact/org.eclipse.store/storage/1.1.0) | micro-migration-eclipse-store-v1 | ## Reporting a Vulnerability diff --git a/core/pom.xml b/core/pom.xml index 4dd8d73..75c4da3 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-core - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream software.xdev micro-migration - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT diff --git a/eclipse-store-v1/pom.xml b/eclipse-store-v1/pom.xml new file mode 100644 index 0000000..5c617ca --- /dev/null +++ b/eclipse-store-v1/pom.xml @@ -0,0 +1,52 @@ + + 4.0.0 + software.xdev + micro-migration-eclipse-store-v1 + 1.0.0-SNAPSHOT + MicroMigration-for-EclipseStoreV1 + Provides the micro migration support for EclipseStore version 1 + + + 1.1.0 + + + + software.xdev + micro-migration + 1.0.0-SNAPSHOT + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + UTF-8 + + + + + + + + software.xdev + micro-migration-core + ${project.version} + + + org.eclipse.store + storage-embedded + ${org.eclipse.store.version} + + + org.eclipse.store + storage-embedded-configuration + ${org.eclipse.store.version} + + + diff --git a/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorage.java b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorage.java new file mode 100644 index 0000000..7c805ca --- /dev/null +++ b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorage.java @@ -0,0 +1,106 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.eclipse.store; + +import java.nio.file.Path; +import java.util.Objects; + +import org.eclipse.store.afs.nio.types.NioFileSystem; +import org.eclipse.store.storage.embedded.types.EmbeddedStorage; +import org.eclipse.store.storage.embedded.types.EmbeddedStorageFoundation; +import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; +import org.eclipse.store.storage.types.Storage; +import org.eclipse.store.storage.types.StorageConfiguration; + +import software.xdev.micromigration.migrater.MicroMigrater; + +/** + * Provides static utility calls to create the {@link MigrationEmbeddedStorageManager} for + * updateable datastores. Basically a wrapper for the utility class {@link EmbeddedStorage}. + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorage +{ + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

      Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + public static final MigrationEmbeddedStorageManager start(final MicroMigrater migrater) + { + Objects.requireNonNull(migrater); + return new MigrationEmbeddedStorageManager( + createStorageManager(), + migrater + ).start(); + } + + /** + * Creates a {@link MigrationEmbeddedStorageManager} with the given {@link MicroMigrater}. + * Uses the MicroStream {@link EmbeddedStorageFoundation#New()} configuration for the actual + * {@link EmbeddedStorageManager}. + *

      Warning "resource" is suppressed because it is used and closed in the {@link MigrationEmbeddedStorageManager}. + * + * @param storageDirectory is used as the base directory for the datastore + * @param migrater which is used as source for the migration scripts + * @return the created storage manager with the given migrater + */ + @SuppressWarnings("resource") + public static final MigrationEmbeddedStorageManager start( + final Path storageDirectory, + final MicroMigrater migrater + ) + { + Objects.requireNonNull(migrater); + Objects.requireNonNull(storageDirectory); + + return new MigrationEmbeddedStorageManager( + createStorageManager(storageDirectory), + migrater + ).start(); + } + + private static EmbeddedStorageManager createStorageManager(final Path storageDirectory) + { + final NioFileSystem fileSystem = NioFileSystem.New(); + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder() + .setStorageFileProvider( + Storage.FileProviderBuilder(fileSystem) + .setDirectory(fileSystem.ensureDirectoryPath(storageDirectory.toAbsolutePath().toString())) + .createFileProvider() + ) + .createConfiguration() + ) + .createEmbeddedStorageManager(); + } + + private static EmbeddedStorageManager createStorageManager() + { + return EmbeddedStorageFoundation.New() + .setConfiguration( + StorageConfiguration.Builder().createConfiguration() + ) + .createEmbeddedStorageManager(); + } +} diff --git a/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorageManager.java b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorageManager.java new file mode 100644 index 0000000..62af29c --- /dev/null +++ b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationEmbeddedStorageManager.java @@ -0,0 +1,50 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.eclipse.store; + +import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.version.Versioned; + +/** + * Specific implementation of the {@link VersionAgnosticMigrationEmbeddedStorageManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationEmbeddedStorageManager + * + * @author Johannes Rabauer + * + */ +public class MigrationEmbeddedStorageManager + extends VersionAgnosticMigrationEmbeddedStorageManager +{ + /** + * @param nativeManager which will be used as the underlying storage manager. + * Almost all methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + * @param migrater which is used as source for the migration scripts + */ + public MigrationEmbeddedStorageManager( + final EmbeddedStorageManager nativeManager, + final MicroMigrater migrater + ) + { + super(new TunnelingEmbeddedStorageManager(nativeManager), migrater); + } +} diff --git a/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationManager.java b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationManager.java new file mode 100644 index 0000000..692221b --- /dev/null +++ b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationManager.java @@ -0,0 +1,73 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.eclipse.store; + +import java.util.function.Consumer; +import java.util.function.Supplier; + +import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticMigrationManager; +import software.xdev.micromigration.migrater.MicroMigrater; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; + +/** + * Specific implementation of the {@link VersionAgnosticMigrationManager} for one + * specific MicroStream version. + * + * @see VersionAgnosticMigrationManager + */ +public class MigrationManager extends VersionAgnosticMigrationManager +{ + /** + * Much more complicated constructor than {@link MigrationManager(Versioned, MicroMigrater, EmbeddedStorageManager)}. + * + * @param currentVersionGetter which supplies the current version of the object to update. + * @param currentVersionSetter which sets the new version of the object in some membervariable. This Consumer is not supposed to store the version, but only save it in some membervariable to be stored after. + * @param currentVersionStorer which is supposed to store the new version of the object somewhere in the datastore. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManager( + final Supplier currentVersionGetter, + final Consumer currentVersionSetter, + final Consumer currentVersionStorer, + final MicroMigrater migrater, + final EmbeddedStorageManager storageManager + ) + { + super(currentVersionGetter, currentVersionSetter, currentVersionStorer, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } + + /** + * Simple Constructor. + * + * @param versionedObject which provides getter and setter for the current version. + * This object will be stored after the {@link VersionAgnosticMigrationScript}s are executed. + * @param migrater does the actual migration with the given {@link VersionAgnosticMigrationScript} + * @param storageManager for the {@link VersionAgnosticMigrationScript}s to use. Is not used for the storing of the new version. + */ + public MigrationManager( + final Versioned versionedObject, + final MicroMigrater migrater , + final EmbeddedStorageManager storageManager + ) + { + super(versionedObject, migrater, new MigrationEmbeddedStorageManager(storageManager, migrater)); + } +} diff --git a/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationScript.java b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationScript.java new file mode 100644 index 0000000..7e09f59 --- /dev/null +++ b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationScript.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.eclipse.store; + +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; + +/** + * Interface for scripts to migrate / update datastores. + *

      + * One script is supposed to bring a datastore from a lower version to the target version. + * After the {@link VersionAgnosticMigrationScript#migrate(Context)} method is called, + * the target version is reached. + *

      + * This is a shorthand for {@link VersionAgnosticMigrationScript} for this specific MicroStream version. + * + * @author Johannes Rabauer + * + */ +public interface MigrationScript extends VersionAgnosticMigrationScript +{} diff --git a/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/TunnelingEmbeddedStorageManager.java b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/TunnelingEmbeddedStorageManager.java new file mode 100644 index 0000000..f55ede2 --- /dev/null +++ b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/TunnelingEmbeddedStorageManager.java @@ -0,0 +1,389 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.eclipse.store; + +import java.nio.ByteBuffer; +import java.util.Objects; +import java.util.function.Predicate; + +import org.eclipse.serializer.afs.types.AFile; +import org.eclipse.serializer.collections.types.XGettingEnum; +import org.eclipse.serializer.persistence.binary.types.Binary; +import org.eclipse.serializer.persistence.types.PersistenceManager; +import org.eclipse.serializer.persistence.types.PersistenceRootsView; +import org.eclipse.serializer.persistence.types.PersistenceTypeDictionaryExporter; +import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; +import org.eclipse.store.storage.exceptions.StorageException; +import org.eclipse.store.storage.types.Database; +import org.eclipse.store.storage.types.StorageConfiguration; +import org.eclipse.store.storage.types.StorageConnection; +import org.eclipse.store.storage.types.StorageEntityCacheEvaluator; +import org.eclipse.store.storage.types.StorageEntityTypeExportFileProvider; +import org.eclipse.store.storage.types.StorageEntityTypeExportStatistics; +import org.eclipse.store.storage.types.StorageEntityTypeHandler; +import org.eclipse.store.storage.types.StorageLiveFileProvider; +import org.eclipse.store.storage.types.StorageRawFileStatistics; +import org.eclipse.store.storage.types.StorageTypeDictionary; + +import software.xdev.micromigration.microstream.versionagnostic.VersionAgnosticTunnelingEmbeddedStorageManager; +import software.xdev.micromigration.version.Versioned; + +/** + * Wrapper class for the MicroStream {@code one.microstream.storage.embedded.types.EmbeddedStorageManager} interface. + *

      + * It simply relays all the commands to the contained {@link EmbeddedStorageManager}. + * + * @see VersionAgnosticTunnelingEmbeddedStorageManager + * + * @author Johannes Rabauer + * + */ +public class TunnelingEmbeddedStorageManager + implements + EmbeddedStorageManager, + VersionAgnosticTunnelingEmbeddedStorageManager +{ + /** + * The underlying, actual MicroStream EmbeddedStorageManager + */ + protected final EmbeddedStorageManager nativeManager; + + /** + * @param nativeManager which will be used as the underlying storage manager. + * All methods are only rerouted to this native manager. + * Only {@link #start()}, {@link #root()} and {@link #setRoot(Object)} are intercepted + * and a {@link Versioned} is placed between the requests. + */ + public TunnelingEmbeddedStorageManager( + final EmbeddedStorageManager nativeManager + ) + { + Objects.requireNonNull(nativeManager); + this.nativeManager = nativeManager; + } + + //////////////////////////////////////////////////////////////// + // Simply forward all the methods + //////////////////////////////////////////////////////////////// + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#start} + */ + @Override + public TunnelingEmbeddedStorageManager start() + { + this.nativeManager.start(); + return this; + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#root} + */ + @Override + public Object root() { + return this.nativeManager.root(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#setRoot(Object)} + */ + @Override + public Object setRoot(final Object newRoot) { + return this.nativeManager.setRoot(newRoot); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#storeRoot()} + */ + @Override + public long storeRoot() { + return this.nativeManager.storeRoot(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#configuration()} + */ + @Override + public StorageConfiguration configuration() + { + return this.nativeManager.configuration(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#typeDictionary()} + */ + @Override + public StorageTypeDictionary typeDictionary() + { + return this.nativeManager.typeDictionary(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#shutdown()} + */ + @Override + public boolean shutdown() + { + return this.nativeManager.shutdown(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#close()} + */ + @Override + public void close() throws StorageException + { + this.nativeManager.close(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createConnection()} + */ + @Override + public StorageConnection createConnection() + { + return this.nativeManager.createConnection(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#viewRoots()} + */ + @Override + public PersistenceRootsView viewRoots() + { + return this.nativeManager.viewRoots(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#database()} + */ + @Override + public Database database() + { + return this.nativeManager.database(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isAcceptingTasks()} + */ + @Override + public boolean isAcceptingTasks() + { + return this.nativeManager.isAcceptingTasks(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isRunning()} + */ + @Override + public boolean isRunning() + { + return this.nativeManager.isRunning(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isStartingUp()} + */ + @Override + public boolean isStartingUp() + { + return this.nativeManager.isStartingUp(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isShuttingDown()} + */ + @Override + public boolean isShuttingDown() + { + return this.nativeManager.isShuttingDown(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#checkAcceptingTasks()} + */ + @Override + public void checkAcceptingTasks() + { + this.nativeManager.checkAcceptingTasks(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#initializationTime()} + */ + @Override + public long initializationTime() + { + return this.nativeManager.initializationTime(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#operationModeTime()} + */ + @Override + public long operationModeTime() + { + return this.nativeManager.operationModeTime(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#isActive()} + */ + @Override + public boolean isActive() + { + return this.nativeManager.isActive(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueGarbageCollection(long)} + */ + @Override + public boolean issueGarbageCollection(final long nanoTimeBudget) + { + return this.nativeManager.issueGarbageCollection(nanoTimeBudget); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFileCheck(long)} + */ + @Override + public boolean issueFileCheck(final long nanoTimeBudget) + { + return this.nativeManager.issueFileCheck(nanoTimeBudget); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueCacheCheck(long, StorageEntityCacheEvaluator)} + */ + @Override + public boolean issueCacheCheck(final long nanoTimeBudget, final StorageEntityCacheEvaluator entityEvaluator) + { + return this.nativeManager.issueCacheCheck(nanoTimeBudget, entityEvaluator); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#createStorageStatistics} + */ + @Override + public StorageRawFileStatistics createStorageStatistics() + { + return this.nativeManager.createStorageStatistics(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportChannels(StorageLiveFileProvider)} + */ + @Override + public void exportChannels(final StorageLiveFileProvider fileProvider, final boolean performGarbageCollection) + { + this.nativeManager.exportChannels(fileProvider, performGarbageCollection); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#exportTypes(StorageEntityTypeExportFileProvider)} + */ + @Override + public StorageEntityTypeExportStatistics exportTypes( + final StorageEntityTypeExportFileProvider exportFileProvider, + final Predicate isExportType) + { + return this.nativeManager.exportTypes(exportFileProvider, isExportType); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#importFiles(XGettingEnum)} + */ + @Override + public void importFiles(final XGettingEnum importFiles) + { + this.nativeManager.importFiles(importFiles); + } + + @Override + public void importData(final XGettingEnum xGettingEnum) + { + this.nativeManager.importData(xGettingEnum); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#persistenceManager()} + */ + @Override + public PersistenceManager persistenceManager() + { + return this.nativeManager.persistenceManager(); + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#store(Object)} + */ + @Override + public long store(final Object instance) + { + return EmbeddedStorageManager.super.store(instance); + } + + @Override public EmbeddedStorageManager getNativeStorageManager() + { + return this.nativeManager; + } + + /** + * Simply tunneling the call through to the {@link EmbeddedStorageManager} given through the constructor. + * Please see {@link EmbeddedStorageManager#issueFullBackup(StorageLiveFileProvider, PersistenceTypeDictionaryExporter)} + */ + @Override + public void issueFullBackup( + final StorageLiveFileProvider targetFileProvider, + final PersistenceTypeDictionaryExporter typeDictionaryExporter) { + this.nativeManager.issueFullBackup(targetFileProvider, typeDictionaryExporter); + } + + @Override + public void issueTransactionsLogCleanup() + { + this.nativeManager.issueTransactionsLogCleanup(); + } +} diff --git a/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/package-info.java b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/package-info.java new file mode 100644 index 0000000..82c7e38 --- /dev/null +++ b/eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Provides classes to use micro migration for MicroStream v7 + */ + diff --git a/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java new file mode 100644 index 0000000..5bda109 --- /dev/null +++ b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java @@ -0,0 +1,56 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.nio.file.Path; + +import org.eclipse.store.storage.embedded.types.EmbeddedStorage; +import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; + +class IntroduceMigrationOnExistingDatastoreTest +{ + final static String ROOT = "OriginalRoot"; + + @Test + void testIntroducingMigrationOnExistingDatastore_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) throws IOException + { + try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start(storageFolder)) + { + storageManager.setRoot(ROOT); + storageManager.storeRoot(); + } + + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(ROOT, migrationStorageManager.root()); + assertEquals(1, migrationStorageManager.getCurrentVersion().getVersions()[0]); + } + } +} diff --git a/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java new file mode 100644 index 0000000..fe0d871 --- /dev/null +++ b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java @@ -0,0 +1,199 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.eclipse.serializer.persistence.types.Storer; +import org.eclipse.store.storage.embedded.types.EmbeddedStorage; +import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; +import software.xdev.micromigration.version.Versioned; +import software.xdev.micromigration.version.VersionedObject; + +class MigrationScriptAfterScriptTest +{ + @Test + void testMigrationWithThreeDifferenMigrater_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) throws IOException + { + //First run without any migration script + final ExplicitMigrater firstMigrater = new ExplicitMigrater(); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, firstMigrater)) + { + migrationStorageManager.setRoot(0); + migrationStorageManager.storeRoot(); + assertEquals(0, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(0), migrationStorageManager.getCurrentVersion()); + } + + + //Run with one migration script + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater secondMigrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, secondMigrater)) + { + assertEquals(1, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(1), migrationStorageManager.getCurrentVersion()); + } + + + //Run with two migration scripts + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater thirdMigrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + thirdMigrater)) + { + assertEquals(2, migrationStorageManager.root()); + Assertions.assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationAndUseStorer(@TempDir final Path storageFolder) throws IOException + { + final List firstList = new ArrayList<>(); + // Run with one migration script + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> + { + context.getStorageManager().setRoot(firstList); + firstList.add("1"); + final Storer storer = context.getStorageManager().getNativeStorageManager().createStorer(); + storer.store(firstList); + storer.commit(); + } + ); + + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start( + storageFolder, + migrater)) + { + assertEquals(1, ((List)migrationStorageManager.root()).size()); + } + } + + @Test + void testMigrationWithScriptExecutionNotification(@TempDir final Path storageFolder) throws IOException + { + final VersionAgnosticMigrationScript firstScript = + new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript); + final AtomicBoolean notificationReceived = new AtomicBoolean(false); + migrater.registerNotificationConsumer( + notification -> + { + Assertions.assertEquals(firstScript, notification.getExecutedScript()); + Assertions.assertEquals(new MigrationVersion(0), notification.getSourceVersion()); + Assertions.assertEquals(new MigrationVersion(1), notification.getTargetVersion()); + notificationReceived.set(true); + } + ); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertTrue(notificationReceived.get()); + } + } + + @Test + void testMigrationWithThreeDifferenMigrater_StandaloneMicroMigrationManager(@TempDir final Path storageFolder) throws IOException + { + //First run without any migration script + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) + { + final VersionedObject firstRoot = new VersionedObject<>(0); + storageManager.setRoot(firstRoot); + storageManager.storeRoot(); + assertEquals(Integer.valueOf(0), firstRoot.getObject()); + assertEquals(new MigrationVersion(0), firstRoot.getVersion()); + } + + + //Run with one migration script + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getMigratingObject().setObject(1) + ); + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManager( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(1), currentRoot.getObject()); + assertEquals(new MigrationVersion(1), currentRoot.getVersion()); + } + + + //Run with two migration scripts + final VersionAgnosticMigrationScript, MigrationEmbeddedStorageManager> secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getMigratingObject().setObject(2) + ); + try(final EmbeddedStorageManager storageManager = this.startEmbeddedStorageManagerWithPath(storageFolder)) + { + new MigrationManager( + (Versioned) storageManager.root(), + new ExplicitMigrater(firstScript, secondScript), + storageManager + ) + .migrate(storageManager.root()); + @SuppressWarnings("unchecked") + final VersionedObject currentRoot = (VersionedObject)storageManager.root(); + assertEquals(Integer.valueOf(2), currentRoot.getObject()); + assertEquals(new MigrationVersion(2), currentRoot.getVersion()); + } + } + + private EmbeddedStorageManager startEmbeddedStorageManagerWithPath(final Path storageFolder) + { + return EmbeddedStorage.start(storageFolder); + } + +} diff --git a/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java new file mode 100644 index 0000000..1eb21db --- /dev/null +++ b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java @@ -0,0 +1,90 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.migrater.VersionAlreadyRegisteredException; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +class MultipleScriptsTest +{ + @Test + void testMigrationWithTwoScriptsAtOnce_MigrationEmbeddedStorageManager(@TempDir final Path storageFolder) + { + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final ExplicitMigrater migrater = new ExplicitMigrater(firstScript, secondScript); + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + assertEquals(2, migrationStorageManager.root()); + assertEquals(new MigrationVersion(2), migrationStorageManager.getCurrentVersion()); + } + } + + @Test + void testMigrationWithTwoScriptsWithSameVersion(@TempDir final Path storageFolder) + { + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(2) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript) + ); + } + + @Test + void testMigrationWithThreeScriptsWithSameVersion(@TempDir final Path storageFolder) + { + final VersionAgnosticMigrationScript firstScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(1) + ); + final VersionAgnosticMigrationScript secondScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(2), + (context) -> context.getStorageManager().setRoot(2) + ); + final VersionAgnosticMigrationScript thirdScript = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> context.getStorageManager().setRoot(3) + ); + Assertions.assertThrows(VersionAlreadyRegisteredException.class, () -> + new ExplicitMigrater(firstScript, secondScript, thirdScript) + ); + } +} diff --git a/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java new file mode 100644 index 0000000..f00d94a --- /dev/null +++ b/eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java @@ -0,0 +1,74 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.integration; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.IOException; +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.migrater.ExplicitMigrater; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +class StoreStuffInMigrationStorageManagerTest +{ + private static class RootClass + { + private final ChildClass child = new ChildClass(); + } + + private static class ChildClass + { + private int i = 0; + } + + @Test + void testStoringSomethingAfterUpdating(@TempDir final Path storageFolder) throws IOException + { + final VersionAgnosticMigrationScript script = new SimpleTypedMigrationScript<>( + new MigrationVersion(1), + (context) -> {} + ); + final ExplicitMigrater migrater = new ExplicitMigrater(script); + //Create new store and change stored object + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + migrationStorageManager.setRoot(new RootClass()); + migrationStorageManager.storeRoot(); + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertEquals(0, storedRoot.child.i); + ((RootClass)migrationStorageManager.root()).child.i = 1; + migrationStorageManager.store(storedRoot.child); + assertEquals(1, storedRoot.child.i); + } + //Check if stored object is correct + try(final MigrationEmbeddedStorageManager migrationStorageManager = MigrationEmbeddedStorage.start(storageFolder, migrater)) + { + final RootClass storedRoot = ((RootClass)migrationStorageManager.root()); + assertNotNull(storedRoot); + assertEquals(1, storedRoot.child.i); + } + } + +} diff --git a/eclipse-store-v1/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java b/eclipse-store-v1/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java new file mode 100644 index 0000000..3b16c30 --- /dev/null +++ b/eclipse-store-v1/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java @@ -0,0 +1,88 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.migrater; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.scripts.SimpleTypedMigrationScript; +import software.xdev.micromigration.testUtil.MicroMigrationScriptDummy; +import software.xdev.micromigration.version.MigrationVersion; + +class ExplicitMigraterTest +{ + + @Test + void testGetSortedScripts_empty() + { + final ExplicitMigrater migrater = new ExplicitMigrater(); + assertEquals(0,migrater.getSortedScripts().size()); + } + + @Test + void testGetSortedScripts_sorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(1)), + new MicroMigrationScriptDummy(new MigrationVersion(2)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testGetSortedScripts_unsorted() + { + final ExplicitMigrater migrater = new ExplicitMigrater( + new MicroMigrationScriptDummy(new MigrationVersion(2)), + new MicroMigrationScriptDummy(new MigrationVersion(1)) + ); + assertEquals(1, migrater.getSortedScripts().first().getTargetVersion().getVersions()[0]); + assertEquals(2, migrater.getSortedScripts().last().getTargetVersion().getVersions()[0]); + } + + @Test + void testWrongTypedVersionedScript(@TempDir final Path storageFolder) + { + try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(storageFolder, new ExplicitMigrater())) + { + storageManager.setRoot("SomeString"); + storageManager.storeRoot(); + } + final ExplicitMigrater migrater = new ExplicitMigrater( + new SimpleTypedMigrationScript( + new MigrationVersion(1), + (context) -> { + context.getStorageManager().setRoot(context.getMigratingObject() + 1); + } + ) + ); + Assertions.assertThrows(ClassCastException.class, () -> + { + MigrationEmbeddedStorage.start(storageFolder, migrater); + } + ); + + } + +} diff --git a/eclipse-store-v1/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java b/eclipse-store-v1/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java new file mode 100644 index 0000000..7a82664 --- /dev/null +++ b/eclipse-store-v1/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java @@ -0,0 +1,42 @@ +/* + * Copyright © 2021 XDEV Software GmbH (https://xdev.software) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package software.xdev.micromigration.testUtil; + +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.scripts.Context; +import software.xdev.micromigration.scripts.VersionAgnosticMigrationScript; +import software.xdev.micromigration.version.MigrationVersion; + +public class MicroMigrationScriptDummy implements VersionAgnosticMigrationScript +{ + private final MigrationVersion version; + + public MicroMigrationScriptDummy(final MigrationVersion version) + { + this.version = version; + } + + @Override + public MigrationVersion getTargetVersion() + { + return this.version; + } + + @Override + public void migrate(final Context context) { + // Don't do anything. + } +} diff --git a/examples/pom.xml b/examples/pom.xml index 2f30f61..5e65f82 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,13 +4,13 @@ 4.0.0 software.xdev micro-migration-examples - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT MicroMigration-Examples Examples for the MicroMigration-Library with MicroStream v7 software.xdev - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 7c1f488..3cb1a7c 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 6b44d28..999b6ea 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 6b4b018..5e6c385 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT diff --git a/microstream-v8/pom.xml b/microstream-v8/pom.xml index fd5a028..c9b67c1 100644 --- a/microstream-v8/pom.xml +++ b/microstream-v8/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v8 - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV8 Provides the micro migration support for MicroStream version 8 @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index 32d9d1b..d16f74f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT software.xdev micro-migration MicroMigration @@ -59,6 +59,7 @@ microstream-v6 microstream-v7 microstream-v8 + eclipse-store-v1 diff --git a/reflection/README.md b/reflection/README.md index c2ad3b8..eb3d6ef 100644 --- a/reflection/README.md +++ b/reflection/README.md @@ -16,6 +16,6 @@ Simply add the dependency to your `pom.xml`: software.xdev micro-migration-reflection - 0.0.2 + 1.0.0 -``` \ No newline at end of file +``` diff --git a/reflection/pom.xml b/reflection/pom.xml index fa05f55..58448ae 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection @@ -15,7 +15,7 @@ software.xdev micro-migration - 0.0.10-SNAPSHOT + 1.0.0-SNAPSHOT diff --git a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java index 1b86713..db60fc7 100644 --- a/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java +++ b/reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java @@ -60,7 +60,7 @@ public ReflectiveMigrater(final String packagePath) throws ScriptInstantiationEx for(final Class scriptClass : reflections.getSubTypesOf( VersionAgnosticMigrationScript.class)) { - // Only instanciate non abstract classes + // Only instanciate non-abstract classes if(!Modifier.isAbstract(scriptClass.getModifiers())) { final VersionAgnosticMigrationScript instanciatedScript = this.instanciateClass(scriptClass); From 2396718a3df7ed0d78886580d3204776b67c4571 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 12 Feb 2024 08:29:03 +0100 Subject: [PATCH 254/306] Updated example to eclipse store --- examples/pom.xml | 2 +- .../examples/explicit/MainExplicit.java | 16 +++++----- .../explicit/scripts/UpdateToV1_0.java | 10 +++--- .../explicit/scripts/UpdateToV1_1.java | 8 ++--- .../notification/MainNotification.java | 19 ++++++------ ...alWithMigrationEmbeddedStorageManager.java | 19 +++++------- .../practical/embedded/UpdateToV1_0.java | 22 +++++++------ .../practical/embedded/UpdateToV2_0.java | 8 ++--- .../MainPracticalWithMigrationManager.java | 31 ++++++++++--------- .../migrationManager/UpdateToV1_0.java | 18 +++++------ .../migrationManager/UpdateToV2_0.java | 8 ++--- .../examples/reflective/MainReflective.java | 4 +-- .../reflective/scripts/UpdateToV1_0.java | 8 ++--- .../reflective/scripts/UpdateToV1_1.java | 8 ++--- 14 files changed, 91 insertions(+), 90 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index 5e65f82..67b9b8c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -17,7 +17,7 @@ software.xdev - micro-migration-microstream-v8 + micro-migration-eclipse-store-v1 ${project.version} diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java index 697e7fa..c4811f9 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java @@ -18,28 +18,26 @@ import java.util.Date; import java.util.logging.Logger; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_0; import software.xdev.micromigration.examples.explicit.scripts.UpdateToV1_1; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.migrater.ExplicitMigrater; /** - * The most basic usage of micro migration. - * Here two {@link MigrationScript}s are explicitly registered - * and subsequently executed. Easy. + * The most basic usage of micro migration. Here two {@link MigrationScript}s are explicitly registered and subsequently + * executed. Easy. * * @author Johannes Rabauer - * */ public class MainExplicit { public static void main(final String[] args) { final ExplicitMigrater migrater = new ExplicitMigrater( - new UpdateToV1_0(), - new UpdateToV1_1() + new UpdateToV1_0(), + new UpdateToV1_1() ); final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); Logger.getGlobal().info(storageManager.root().toString()); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java index 6f8f0b3..9dba467 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java @@ -18,19 +18,19 @@ import java.util.Date; import java.util.logging.Logger; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; public class UpdateToV1_0 implements MigrationScript { @Override - public MigrationVersion getTargetVersion() + public MigrationVersion getTargetVersion() { - return new MigrationVersion(1,0); + return new MigrationVersion(1, 0); } - + @Override public void migrate(final Context context) { diff --git a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java index 3ef3428..6e0ff6b 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java @@ -18,17 +18,17 @@ import java.util.Date; import java.util.logging.Logger; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; public class UpdateToV1_1 implements MigrationScript { @Override - public MigrationVersion getTargetVersion() + public MigrationVersion getTargetVersion() { - return new MigrationVersion(1,1); + return new MigrationVersion(1, 1); } @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java index 070e38b..4bc1288 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java @@ -18,15 +18,14 @@ import java.util.Date; import java.util.logging.Logger; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; /** - * Shows the basic registration of migration notifications - * ({@link ScriptExecutionNotification}). + * Shows the basic registration of migration notifications ({@link ScriptExecutionNotification}). * * @author Johannes Rabauer */ @@ -35,10 +34,12 @@ public class MainNotification public static void main(final String[] args) { final ExplicitMigrater migrater = new ExplicitMigrater( - new MainNotification.UpdateToV1_0() + new MainNotification.UpdateToV1_0() ); migrater.registerNotificationConsumer( - scriptExecutionNotification -> Logger.getGlobal().info("Script " + scriptExecutionNotification.getExecutedScript().getClass().getSimpleName() + " executed.") + scriptExecutionNotification -> Logger.getGlobal() + .info("Script " + scriptExecutionNotification.getExecutedScript().getClass().getSimpleName() + + " executed.") ); final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migrater); Logger.getGlobal().info(storageManager.root().toString()); @@ -49,16 +50,16 @@ public static void main(final String[] args) storageManager.storeRoot(); storageManager.shutdown(); } - + static class UpdateToV1_0 implements software.xdev.micromigration.scripts.VersionAgnosticMigrationScript { @Override public MigrationVersion getTargetVersion() { - return new MigrationVersion(1,0); + return new MigrationVersion(1, 0); } - + @Override public void migrate(final Context context) { diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java index 02d05f6..243b140 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java @@ -17,9 +17,9 @@ import java.util.logging.Logger; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ExplicitMigrater; /** @@ -31,14 +31,14 @@ *

    • v2.0: A new customer is added through the {@link UpdateToV2_0} script. *
    * The storage is restarted after every update to simulate a complete lifecycle of the datastore. - * @author Johannes Rabauer * + * @author Johannes Rabauer */ public class MainPracticalWithMigrationEmbeddedStorageManager { public static void main(final String[] args) { - //V0.0 + // V0.0 final ExplicitMigrater emptyMigrater = new ExplicitMigrater(); try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(emptyMigrater)) { @@ -47,19 +47,17 @@ public static void main(final String[] args) Logger.getGlobal().info(storageManager.root().toString()); } - - //V1.0 + // V1.0 final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV1)) { Logger.getGlobal().info(storageManager.root().toString()); } - - //V2.0 + // V2.0 final ExplicitMigrater migraterWithV2 = new ExplicitMigrater( - new UpdateToV1_0(), - new UpdateToV2_0() + new UpdateToV1_0(), + new UpdateToV2_0() ); try(final MigrationEmbeddedStorageManager storageManager = MigrationEmbeddedStorage.start(migraterWithV2)) { @@ -67,5 +65,4 @@ public static void main(final String[] args) } } - } diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java index e6dc246..00aecf5 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java @@ -17,38 +17,40 @@ import java.util.logging.Logger; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; public class UpdateToV1_0 implements MigrationScript { @Override - public MigrationVersion getTargetVersion() + public MigrationVersion getTargetVersion() { - return new MigrationVersion(1,0); + return new MigrationVersion(1, 0); } @Override - public void migrate(final Context context) + public void migrate(final Context context) { Logger.getGlobal().info("Executing Script for v1.0..."); - final software.xdev.micromigration.examples.practical.v0.BusinessBranch oldBranch = context.getMigratingObject(); + final software.xdev.micromigration.examples.practical.v0.BusinessBranch oldBranch = + context.getMigratingObject(); final BusinessBranch newBranch = - new BusinessBranch(); - for (final software.xdev.micromigration.examples.practical.v0.Customer oldCustomer : oldBranch.customers) + new BusinessBranch(); + for(final software.xdev.micromigration.examples.practical.v0.Customer oldCustomer : oldBranch.customers) { final Customer newCustomer = - new Customer(); + new Customer(); newCustomer.name = oldCustomer.name; newCustomer.address = new Address(); newCustomer.address.number = oldCustomer.number; newCustomer.address.street = oldCustomer.street; - newCustomer.address.city = oldCustomer.city ; + newCustomer.address.city = oldCustomer.city; newBranch.customers.add(newCustomer); } context.getStorageManager().setRoot(newBranch); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java index c547e70..bbdfbd8 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java @@ -17,19 +17,19 @@ import java.util.logging.Logger; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; public class UpdateToV2_0 implements MigrationScript { @Override - public MigrationVersion getTargetVersion() + public MigrationVersion getTargetVersion() { - return new MigrationVersion(2,0); + return new MigrationVersion(2, 0); } @Override diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java index babc3f3..e905452 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java @@ -17,10 +17,11 @@ import java.util.logging.Logger; -import one.microstream.storage.embedded.types.EmbeddedStorage; -import one.microstream.storage.embedded.types.EmbeddedStorageManager; +import org.eclipse.store.storage.embedded.types.EmbeddedStorage; +import org.eclipse.store.storage.embedded.types.EmbeddedStorageManager; + +import software.xdev.micromigration.eclipse.store.MigrationManager; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; -import software.xdev.micromigration.microstream.MigrationManager; import software.xdev.micromigration.migrater.ExplicitMigrater; import software.xdev.micromigration.version.VersionedObject; @@ -28,15 +29,16 @@ * A practical example of usage in a few steps: *
      *
    • v0.0: Storage is created without any updates. Only stores a new {@link BusinessBranch} - *
    • v1.0: The BusinessBranch has a new implementation {@link software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch}. + *
    • v1.0: The BusinessBranch has a new implementation + * {@link software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch}. * The old branch is converted to the new implementation through the {@link UpdateToV1_0} script. *
    • v2.0: A new customer is added through the {@link UpdateToV2_0} script. *
    * The storage is restarted after every update to simulate a complete lifecycle of the datastore. - * @author Johannes Rabauer * + * @author Johannes Rabauer */ -public class MainPracticalWithMigrationManager +public class MainPracticalWithMigrationManager { /** * Suppressed Warning "unchecked" because it is given, that the correct object is returned. @@ -44,32 +46,33 @@ public class MainPracticalWithMigrationManager @SuppressWarnings("unchecked") public static void main(final String[] args) { - //V0.0 + // V0.0 try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start()) { - final VersionedObject versionedBranch = new VersionedObject<>(BusinessBranch.createDummyBranch()); + final VersionedObject versionedBranch = + new VersionedObject<>(BusinessBranch.createDummyBranch()); storageManager.setRoot(versionedBranch); storageManager.storeRoot(); Logger.getGlobal().info(storageManager.root().toString()); } - - //V1.0 + // V1.0 try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start()) { final ExplicitMigrater migraterWithV1 = new ExplicitMigrater(new UpdateToV1_0()); - final VersionedObject versionedBranch = (VersionedObject)storageManager.root(); + final VersionedObject versionedBranch = + (VersionedObject)storageManager.root(); new MigrationManager(versionedBranch, migraterWithV1, storageManager) .migrate(versionedBranch); Logger.getGlobal().info(storageManager.root().toString()); } - - //V2.0 + // V2.0 try(final EmbeddedStorageManager storageManager = EmbeddedStorage.start()) { final ExplicitMigrater migraterWithV2 = new ExplicitMigrater(new UpdateToV1_0(), new UpdateToV2_0()); - final VersionedObject versionedBranch = (VersionedObject)storageManager.root(); + final VersionedObject versionedBranch = + (VersionedObject)storageManager.root(); new MigrationManager(versionedBranch, migraterWithV2, storageManager) .migrate(versionedBranch); Logger.getGlobal().info(storageManager.root().toString()); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java index b75efb9..ebfd227 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java @@ -17,11 +17,11 @@ import java.util.logging.Logger; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.examples.practical.v0.BusinessBranch; import software.xdev.micromigration.examples.practical.v0.Customer; import software.xdev.micromigration.examples.practical.v1AndHigher.Address; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; @@ -31,27 +31,27 @@ public class UpdateToV1_0 implements MigrationScript> @Override public MigrationVersion getTargetVersion() { - return new MigrationVersion(1,0); + return new MigrationVersion(1, 0); } - + @Override public void migrate(final Context, MigrationEmbeddedStorageManager> context) { Logger.getGlobal().info("Executing Script for v1.0..."); final VersionedObject versionedBranch = context.getMigratingObject(); final BusinessBranch oldBranch = - (BusinessBranch) versionedBranch.getObject(); + (BusinessBranch)versionedBranch.getObject(); final software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch newBranch = - new software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch(); - for (final Customer oldCustomer : oldBranch.customers) + new software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch(); + for(final Customer oldCustomer : oldBranch.customers) { final software.xdev.micromigration.examples.practical.v1AndHigher.Customer newCustomer = - new software.xdev.micromigration.examples.practical.v1AndHigher.Customer(); + new software.xdev.micromigration.examples.practical.v1AndHigher.Customer(); newCustomer.name = oldCustomer.name; newCustomer.address = new Address(); newCustomer.address.number = oldCustomer.number; newCustomer.address.street = oldCustomer.street; - newCustomer.address.city = oldCustomer.city ; + newCustomer.address.city = oldCustomer.city; newBranch.customers.add(newCustomer); } versionedBranch.setObject(newBranch); diff --git a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java index 8a1b737..b4aff4a 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java @@ -17,10 +17,10 @@ import java.util.logging.Logger; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.examples.practical.v1AndHigher.BusinessBranch; import software.xdev.micromigration.examples.practical.v1AndHigher.Customer; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; import software.xdev.micromigration.version.VersionedObject; @@ -30,9 +30,9 @@ public class UpdateToV2_0 implements MigrationScript, MigrationEmbeddedStorageManager> context) { diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java index c524c0e..ca06989 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java @@ -18,8 +18,8 @@ import java.util.Date; import java.util.logging.Logger; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorage; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorage; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; import software.xdev.micromigration.migrater.ReflectiveMigrater; import software.xdev.micromigration.migrater.ScriptInstantiationException; diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java index 00e83c9..0e5568d 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java @@ -18,8 +18,8 @@ import java.util.Date; import java.util.logging.Logger; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; @@ -28,9 +28,9 @@ public class UpdateToV1_0 implements MigrationScript @Override public MigrationVersion getTargetVersion() { - return new MigrationVersion(1,0); + return new MigrationVersion(1, 0); } - + @Override public void migrate(final Context context) { diff --git a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java index 17b9d7d..129c9aa 100644 --- a/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java +++ b/examples/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java @@ -18,8 +18,8 @@ import java.util.Date; import java.util.logging.Logger; -import software.xdev.micromigration.microstream.MigrationEmbeddedStorageManager; -import software.xdev.micromigration.microstream.MigrationScript; +import software.xdev.micromigration.eclipse.store.MigrationEmbeddedStorageManager; +import software.xdev.micromigration.eclipse.store.MigrationScript; import software.xdev.micromigration.scripts.Context; import software.xdev.micromigration.version.MigrationVersion; @@ -28,9 +28,9 @@ public class UpdateToV1_1 implements MigrationScript @Override public MigrationVersion getTargetVersion() { - return new MigrationVersion(1,1); + return new MigrationVersion(1, 1); } - + @Override public void migrate(final Context context) { From 55a04a940d3c360fb9aaa6c3d239ff143e104e10 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 12 Feb 2024 08:30:14 +0100 Subject: [PATCH 255/306] Updated secrets in env --- .github/workflows/publish-dry-run.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml index 37c3172..bf33ecb 100644 --- a/.github/workflows/publish-dry-run.yml +++ b/.github/workflows/publish-dry-run.yml @@ -25,4 +25,5 @@ jobs: JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} JRELEASER_NEXUS2_MAVEN_CENTRAL_SNAPSHOT_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/ + JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44a44cc..cb3fb08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,6 +99,7 @@ jobs: JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} + JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy after_release: runs-on: ubuntu-latest From 9a04df0713de5fbae27062dff33455c6a92bcd13 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 12 Feb 2024 08:49:09 +0100 Subject: [PATCH 256/306] Added URLs to each module to appease maven central --- core/pom.xml | 1 + eclipse-store-v1/pom.xml | 1 + examples/pom.xml | 3 ++- microstream-v5/pom.xml | 1 + microstream-v6/pom.xml | 1 + microstream-v7/pom.xml | 1 + microstream-v8/pom.xml | 1 + reflection/pom.xml | 1 + 8 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/pom.xml b/core/pom.xml index 75c4da3..c254421 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,6 +7,7 @@ 1.0.0-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream + https://github.com/xdev-software/micro-migration software.xdev diff --git a/eclipse-store-v1/pom.xml b/eclipse-store-v1/pom.xml index 5c617ca..5c0d73b 100644 --- a/eclipse-store-v1/pom.xml +++ b/eclipse-store-v1/pom.xml @@ -7,6 +7,7 @@ 1.0.0-SNAPSHOT MicroMigration-for-EclipseStoreV1 Provides the micro migration support for EclipseStore version 1 + https://github.com/xdev-software/micro-migration 1.1.0 diff --git a/examples/pom.xml b/examples/pom.xml index 67b9b8c..2c1d3dd 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -6,7 +6,8 @@ micro-migration-examples 1.0.0-SNAPSHOT MicroMigration-Examples - Examples for the MicroMigration-Library with MicroStream v7 + Examples for the MicroMigration-Library with EclipseStore + https://github.com/xdev-software/micro-migration software.xdev diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 3cb1a7c..ece3eac 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -7,6 +7,7 @@ 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 + https://github.com/xdev-software/micro-migration 05.00.02-MS-GA diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 999b6ea..04853ec 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -7,6 +7,7 @@ 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 + https://github.com/xdev-software/micro-migration 06.01.00-MS-GA diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 5e6c385..48295d0 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -7,6 +7,7 @@ 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 + https://github.com/xdev-software/micro-migration 07.01.00-MS-GA diff --git a/microstream-v8/pom.xml b/microstream-v8/pom.xml index c9b67c1..8ff49a8 100644 --- a/microstream-v8/pom.xml +++ b/microstream-v8/pom.xml @@ -7,6 +7,7 @@ 1.0.0-SNAPSHOT MicroMigration-for-MicroStreamV8 Provides the micro migration support for MicroStream version 8 + https://github.com/xdev-software/micro-migration 08.01.01-MS-GA diff --git a/reflection/pom.xml b/reflection/pom.xml index 58448ae..e97bf4a 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -7,6 +7,7 @@ 1.0.0-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection + https://github.com/xdev-software/micro-migration 05.00.02-MS-GA From 58b5470a9cca7016a1dc3512f130d21356403b82 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 12 Feb 2024 08:16:26 +0000 Subject: [PATCH 257/306] Release 1.0.0 --- core/pom.xml | 4 ++-- eclipse-store-v1/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- microstream-v8/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index c254421..103ab35 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-core - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-Core Migration Lib for MicroStream https://github.com/xdev-software/micro-migration @@ -12,6 +12,6 @@ software.xdev micro-migration - 1.0.0-SNAPSHOT + 1.0.0 diff --git a/eclipse-store-v1/pom.xml b/eclipse-store-v1/pom.xml index 5c0d73b..6d30ed4 100644 --- a/eclipse-store-v1/pom.xml +++ b/eclipse-store-v1/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-eclipse-store-v1 - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-for-EclipseStoreV1 Provides the micro migration support for EclipseStore version 1 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0-SNAPSHOT + 1.0.0 diff --git a/examples/pom.xml b/examples/pom.xml index 2c1d3dd..f76125f 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-examples - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-Examples Examples for the MicroMigration-Library with EclipseStore https://github.com/xdev-software/micro-migration software.xdev - 1.0.0-SNAPSHOT + 1.0.0 micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index ece3eac..6c76370 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0-SNAPSHOT + 1.0.0 diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index 04853ec..ad2206a 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0-SNAPSHOT + 1.0.0 diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index 48295d0..fe22cab 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0-SNAPSHOT + 1.0.0 diff --git a/microstream-v8/pom.xml b/microstream-v8/pom.xml index 8ff49a8..143d26e 100644 --- a/microstream-v8/pom.xml +++ b/microstream-v8/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v8 - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-for-MicroStreamV8 Provides the micro migration support for MicroStream version 8 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0-SNAPSHOT + 1.0.0 diff --git a/pom.xml b/pom.xml index d16f74f..3fcc54b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 1.0.0-SNAPSHOT + 1.0.0 software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index e97bf4a..ed63152 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 1.0.0-SNAPSHOT + 1.0.0 MicroMigration-Reflection Provides a migrater based on reflection https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0-SNAPSHOT + 1.0.0 From 6d94c9f0b3f8d874c4370545fae31312175f8ab7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 12 Feb 2024 08:26:11 +0000 Subject: [PATCH 258/306] Preparing for next development iteration --- core/pom.xml | 4 ++-- eclipse-store-v1/pom.xml | 4 ++-- examples/pom.xml | 4 ++-- microstream-v5/pom.xml | 4 ++-- microstream-v6/pom.xml | 4 ++-- microstream-v7/pom.xml | 4 ++-- microstream-v8/pom.xml | 4 ++-- pom.xml | 2 +- reflection/pom.xml | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 103ab35..5c2dbc6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-core - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-Core Migration Lib for MicroStream https://github.com/xdev-software/micro-migration @@ -12,6 +12,6 @@ software.xdev micro-migration - 1.0.0 + 1.0.1-SNAPSHOT diff --git a/eclipse-store-v1/pom.xml b/eclipse-store-v1/pom.xml index 6d30ed4..bdc3349 100644 --- a/eclipse-store-v1/pom.xml +++ b/eclipse-store-v1/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-eclipse-store-v1 - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-for-EclipseStoreV1 Provides the micro migration support for EclipseStore version 1 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0 + 1.0.1-SNAPSHOT diff --git a/examples/pom.xml b/examples/pom.xml index f76125f..0a3e20c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -4,14 +4,14 @@ 4.0.0 software.xdev micro-migration-examples - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-Examples Examples for the MicroMigration-Library with EclipseStore https://github.com/xdev-software/micro-migration software.xdev - 1.0.0 + 1.0.1-SNAPSHOT micro-migration diff --git a/microstream-v5/pom.xml b/microstream-v5/pom.xml index 6c76370..8ae86ce 100644 --- a/microstream-v5/pom.xml +++ b/microstream-v5/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v5 - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-for-MicroStreamV5 Provides the micro migration support for MicroStream version 5 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0 + 1.0.1-SNAPSHOT diff --git a/microstream-v6/pom.xml b/microstream-v6/pom.xml index ad2206a..9276b36 100644 --- a/microstream-v6/pom.xml +++ b/microstream-v6/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v6 - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-for-MicroStreamV6 Provides the micro migration support for MicroStream version 6 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0 + 1.0.1-SNAPSHOT diff --git a/microstream-v7/pom.xml b/microstream-v7/pom.xml index fe22cab..cf9e25a 100644 --- a/microstream-v7/pom.xml +++ b/microstream-v7/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v7 - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-for-MicroStreamV7 Provides the micro migration support for MicroStream version 7 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0 + 1.0.1-SNAPSHOT diff --git a/microstream-v8/pom.xml b/microstream-v8/pom.xml index 143d26e..ec92ed0 100644 --- a/microstream-v8/pom.xml +++ b/microstream-v8/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-microstream-v8 - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-for-MicroStreamV8 Provides the micro migration support for MicroStream version 8 https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0 + 1.0.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 3fcc54b..9847d0c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 1.0.0 + 1.0.1-SNAPSHOT software.xdev micro-migration MicroMigration diff --git a/reflection/pom.xml b/reflection/pom.xml index ed63152..2ada23a 100644 --- a/reflection/pom.xml +++ b/reflection/pom.xml @@ -4,7 +4,7 @@ 4.0.0 software.xdev micro-migration-reflection - 1.0.0 + 1.0.1-SNAPSHOT MicroMigration-Reflection Provides a migrater based on reflection https://github.com/xdev-software/micro-migration @@ -16,7 +16,7 @@ software.xdev micro-migration - 1.0.0 + 1.0.1-SNAPSHOT From 5ebb87bb7e1021435c78e8530c961766fa91d493 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 12 Feb 2024 09:36:25 +0100 Subject: [PATCH 259/306] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb3fb08..c5fa0cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: ```XML software.xdev - micro-migration-microstream-v8 + micro-migration-eclipse-store-v1 ${{ steps.version.outputs.release }} ``` From 5d59a93834269a06a44bf8623f43006668b0ad31 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 12 Feb 2024 09:49:28 +0100 Subject: [PATCH 260/306] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 846f615..c354079 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ To keep these datastores to represent the correspondend data for the code is a h That's why migration frameworks like [Flyway](https://flywaydb.org) and [Liquibase](https://www.liquibase.org/) exist. Unfortunately both these frameworks are designed to support any type of SQL databases but no NoSQL -databases like [MicroStream](https://microstream.one/). This led to the creation of this library. +databases like [MicroStream](https://microstream.one/) / [EclipseStore](https://eclipsestore.io/). This led to the creation of this library. This library delivers an easy concept to keep your MicroStream / EclipseStore datastore versioned with migration scripts written in plain java. @@ -90,7 +90,7 @@ public class UpdateToV1_0 implements MigrationScript ### MigrationManager Although the approach with the `MigrationEmbeddedStorageManager` is pretty easy to handle, it is intrusive -in the way, that it replaces the root entry point of the MicroStream datastore and inserts its own `VersionedRoot` as root. Some users might find this too entrusive. +in the way, that it replaces the root entry point of the MicroStream/EclipseStore datastore and inserts its own `VersionedRoot` as root. Some users might find this too entrusive. That's why a second approach can be used, where the `MigrationManager` is used. This class is also used internally by the `MigrationEmbeddedStorageManager`. @@ -156,7 +156,7 @@ Micro migration currently supports the following MicroStream / EclipseStore vers |------------------------------------------------------------------------------------------------------------|----------------------------------| | [1.1.0](https://central.sonatype.com/artifact/org.eclipse.store/storage/1.1.0) | micro-migration-eclipse-store-v1 | -If you are using a different, not listed version of MicroStream, this shouldn't be a problem. +If you are using a different, not listed version of MicroStream/EclipseStore, this shouldn't be a problem. Usually you can simply use the closest Micro migration version (f.e. you are using MicroStream `08.00.00-MS-GA`, then use `micro-migration-microstream-v8`) and exclude the dependent version of MicroStream vom Micro migration: ```xml From 518cb58643a2a2b8015161079ccdfcd4d0ba7e22 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Mon, 12 Feb 2024 09:52:05 +0100 Subject: [PATCH 261/306] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c354079..8cbaef8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.com/artifact/software.xdev/micro-migration/0.0.4/versions) +[![Latest version](https://img.shields.io/maven-central/v/software.xdev/micro-migration)](https://central.sonatype.com/artifact/software.xdev/micro-migration/) [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/micro-migration/checkBuild.yml?branch=develop)](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop) [![javadoc core](https://javadoc.io/badge2/software.xdev/micro-migration-core/javadoc.svg)](https://javadoc.io/doc/software.xdev/micro-migration-core) [![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6816/badge)](https://bestpractices.coreinfrastructure.org/projects/6816) From 9daa2965b7dce803995df1c7cbdb7ca3ee7f3996 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Apr 2024 10:13:32 +0200 Subject: [PATCH 262/306] Create update-from-template.yml #228 --- .github/workflows/update-from-template.yml | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/update-from-template.yml diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml new file mode 100644 index 0000000..3d35a5c --- /dev/null +++ b/.github/workflows/update-from-template.yml @@ -0,0 +1,93 @@ +name: Update from Template + +# This workflow keeps the repo up to date with changes from the template repo (REMOTE_URL) +# It duplicates the REMOTE_BRANCH (into UPDATE_BRANCH) and tries to merge it into the +# this repos default branch (which is checked out here) +# Note that this requires a PAT (Personal Access Token) - at best from a servicing account +# Also note that you should have at least once merged the template repo into the current repo manually +# otherwise a "refusing to merge unrelated histories" error might occur. + +on: + schedule: + - cron: '55 2 * * 1' + workflow_dispatch: + +env: + UPDATE_BRANCH: update-from-template + REMOTE_URL: https://github.com/xdev-software/base-template.git + REMOTE_BRANCH: master + +permissions: + contents: write + pull-requests: write + +jobs: + update: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + # Required because otherwise there are always changes detected when executing diff/rev-list + fetch-depth: 0 + # If no PAT is used the following error occurs on a push: + # refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission + token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }} + + - name: Init Git + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + - name: Main workflow + id: main + run: | + echo "Adding remote template-repo" + git remote add template ${{ env.REMOTE_URL }} + + echo "Fetching remote template repo" + git fetch template + + echo "Deleting local branch that will contain the updates - if present" + git branch -D ${{ env.UPDATE_BRANCH }} || true + + echo "Checking if the remote template repo has new commits" + git rev-list ..template/${{ env.REMOTE_BRANCH }} + + if [ $(git rev-list --count ..template/${{ env.REMOTE_BRANCH }}) -eq 0 ]; then + echo "There are no commits new commits on the template repo" + + echo "Deleting origin branch that contains the updates - if present" + git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true + + echo "abort=1" >> $GITHUB_OUTPUT + exit 0 + fi + + echo "Found new commits on the template repo" + + echo "Creating update branch" + git branch ${{ env.UPDATE_BRANCH }} template/${{ env.REMOTE_BRANCH }} + git branch --unset-upstream ${{ env.UPDATE_BRANCH }} + + echo "Pushing update branch" + git push -f -u origin ${{ env.UPDATE_BRANCH }} + + echo "Getting current branch" + current_branch=$(git branch --show-current) + echo "Current branch is $current_branch" + echo "current_branch=$current_branch" >> $GITHUB_OUTPUT + + echo "abort=0" >> $GITHUB_OUTPUT + + - name: pull-request + if: steps.main.outputs.abort == 0 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh_pr_up() { + gh pr create -H "${{ env.UPDATE_BRANCH }}" "$@" || (git checkout "${{ env.UPDATE_BRANCH }}" && gh pr edit "$@") + } + gh_pr_up -B "${{ steps.main.outputs.current_branch }}" \ + --title "Update from template" \ + --body "An automated PR to sync changes from the template into this repo" From 3498e28fc0d22a211e177ffd2ca3f0475affdbc2 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Apr 2024 10:21:20 +0200 Subject: [PATCH 263/306] Sync https://github.com/xdev-software/standard-maven-template --- CODE_OF_CONDUCT.md | 133 --------------------------------------- CONTRIBUTING.md | 69 ++++++++++---------- README.md | 39 +----------- pull_request_template.md | 4 -- 4 files changed, 38 insertions(+), 207 deletions(-) delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 pull_request_template.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 3052937..0000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,133 +0,0 @@ - -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -opensource@xdev-software.de. -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d779ac..2045b68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,47 +1,48 @@ -# Contributing to Micro migration +## Contributing -We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: +We would absolutely love to get the community involved, and we welcome any form of contributions – comments and questions on different communication channels, issues and pull request and anything that you build and share using our components. -- **Reporting a bug**: File issues on GitHub. -- **Send pull requests**: If you want to contribute code, check out the development instructions below. -- **Discussing the current state of the code** -- **Submitting a fix** -- **Proposing new features** -- **Becoming a maintainer** +### Communication channels +* Communication is primarily done using issues. +* If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). +* As a last resort measure or on otherwise important matter you may also [contact us directly](https://xdev.software/en/about-us/contact). -We encourage you to read the [contribution instructions by GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing) also. +### Ways to help +* **Report bugs**
    Create an issue or send a pull request +* **Send pull requests**
    If you want to contribute code, check out the development instructions below. + * However when contributing new features, please first discuss the change you wish to make via issue with the owners of this repository before making a change. Otherwise your work might be rejected and your effort was pointless. -## We Develop with Github +We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/quickstart/contributing-to-projects). -We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. +## Developing -## All Code Changes Happen Through Pull Requests +### Software Requirements +You should have the following things installed: +* Git +* Java 21 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/)) +* Maven (Note that the [Maven Wrapper](https://maven.apache.org/wrapper/) is shipped with the repo) -Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests: +### Recommended setup +* Install ``IntelliJ`` (Community Edition is sufficient) + * Install the following plugins: + * [Save Actions](https://plugins.jetbrains.com/plugin/22113) - Provides save actions, like running the formatter or adding ``final`` to fields + * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis + * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis + * Import the project + * Ensure that everything is encoded in ``UTF-8`` + * Ensure that the JDK/Java-Version is correct -1. Fork the repo and create your branch from `main`. -2. If you've added code that should be tested, add tests. -3. If you've changed APIs, update the documentation. -4. Ensure the test suite passes. -5. Issue that pull request! -## Any contributions you make will be under the Apache-2.0 license +## Releasing -In short, when you submit code changes, your submissions are understood to be under the same [Apache-2.0 license](https://github.com/xdev-software/micro-migration/blob/main/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. +Before releasing: -## Report bugs using Github's [issues](https://github.com/xdev-software/micro-migration/issues) +* Check if the [Check Build](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop)-Action was successful. +* Check the [changelog](CHANGELOG.md) -We use GitHub issues to track public bugs. Report a bug by opening a new issue, it's that easy! +If the ``develop`` is ready for release, create a pull request to the ``main``-Branch and merge the changes -### Get in touch with the team - -Twitter: https://twitter.com/xdevsoftware -Mail: opensource@xdev-software.de - -## License - -By contributing, you agree that your contributions will be licensed under its Apache-2.0 license. - -## Code of Conduct - -Please follow our [Code of Conduct](CODE_OF_CONDUCT.md). \ No newline at end of file +When the release is finished do the following: +* Merge the auto-generated PR (with the incremented version number) back into the ``develop`` +* Login to the [Sonatype repository manager](https://s01.oss.sonatype.org/), check the staged libraries, + close the repository and publish it (after a few minutes). diff --git a/README.md b/README.md index 8cbaef8..795825b 100644 --- a/README.md +++ b/README.md @@ -178,41 +178,8 @@ then use `micro-migration-microstream-v8`) and exclude the dependent version of ``` Since there is rarely a breaking change, this works 90% of times. -## Releasing - -Before releasing: - -* Check if the [Check Build](https://github.com/xdev-software/micro-migration/actions/workflows/checkBuild.yml?query=branch%3Adevelop)-Action was successful. -* Check the [changelog](CHANGELOG.md) - -If the ``develop`` is ready for release, create a pull request to the ``main``-Branch and merge the changes - -When the release is finished do the following: -* Merge the auto-generated PR (with the incremented version number) back into the ``develop`` -* Login to the [Sonatype repository manager](https://s01.oss.sonatype.org/), check the staged libraries, - close the repository and publish it (after a few minutes). - -## Developing - -### Software Requirements -You should have the following things installed: -* Git -* Java 9 -* Maven - -### Recommended setup -* Install ``IntelliJ`` (Community Edition is sufficient) - * Install the following plugins: - * [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) - Provides save actions, like running the formatter or adding ``final`` to fields - * [SonarLint](https://plugins.jetbrains.com/plugin/7973-sonarlint) - CodeStyle/CodeAnalysis - * [Checkstyle-IDEA](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) - CodeStyle/CodeAnalysis. Uses this [checkstyle](config/checkstyle.xml). - * Import the project - * Ensure that everything is encoded in ``UTF-8`` - * Ensure that the JDK/Java-Version is correct - -## Links -- [Javadoc](https://javadoc.io/doc/software.xdev/micro-migration-core/latest/index.html) -- [Maven central repository](https://central.sonatype.dev/artifact/software.xdev/micro-migration/0.0.4/version) +## Support +If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services/support). ## Contributing -We would love your input in any way. More about contributing: [CONTRIBUTING.md](CONTRIBUTING.md) +See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project. diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 149f933..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,4 +0,0 @@ -## What does this PR do? - -## Checklist before merging -- [ ] If its a core feature, I have added through test. \ No newline at end of file From 98aaf0c5d733af388a06b9af42ed9379da60f57d Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:13 +0000 Subject: [PATCH 264/306] Update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.3.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9847d0c..b5f04aa 100644 --- a/pom.xml +++ b/pom.xml @@ -296,7 +296,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.0 + 3.3.1 com.puppycrawl.tools From c96797221e62de5a8ac82b2159157d595ffefd77 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:15 +0000 Subject: [PATCH 265/306] Update dependency org.apache.maven.plugins:maven-source-plugin to v3.3.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9847d0c..ac821dd 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-source From a81ce9f25a50b9e39657f5d07a61d460e5d1b9f2 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:20 +0000 Subject: [PATCH 266/306] Update microstream.version to v08.01.02-MS-GA --- microstream-v8/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microstream-v8/pom.xml b/microstream-v8/pom.xml index ec92ed0..a918f7f 100644 --- a/microstream-v8/pom.xml +++ b/microstream-v8/pom.xml @@ -10,7 +10,7 @@ https://github.com/xdev-software/micro-migration - 08.01.01-MS-GA + 08.01.02-MS-GA From 1d758af46e3f09c837ebd8ba50b77cc2350557a8 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:22 +0000 Subject: [PATCH 267/306] Update dependency com.puppycrawl.tools:checkstyle to v10.15.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9847d0c..348e32e 100644 --- a/pom.xml +++ b/pom.xml @@ -301,7 +301,7 @@ com.puppycrawl.tools checkstyle - 10.9.3 + 10.15.0 From 00f0bdecb2e8e01e4041a1cec32a4065e97de7a1 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:26 +0000 Subject: [PATCH 268/306] Update dependency de.thetaphi:forbiddenapis to v3.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9847d0c..af32432 100644 --- a/pom.xml +++ b/pom.xml @@ -265,7 +265,7 @@ de.thetaphi forbiddenapis - 3.6 + 3.7 From 5e0d80a817b33a3e697a5571619efa10f41f4ca3 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:28 +0000 Subject: [PATCH 269/306] Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.13.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9847d0c..28f1574 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.13.0 ${java.version} ${java.version} From b5a695fe96eedfe3c29c67bb7b82f90983f630be Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:30 +0000 Subject: [PATCH 270/306] Update dependency org.apache.maven.plugins:maven-enforcer-plugin to v3.4.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9847d0c..9eb02d8 100644 --- a/pom.xml +++ b/pom.xml @@ -212,7 +212,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.3.0 + 3.4.1 From bb04e66675f39b13da0fd921f5ed1eff3579d300 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:32:31 +0000 Subject: [PATCH 271/306] Update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.6.3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9847d0c..0fab6a0 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.3 ${java.version} UTF-8 From 7647474f61e9a0af72bbe4c8077682be3431a305 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Apr 2024 10:36:00 +0200 Subject: [PATCH 272/306] Consolidate junit --- pom.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index b0dc12b..16f50a8 100644 --- a/pom.xml +++ b/pom.xml @@ -65,14 +65,8 @@ org.junit.jupiter - junit-jupiter-api - 5.10.0 - test - - - org.junit.jupiter - junit-jupiter-engine - 5.10.0 + junit-jupiter + 5.10.2 test From cbeb49f188f657f08669fb31002d9c6b5df14263 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:37:15 +0000 Subject: [PATCH 273/306] Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.2.5 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 16f50a8..d1bc48b 100644 --- a/pom.xml +++ b/pom.xml @@ -322,7 +322,7 @@ maven-surefire-plugin - 3.1.2 + 3.2.5 org.apache.maven.plugins From e069d0961de2d3465545859f008aa038b822e92d Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:37:17 +0000 Subject: [PATCH 274/306] Update dependency org.codehaus.mojo:extra-enforcer-rules to v1.8.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 16f50a8..b08c51f 100644 --- a/pom.xml +++ b/pom.xml @@ -247,7 +247,7 @@ org.codehaus.mojo extra-enforcer-rules - 1.7.0 + 1.8.0 From 628c5c980f1e71e255649fa744ef39864204fe33 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:37:24 +0000 Subject: [PATCH 275/306] Update org.eclipse.store.version to v1.3.1 --- eclipse-store-v1/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclipse-store-v1/pom.xml b/eclipse-store-v1/pom.xml index bdc3349..7d7cbcf 100644 --- a/eclipse-store-v1/pom.xml +++ b/eclipse-store-v1/pom.xml @@ -10,7 +10,7 @@ https://github.com/xdev-software/micro-migration - 1.1.0 + 1.3.1 From f593cc87b9be224562342f87a1b4e1c77ea59008 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:37:26 +0000 Subject: [PATCH 276/306] Update actions/checkout action to v4 --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/publish-dry-run.yml | 2 +- .github/workflows/release.yml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 981cbff..448fcf5 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -22,7 +22,7 @@ jobs: distribution: [temurin] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v3 diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml index bf33ecb..3df2101 100644 --- a/.github/workflows/publish-dry-run.yml +++ b/.github/workflows/publish-dry-run.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Java diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5fa0cc..7f581e8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v3 with: @@ -30,7 +30,7 @@ jobs: outputs: upload_url: ${{ steps.create_draft.outputs.upload_url }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure Git run: | @@ -78,7 +78,7 @@ jobs: needs: [prepare_release] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # This might seem strange, but in order to see the Version update from the previous step, # we must pull this change from git. - name: Init Git and pull @@ -105,7 +105,7 @@ jobs: runs-on: ubuntu-latest needs: [publish_central] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Init Git and pull run: | From d8d591297ec61c18e4a66d9965583ee5518e2784 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:37:28 +0000 Subject: [PATCH 277/306] Update actions/setup-java action to v4 --- .github/workflows/checkBuild.yml | 2 +- .github/workflows/publish-dry-run.yml | 2 +- .github/workflows/release.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 981cbff..82fff95 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v3 - name: Set up JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml index bf33ecb..1076e01 100644 --- a/.github/workflows/publish-dry-run.yml +++ b/.github/workflows/publish-dry-run.yml @@ -12,7 +12,7 @@ jobs: with: fetch-depth: 0 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'temurin' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5fa0cc..e068f20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'temurin' @@ -87,7 +87,7 @@ jobs: git config --global user.name "GitHub Actions" git pull - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'temurin' From 12baf9dd08cba41c850706c017a0464d0437865b Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 08:37:30 +0000 Subject: [PATCH 278/306] Update actions/upload-artifact action to v4 --- .github/workflows/checkBuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index 981cbff..2d6519d 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -53,7 +53,7 @@ jobs: exit 1 fi - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: jars-java-${{ matrix.java }} path: target/*.jar From d62d5796b859f3490faa842b998bd8e4e40fffd4 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Apr 2024 10:48:25 +0200 Subject: [PATCH 279/306] Reconfigure microstream --- renovate.json5 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 11a77b2..1bead5c 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,4 +1,17 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "rebaseWhen": "behind-base-branch" + "rebaseWhen": "behind-base-branch", + "packageRules": [ + { + "description": "Ignore MicroStream < 8", + "matchPackagePatterns": [ + "^one.microstream" + ], + "datasources": [ + "maven" + ], + "matchCurrentVersion": "<8", + "enabled": false + } + ] } From 89b320ee441eb7659cb28194ed72fb6494a3405f Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Apr 2024 11:10:52 +0200 Subject: [PATCH 280/306] Update renovate.json5 --- renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 1bead5c..1335d2c 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -5,7 +5,7 @@ { "description": "Ignore MicroStream < 8", "matchPackagePatterns": [ - "^one.microstream" + "^one.microstream:*" ], "datasources": [ "maven" From a58a99dee640ce5298dea2a79b353eea23ec4494 Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Apr 2024 11:18:26 +0200 Subject: [PATCH 281/306] Update renovate.json5 --- renovate.json5 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/renovate.json5 b/renovate.json5 index 1335d2c..43709cc 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -5,12 +5,11 @@ { "description": "Ignore MicroStream < 8", "matchPackagePatterns": [ - "^one.microstream:*" + "^one.microstream" ], "datasources": [ "maven" ], - "matchCurrentVersion": "<8", "enabled": false } ] From 3c24262cd00db121ae926bb907196834e065a69d Mon Sep 17 00:00:00 2001 From: AB Date: Thu, 11 Apr 2024 11:26:01 +0200 Subject: [PATCH 282/306] Update renovate.json5 --- renovate.json5 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 43709cc..f1e6bb5 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -3,13 +3,15 @@ "rebaseWhen": "behind-base-branch", "packageRules": [ { - "description": "Ignore MicroStream < 8", + "description": "Ignore MicroStream != 8", "matchPackagePatterns": [ "^one.microstream" ], "datasources": [ "maven" ], + // matchCurrentVersion does not work as MicroStream doesn't use SEMVER + "matchCurrentValue": "!/^08\\./", "enabled": false } ] From 96cd60d046cfe80b976640253ddce9f83467982d Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 11 Apr 2024 09:27:19 +0000 Subject: [PATCH 283/306] Update dependency org.jreleaser:jreleaser-maven-plugin to v1.11.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c635eff..f0bb377 100644 --- a/pom.xml +++ b/pom.xml @@ -116,7 +116,7 @@ org.jreleaser jreleaser-maven-plugin - 1.8.0 + 1.11.0 From 362bc02eee29067984b771c0b1edc818553d0307 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:09:29 +0200 Subject: [PATCH 284/306] Delete .github/dependabot.yml --- .github/dependabot.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 9c7f53a..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -updates: -- package-ecosystem: maven - directory: "/core" - schedule: - interval: "weekly" -- package-ecosystem: maven - directory: "/examples" - schedule: - interval: "weekly" -- package-ecosystem: maven - directory: "/reflection" - schedule: - interval: "weekly" - # Ignore the version, because it is only used for testing - ignore: - - dependency-name: "one.microstream:microstream-storage-embedded" - - dependency-name: "one.microstream:microstream-storage-configuration" -- package-ecosystem: maven - directory: "/microstream-v5" - schedule: - interval: "weekly" - # Ignore the version, because this is supposed to be for old MicroStream versions - ignore: - - dependency-name: "one.microstream:microstream-storage-embedded" - - dependency-name: "one.microstream:microstream-storage-configuration" -- package-ecosystem: maven - directory: "/microstream-v6" - schedule: - interval: "weekly" - # Ignore the version, because this is supposed to be for old MicroStream versions - ignore: - - dependency-name: "one.microstream:microstream-storage-embedded" - - dependency-name: "one.microstream:microstream-storage-configuration" -- package-ecosystem: maven - directory: "/microstream-v7" - schedule: - interval: "weekly" \ No newline at end of file From c8cb7973f906ea0ca07351f3daf0cef7f50cc1eb Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 23 Apr 2024 09:49:15 +0200 Subject: [PATCH 285/306] Rename I --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 34b9514..ad1a2fc 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,4 +2,4 @@ ## Reporting a Vulnerability -Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new). +Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/micro-migration/security/advisories/new). From 09d7391f08b782b86389d84caeeba5e0551cc8c0 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 8 May 2024 14:58:04 +0200 Subject: [PATCH 286/306] Update to v2 --- .gitattributes | 7 + .github/ISSUE_TEMPLATE/bug_report.md | 35 -- .github/ISSUE_TEMPLATE/feature_request.md | 20 - .github/workflows/checkBuild.yml | 52 +- .github/workflows/publish-dry-run.yml | 29 -- .github/workflows/release.yml | 186 ++++--- .github/workflows/sonar.yml | 65 +++ .github/workflows/test-deploy.yml | 32 ++ .github/workflows/update-from-template.yml | 2 +- .gitignore | 143 ++---- .idea/checkstyle-idea.xml | 2 +- .idea/saveactions_settings.xml | 2 +- .mvn/wrapper/maven-wrapper.properties | 17 + CHANGELOG.md | 9 +- CONTRIBUTING.md | 10 +- README.md | 105 +--- {docs => assets}/Logo.png | Bin {docs => assets}/Logo2.png | Bin {docs => assets}/MigrationSequence.drawio | 0 {docs => assets}/MigrationSequence_1.png | Bin {docs => assets}/MigrationSequence_2.png | Bin {docs => assets}/MigrationSequence_3.png | Bin {docs => assets}/MigrationSequence_4.png | Bin config/checkstyle.xml | 311 ------------ core/.idea/.gitignore | 10 - core/.idea/checkstyle-idea.xml | 16 - core/.idea/encodings.xml | 8 - core/pom.xml | 17 - .../migrater/MicroMigrater.java | 110 ----- eclipse-store-v1/pom.xml | 53 -- .../eclipse/store/MigrationScript.java | 34 -- .../eclipse/store/package-info.java | 19 - .../MigrationScriptAfterScriptTest.java | 199 -------- ...oreStuffInMigrationStorageManagerTest.java | 74 --- .../migrater/ExplicitMigraterTest.java | 88 ---- examples/pom.xml | 49 -- {examples => micro-migration-demo}/README.md | 0 micro-migration-demo/pom.xml | 88 ++++ .../examples/explicit/MainExplicit.java | 22 +- .../explicit/scripts/UpdateToV1_0.java | 14 +- .../explicit/scripts/UpdateToV1_1.java | 13 +- .../notification/MainNotification.java | 18 +- ...alWithMigrationEmbeddedStorageManager.java | 23 +- .../practical/embedded/UpdateToV1_0.java | 11 +- .../practical/embedded/UpdateToV2_0.java | 6 +- .../MainPracticalWithMigrationManager.java | 23 +- .../migrationManager/UpdateToV1_0.java | 15 +- .../migrationManager/UpdateToV2_0.java | 15 +- .../examples/practical/v0/BusinessBranch.java | 31 +- .../examples/practical/v0/Customer.java | 10 +- .../practical/v1AndHigher/Address.java | 8 +- .../practical/v1AndHigher/BusinessBranch.java | 17 +- .../practical/v1AndHigher/Customer.java | 4 +- .../examples/reflective/MainReflective.java | 31 +- .../reflective/scripts/UpdateToV1_0.java | 14 +- .../reflective/scripts/UpdateToV1_1.java | 14 +- micro-migration/pom.xml | 285 +++++++++++ .../MigrationEmbeddedStorage.java | 49 +- .../MigrationEmbeddedStorageManager.java | 24 +- .../eclipsestore}/MigrationManager.java | 49 +- .../eclipsestore}/MigrationScript.java | 14 +- .../TunnelingEmbeddedStorageManager.java | 242 +++++---- .../eclipsestore}/package-info.java | 2 +- .../migrater/AbstractMigrater.java | 64 ++- .../migrater/ExplicitMigrater.java | 21 +- .../migrater/MicroMigrater.java | 103 ++++ .../VersionAlreadyRegisteredException.java | 46 +- .../reflection/ReflectiveMigrater.java | 149 ++++++ .../ScriptInstantiationException.java | 18 +- .../AbstractScriptExecutionNotification.java | 53 +- ...cutionNotificationWithScriptReference.java | 20 +- ...ionNotificationWithoutScriptReference.java | 2 - .../xdev/micromigration/scripts/Context.java | 22 +- .../ReflectiveVersionMigrationScript.java | 69 +-- .../scripts/SimpleMigrationScript.java | 20 +- .../scripts/SimpleTypedMigrationScript.java | 21 +- .../VersionAgnosticMigrationScript.java | 23 +- .../version/MigrationVersion.java | 60 +-- .../micromigration/version/Versioned.java | 8 +- .../version/VersionedAndKeeperOfHistory.java | 3 - .../version/VersionedObject.java | 28 +- .../version/VersionedObjectWithHistory.java | 14 +- .../micromigration/version/VersionedRoot.java | 2 - .../version/VersionedRootWithHistory.java | 3 - ...nosticMigrationEmbeddedStorageManager.java | 55 ++- .../VersionAgnosticMigrationManager.java | 121 ++--- ...nosticTunnelingEmbeddedStorageManager.java | 46 +- ...oduceMigrationOnExistingDatastoreTest.java | 22 +- .../MigrationScriptAfterScriptTest.java | 59 ++- .../integration/MultipleScriptsTest.java | 66 +-- ...oreStuffInMigrationStorageManagerTest.java | 42 +- .../migrater/ExplicitMigraterTest.java | 48 +- .../util}/MicroMigrationScriptDummy.java | 15 +- .../reflection}/ReflectiveMigraterTest.java | 90 ++-- .../AbstractScript.java | 5 +- .../v1_ValidScript.java | 10 +- .../abstractSuperClass/AbstractScript.java | 10 +- .../abstractSuperClass/ValidScript.java | 9 +- .../errorThrowing/ErrorThrowingScript.java | 24 +- .../ExceptionThrowingScript.java | 24 +- .../includeSubPackages/ValidScript.java | 23 +- .../subpackage/ValidScriptInSubpackage.java | 37 ++ .../IrrelevantClass.java | 5 +- .../ValidScript.java | 37 ++ .../NoCorrectConstructorScript.java | 14 +- .../reflectiveVersion/v1_ValidScript.java | 10 +- .../reflection/scripts/valid/ValidScript.java | 37 ++ .../ReflectiveVersionMigrationScriptTest.java | 175 ++++--- .../version/MigrationVersionTest.java | 13 +- microstream-v5/pom.xml | 66 --- .../microstream/MigrationEmbeddedStorage.java | 104 ---- .../MigrationEmbeddedStorageManager.java | 49 -- .../microstream/MigrationManager.java | 72 --- .../microstream/MigrationScript.java | 34 -- .../TunnelingEmbeddedStorageManager.java | 386 --------------- .../microstream/package-info.java | 19 - ...oduceMigrationOnExistingDatastoreTest.java | 57 --- .../integration/MigrationHistoryTest.java | 53 -- .../integration/MultipleScriptsTest.java | 90 ---- ...oreStuffInMigrationStorageManagerTest.java | 74 --- microstream-v6/pom.xml | 66 --- .../microstream/MigrationEmbeddedStorage.java | 104 ---- .../MigrationEmbeddedStorageManager.java | 49 -- .../microstream/MigrationManager.java | 72 --- .../microstream/MigrationScript.java | 34 -- .../TunnelingEmbeddedStorageManager.java | 386 --------------- .../microstream/package-info.java | 19 - ...oduceMigrationOnExistingDatastoreTest.java | 56 --- .../MigrationScriptAfterScriptTest.java | 199 -------- .../integration/MultipleScriptsTest.java | 90 ---- ...oreStuffInMigrationStorageManagerTest.java | 74 --- .../migrater/ExplicitMigraterTest.java | 88 ---- microstream-v7/pom.xml | 66 --- .../microstream/MigrationEmbeddedStorage.java | 104 ---- .../MigrationEmbeddedStorageManager.java | 49 -- .../microstream/MigrationManager.java | 72 --- .../TunnelingEmbeddedStorageManager.java | 386 --------------- ...oduceMigrationOnExistingDatastoreTest.java | 56 --- .../MigrationScriptAfterScriptTest.java | 199 -------- .../integration/MultipleScriptsTest.java | 90 ---- .../migrater/ExplicitMigraterTest.java | 88 ---- microstream-v8/pom.xml | 66 --- .../microstream/MigrationEmbeddedStorage.java | 104 ---- .../MigrationEmbeddedStorageManager.java | 49 -- .../microstream/MigrationManager.java | 72 --- .../microstream/MigrationScript.java | 34 -- .../TunnelingEmbeddedStorageManager.java | 382 --------------- .../microstream/package-info.java | 19 - ...oduceMigrationOnExistingDatastoreTest.java | 56 --- .../MigrationScriptAfterScriptTest.java | 199 -------- .../integration/MultipleScriptsTest.java | 90 ---- ...oreStuffInMigrationStorageManagerTest.java | 74 --- .../migrater/ExplicitMigraterTest.java | 88 ---- .../testUtil/MicroMigrationScriptDummy.java | 42 -- mvnw | 250 ++++++++++ mvnw.cmd | 146 ++++++ pom.xml | 462 ++---------------- reflection/README.md | 21 - reflection/pom.xml | 40 -- .../migrater/ReflectiveMigrater.java | 99 ---- .../errorThrowing/ErrorThrowingScript.java | 41 -- .../ExceptionThrowingScript.java | 41 -- .../includeSubPackages/ValidScript.java | 36 -- .../subpackage/ValidScriptInSubpackage.java | 36 -- .../ValidScript.java | 36 -- .../migrater/scripts/valid/ValidScript.java | 36 -- renovate.json5 | 16 +- 167 files changed, 2667 insertions(+), 7711 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/workflows/publish-dry-run.yml create mode 100644 .github/workflows/sonar.yml create mode 100644 .github/workflows/test-deploy.yml create mode 100644 .mvn/wrapper/maven-wrapper.properties rename {docs => assets}/Logo.png (100%) rename {docs => assets}/Logo2.png (100%) rename {docs => assets}/MigrationSequence.drawio (100%) rename {docs => assets}/MigrationSequence_1.png (100%) rename {docs => assets}/MigrationSequence_2.png (100%) rename {docs => assets}/MigrationSequence_3.png (100%) rename {docs => assets}/MigrationSequence_4.png (100%) delete mode 100644 config/checkstyle.xml delete mode 100644 core/.idea/.gitignore delete mode 100644 core/.idea/checkstyle-idea.xml delete mode 100644 core/.idea/encodings.xml delete mode 100644 core/pom.xml delete mode 100644 core/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java delete mode 100644 eclipse-store-v1/pom.xml delete mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/MigrationScript.java delete mode 100644 eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store/package-info.java delete mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java delete mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java delete mode 100644 eclipse-store-v1/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java delete mode 100644 examples/pom.xml rename {examples => micro-migration-demo}/README.md (100%) create mode 100644 micro-migration-demo/pom.xml rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/explicit/MainExplicit.java (78%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_0.java (74%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/explicit/scripts/UpdateToV1_1.java (75%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/notification/MainNotification.java (81%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/embedded/MainPracticalWithMigrationEmbeddedStorageManager.java (78%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV1_0.java (85%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/embedded/UpdateToV2_0.java (89%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/MainPracticalWithMigrationManager.java (86%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV1_0.java (84%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/migrationManager/UpdateToV2_0.java (80%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/v0/BusinessBranch.java (69%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/v0/Customer.java (84%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Address.java (88%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/BusinessBranch.java (77%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/practical/v1AndHigher/Customer.java (92%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/reflective/MainReflective.java (61%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_0.java (74%) rename {examples => micro-migration-demo}/src/main/java/software/xdev/micromigration/examples/reflective/scripts/UpdateToV1_1.java (74%) create mode 100644 micro-migration/pom.xml rename {eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store => micro-migration/src/main/java/software/xdev/micromigration/eclipsestore}/MigrationEmbeddedStorage.java (72%) rename {eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store => micro-migration/src/main/java/software/xdev/micromigration/eclipsestore}/MigrationEmbeddedStorageManager.java (68%) rename {eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store => micro-migration/src/main/java/software/xdev/micromigration/eclipsestore}/MigrationManager.java (55%) rename {microstream-v7/src/main/java/software/xdev/micromigration/microstream => micro-migration/src/main/java/software/xdev/micromigration/eclipsestore}/MigrationScript.java (82%) rename {eclipse-store-v1/src/main/java/software/xdev/micromigration/eclipse/store => micro-migration/src/main/java/software/xdev/micromigration/eclipsestore}/TunnelingEmbeddedStorageManager.java (67%) rename {microstream-v7/src/main/java/software/xdev/micromigration/microstream => micro-migration/src/main/java/software/xdev/micromigration/eclipsestore}/package-info.java (93%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/migrater/AbstractMigrater.java (77%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/migrater/ExplicitMigrater.java (73%) create mode 100644 micro-migration/src/main/java/software/xdev/micromigration/migrater/MicroMigrater.java rename {core => micro-migration}/src/main/java/software/xdev/micromigration/migrater/VersionAlreadyRegisteredException.java (62%) create mode 100644 micro-migration/src/main/java/software/xdev/micromigration/migrater/reflection/ReflectiveMigrater.java rename {reflection/src/main/java/software/xdev/micromigration/migrater => micro-migration/src/main/java/software/xdev/micromigration/migrater/reflection}/ScriptInstantiationException.java (68%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/notification/AbstractScriptExecutionNotification.java (63%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithScriptReference.java (87%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/notification/ScriptExecutionNotificationWithoutScriptReference.java (98%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/scripts/Context.java (79%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScript.java (59%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/scripts/SimpleMigrationScript.java (70%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/scripts/SimpleTypedMigrationScript.java (74%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/scripts/VersionAgnosticMigrationScript.java (77%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/version/MigrationVersion.java (70%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/version/Versioned.java (93%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/version/VersionedAndKeeperOfHistory.java (97%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/version/VersionedObject.java (80%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/version/VersionedObjectWithHistory.java (92%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/version/VersionedRoot.java (98%) rename {core => micro-migration}/src/main/java/software/xdev/micromigration/version/VersionedRootWithHistory.java (98%) rename {core/src/main/java/software/xdev/micromigration/microstream => micro-migration/src/main/java/software/xdev/micromigration}/versionagnostic/VersionAgnosticMigrationEmbeddedStorageManager.java (84%) rename {core/src/main/java/software/xdev/micromigration/microstream => micro-migration/src/main/java/software/xdev/micromigration}/versionagnostic/VersionAgnosticMigrationManager.java (53%) rename {core/src/main/java/software/xdev/micromigration/microstream => micro-migration/src/main/java/software/xdev/micromigration}/versionagnostic/VersionAgnosticTunnelingEmbeddedStorageManager.java (90%) rename {eclipse-store-v1/src/test/java/software/xdev/micromigration => micro-migration/src/test/java/software/xdev/micromigration/eclipsestore}/integration/IntroduceMigrationOnExistingDatastoreTest.java (71%) rename {microstream-v5/src/test/java/software/xdev/micromigration => micro-migration/src/test/java/software/xdev/micromigration/eclipsestore}/integration/MigrationScriptAfterScriptTest.java (80%) rename {eclipse-store-v1/src/test/java/software/xdev/micromigration => micro-migration/src/test/java/software/xdev/micromigration/eclipsestore}/integration/MultipleScriptsTest.java (69%) rename {microstream-v7/src/test/java/software/xdev/micromigration => micro-migration/src/test/java/software/xdev/micromigration/eclipsestore}/integration/StoreStuffInMigrationStorageManagerTest.java (73%) rename {microstream-v5/src/test/java/software/xdev/micromigration => micro-migration/src/test/java/software/xdev/micromigration/eclipsestore}/migrater/ExplicitMigraterTest.java (70%) rename {eclipse-store-v1/src/test/java/software/xdev/micromigration/testUtil => micro-migration/src/test/java/software/xdev/micromigration/eclipsestore/util}/MicroMigrationScriptDummy.java (79%) rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/ReflectiveMigraterTest.java (57%) rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/scripts/abstractReflectiveSuperClass/AbstractScript.java (82%) rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/scripts/abstractReflectiveSuperClass/v1_ValidScript.java (70%) rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/scripts/abstractSuperClass/AbstractScript.java (64%) rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/scripts/abstractSuperClass/ValidScript.java (73%) rename microstream-v5/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection/scripts/errorThrowing/ErrorThrowingScript.java (64%) rename microstream-v6/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection/scripts/exceptionThrowing/ExceptionThrowingScript.java (64%) rename microstream-v7/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection/scripts/includeSubPackages/ValidScript.java (64%) create mode 100644 micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/scripts/moreClassesIncludingValid/IrrelevantClass.java (83%) create mode 100644 micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection/scripts/moreClassesIncludingValid/ValidScript.java rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/scripts/noCorrectConstructor/NoCorrectConstructorScript.java (72%) rename {reflection/src/test/java/software/xdev/micromigration/migrater => micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection}/scripts/reflectiveVersion/v1_ValidScript.java (74%) create mode 100644 micro-migration/src/test/java/software/xdev/micromigration/migrater/reflection/scripts/valid/ValidScript.java rename {core => micro-migration}/src/test/java/software/xdev/micromigration/scripts/ReflectiveVersionMigrationScriptTest.java (53%) rename {core => micro-migration}/src/test/java/software/xdev/micromigration/version/MigrationVersionTest.java (91%) delete mode 100644 microstream-v5/pom.xml delete mode 100644 microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java delete mode 100644 microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java delete mode 100644 microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java delete mode 100644 microstream-v5/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java delete mode 100644 microstream-v5/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java delete mode 100644 microstream-v5/src/main/java/software/xdev/micromigration/microstream/package-info.java delete mode 100644 microstream-v5/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java delete mode 100644 microstream-v5/src/test/java/software/xdev/micromigration/integration/MigrationHistoryTest.java delete mode 100644 microstream-v5/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java delete mode 100644 microstream-v5/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java delete mode 100644 microstream-v6/pom.xml delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java delete mode 100644 microstream-v6/src/main/java/software/xdev/micromigration/microstream/package-info.java delete mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java delete mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java delete mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java delete mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java delete mode 100644 microstream-v6/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java delete mode 100644 microstream-v7/pom.xml delete mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java delete mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java delete mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java delete mode 100644 microstream-v7/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java delete mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java delete mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java delete mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java delete mode 100644 microstream-v7/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java delete mode 100644 microstream-v8/pom.xml delete mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorage.java delete mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationEmbeddedStorageManager.java delete mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationManager.java delete mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/MigrationScript.java delete mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/TunnelingEmbeddedStorageManager.java delete mode 100644 microstream-v8/src/main/java/software/xdev/micromigration/microstream/package-info.java delete mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/IntroduceMigrationOnExistingDatastoreTest.java delete mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/MigrationScriptAfterScriptTest.java delete mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/MultipleScriptsTest.java delete mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/integration/StoreStuffInMigrationStorageManagerTest.java delete mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/migrater/ExplicitMigraterTest.java delete mode 100644 microstream-v8/src/test/java/software/xdev/micromigration/testUtil/MicroMigrationScriptDummy.java create mode 100644 mvnw create mode 100644 mvnw.cmd delete mode 100644 reflection/README.md delete mode 100644 reflection/pom.xml delete mode 100644 reflection/src/main/java/software/xdev/micromigration/migrater/ReflectiveMigrater.java delete mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/errorThrowing/ErrorThrowingScript.java delete mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/exceptionThrowing/ExceptionThrowingScript.java delete mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/ValidScript.java delete mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/includeSubPackages/subpackage/ValidScriptInSubpackage.java delete mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/moreClassesIncludingValid/ValidScript.java delete mode 100644 reflection/src/test/java/software/xdev/micromigration/migrater/scripts/valid/ValidScript.java diff --git a/.gitattributes b/.gitattributes index dfe0770..9c74e42 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,9 @@ # Auto detect text files and perform LF normalization * text=auto + +# Force sh files to have LF +*.sh text eol=lf + +# Force MVN Wrapper Linux files LF +mvnw text eol=lf +.mvn/wrapper/maven-wrapper.properties text eol=lf diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index d9cdd08..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: bug -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Implemented Micro migration like this... -2. Started datastore... -3. Restarted datastore... - - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Environment (please complete the following information):** - - OS: [e.g. Windows 10, Ubuntu] - - Java version [e.g. Java 11] - - IDE [e.g. eclipse, intellij] - - MicroStream version [e.g. 07.01.00-MS-GA] - - Micro migration version [e.g. 22] - - Maven pom.xml [relevant parts] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/checkBuild.yml b/.github/workflows/checkBuild.yml index d958e65..fa9b7f5 100644 --- a/.github/workflows/checkBuild.yml +++ b/.github/workflows/checkBuild.yml @@ -6,10 +6,22 @@ on: branches: [ develop ] paths-ignore: - '**.md' + - '.config/**' + - '.github/**' + - '.idea/**' + - 'assets/**' pull_request: branches: [ develop ] paths-ignore: - '**.md' + - '.config/**' + - '.github/**' + - '.idea/**' + - 'assets/**' + +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo jobs: build: @@ -17,8 +29,7 @@ jobs: strategy: matrix: - java: [11, 17] - java-package: [jdk] + java: [17, 21] distribution: [temurin] steps: @@ -29,11 +40,10 @@ jobs: with: distribution: ${{ matrix.distribution }} java-version: ${{ matrix.java }} - java-package: ${{ matrix.java-package }} cache: 'maven' - - name: Build with maven - run: mvn -B clean verify + - name: Build with Maven + run: ./mvnw -B clean package - name: Check for uncommited changes run: | @@ -49,11 +59,35 @@ jobs: echo ---------------------------------------- echo Troubleshooting echo ---------------------------------------- - echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify" + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package" exit 1 fi - - uses: actions/upload-artifact@v4 + - name: Upload demo files + uses: actions/upload-artifact@v4 + with: + name: demo-files-java-${{ matrix.java }} + path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar + if-no-files-found: error + + code-style: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} + + strategy: + matrix: + java: [17] + distribution: [temurin] + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 with: - name: jars-java-${{ matrix.java }} - path: target/*.jar + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Run Checkstyle + run: ./mvnw -B checkstyle:check -P checkstyle -T2C diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml deleted file mode 100644 index 290b48d..0000000 --- a/.github/workflows/publish-dry-run.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Publish dry run - -on: - workflow_dispatch: - -jobs: - publish-dry-run: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Java - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - cache: 'maven' - - name: Publish project - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_SNAPSHOT_URL: https://s01.oss.sonatype.org/content/repositories/snapshots/ - JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -Djreleaser.dry.run -DaltDeploymentRepository=local::default::file:./target/staging-deploy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 330f407..4ad042f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,8 @@ -name: Publish package to the Maven Central Repository +name: Release + on: push: - branches: [ main ] + branches: [ master ] env: PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} @@ -11,24 +12,44 @@ permissions: pull-requests: write jobs: - check_build: + check_code: # Validates the code runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Java - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - cache: 'maven' - - name: Build with Maven - run: mvn -B clean verify + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Build with Maven + run: ./mvnw -B clean package + + - name: Check for uncommited changes + run: | + if [[ "$(git status --porcelain)" != "" ]]; then + echo ---------------------------------------- + echo git status + echo ---------------------------------------- + git status + echo ---------------------------------------- + echo git diff + echo ---------------------------------------- + git diff + echo ---------------------------------------- + echo Troubleshooting + echo ---------------------------------------- + echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package" + exit 1 + fi + prepare_release: runs-on: ubuntu-latest - needs: [check_build] + needs: [check_code] outputs: - upload_url: ${{ steps.create_draft.outputs.upload_url }} + upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - uses: actions/checkout@v4 @@ -36,14 +57,25 @@ jobs: run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" - + - name: Un-SNAP - run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false + run: | + mvnwPath=$(readlink -f ./mvnw) + modules=("") # root + modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) + for i in "${modules[@]}" + do + echo "Processing $i/pom.xml" + (cd "$i" && $mvnwPath -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false) + done - name: Get version id: version run: | - echo "release=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT + version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "release=$version" >> $GITHUB_OUTPUT + echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} - name: Commit and Push run: | @@ -59,7 +91,7 @@ jobs: with: tag_name: v${{ steps.version.outputs.release }} release_name: v${{ steps.version.outputs.release }} - commitish: main + commitish: master body: | ## [Changelog](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ env.PRIMARY_MAVEN_MODULE }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information. @@ -69,38 +101,71 @@ jobs: ```XML software.xdev - micro-migration-eclipse-store-v1 + ${{ env.PRIMARY_MAVEN_MODULE }} ${{ steps.version.outputs.release }} ``` - publish_central: + + publish_central: # Publish the code to central + runs-on: ubuntu-latest + needs: [prepare_release] + steps: + - uses: actions/checkout@v4 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Set up JDK Apache Maven Central + uses: actions/setup-java@v4 + with: # running setup-java again overwrites the settings.xml + java-version: '17' + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to Apache Maven Central + run: ../mvnw -B deploy -Possrh + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + + publish-pages: runs-on: ubuntu-latest needs: [prepare_release] steps: - - name: Checkout - uses: actions/checkout@v4 - # This might seem strange, but in order to see the Version update from the previous step, - # we must pull this change from git. - - name: Init Git and pull - run: | - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - git pull - - name: Set up Java - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - cache: 'maven' - - name: Publish - env: - JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC_KEY }} - JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} - JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} - JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn -B -pl !examples -Prelease deploy org.jreleaser:jreleaser-maven-plugin:deploy -DaltDeploymentRepository=local::default::file:./target/staging-deploy + - uses: actions/checkout@v4 + + - name: Init Git and pull + run: | + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + git pull + + - name: Setup - Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Build site + run: ../mvnw -B site + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + + - name: Deploy to Github pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site + after_release: runs-on: ubuntu-latest needs: [publish_central] @@ -112,10 +177,18 @@ jobs: git config --global user.email "actions@github.com" git config --global user.name "GitHub Actions" git pull - - - name: Inc Version and SNAP root - run: mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true - + + - name: Inc Version and SNAP + run: | + mvnwPath=$(readlink -f ./mvnw) + modules=("") # root + modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0')) + for i in "${modules[@]}" + do + echo "Processing $i/pom.xml" + (cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true) + done + - name: Git Commit and Push run: | git add -A @@ -123,9 +196,12 @@ jobs: git push origin - name: pull-request - uses: repo-sync/pull-request@v2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - destination_branch: "develop" - pr_title: "Sync back" - pr_body: "An automated PR to sync changes back" + env: + GH_TOKEN: ${{ github.token }} + run: | + gh_pr_up() { + gh pr create "$@" || gh pr edit "$@" + } + gh_pr_up -B "develop" \ + --title "Sync back" \ + --body "An automated PR to sync changes back" diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 0000000..1c9b0f8 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,65 @@ +name: Sonar + +on: + workflow_dispatch: + push: + branches: [ develop ] + paths-ignore: + - '**.md' + - '.config/**' + - '.github/**' + - '.idea/**' + - 'assets/**' + pull_request: + types: [opened, synchronize, reopened] + paths-ignore: + - '**.md' + - '.config/**' + - '.github/**' + - '.idea/**' + - 'assets/**' + +env: + SONARCLOUD_ORG: ${{ github.event.organization.login }} + SONARCLOUD_HOST: https://sonarcloud.io + +jobs: + sonar: + name: SonarCloud Scan + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - name: Cache SonarCloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build with Maven + run: | + ./mvnw -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -DskipTests \ + -Dsonar.projectKey=${{ env.SONARCLOUD_ORG }}_${{ github.event.repository.name }} \ + -Dsonar.organization=${{ env.SONARCLOUD_ORG }} \ + -Dsonar.host.url=${{ env.SONARCLOUD_HOST }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..cdd96cc --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,32 @@ +name: Test Deployment + +on: + workflow_dispatch: + +env: + PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }} + +jobs: + publish_central: # Publish the code to central + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK OSSRH + uses: actions/setup-java@v4 + with: # running setup-java again overwrites the settings.xml + distribution: 'temurin' + java-version: '17' + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-passphrase: MAVEN_GPG_PASSPHRASE + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + + - name: Publish to OSSRH + run: ../mvnw -B deploy -Possrh + working-directory: ${{ env.PRIMARY_MAVEN_MODULE }} + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index 41a1bcd..a325e2b 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -14,7 +14,7 @@ on: env: UPDATE_BRANCH: update-from-template - REMOTE_URL: https://github.com/xdev-software/java-template.git + REMOTE_URL: https://github.com/xdev-software/standard-maven-template.git REMOTE_BRANCH: master permissions: diff --git a/.gitignore b/.gitignore index 57e6912..d0e81bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,74 +1,17 @@ +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar -# Created by https://www.toptal.com/developers/gitignore/api/maven,java,eclipse,windows -# Edit at https://www.toptal.com/developers/gitignore?templates=maven,java,eclipse,windows - -### Eclipse ### -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# CDT- autotools -.autotools - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - -# Annotation Processing -.apt_generated/ -.apt_generated_test/ - -# Scala IDE specific (Scala & Java development for Eclipse) -.cache-main -.scala_dependencies -.worksheet - -# Uncomment this line if you wish to ignore the project description file. -# Typically, this file would be tracked if it contains build/dependency configurations: -.project - -### Eclipse Patch ### -# Spring Boot Tooling -.sts4-cache/ -### Java ### # Compiled class file *.class @@ -81,7 +24,7 @@ local.properties # Mobile Tools for Java (J2ME) .mtj.tmp/ -# Package Files # +# Package/Binary Files don't belong into a git repo *.jar *.war *.nar @@ -89,53 +32,39 @@ local.properties *.zip *.tar.gz *.rar +*.dll +*.exe +*.bin # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -### Maven ### -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar - -### Windows ### -# Windows thumbnail cache files -Thumbs.db -Thumbs.db:encryptable -ehthumbs.db -ehthumbs_vista.db -# Dump file -*.stackdump +# bin / compiled stuff +target/ -# Folder config file -[Dd]esktop.ini -# Recycle Bin used on file shares -$RECYCLE.BIN/ +# JRebel +**/resources/rebel.xml +**/resources/rebel-remote.xml -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp +# eclispe stuff for root +/.settings/ +/.classpath +/.project -# Windows shortcuts -*.lnk -# End of https://www.toptal.com/developers/gitignore/api/maven,java,eclipse,windows +# eclispe stuff for modules +/*/.metadata/ +/*/.apt_generated_tests/ +/*/.settings/ +/*/.classpath +/*/.project +/*/RemoteSystemsTempFiles/ -#MicroStream Datastore default directory -/storage/ +#custom +.flattened-pom.xml +.tern-project # == IntelliJ == *.iml @@ -155,4 +84,4 @@ $RECYCLE.BIN/ !.idea/codeStyles/ .idea/codeStyles/* !.idea/codeStyles/codeStyleConfig.xml -!.idea/codeStyles/Project.xml \ No newline at end of file +!.idea/codeStyles/Project.xml diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml index 7ec678f..eb3fcd8 100644 --- a/.idea/checkstyle-idea.xml +++ b/.idea/checkstyle-idea.xml @@ -17,4 +17,4 @@ - + \ No newline at end of file diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml index 2909df4..71a42c4 100644 --- a/.idea/saveactions_settings.xml +++ b/.idea/saveactions_settings.xml @@ -18,4 +18,4 @@