use of com.emc.storageos.db.client.upgrade.BaseCustomMigrationCallback in project coprhd-controller by CoprHD.
the class MockMigrationHandler method run.
@Override
public boolean run() throws DatabaseException {
for (Entry<String, List<BaseCustomMigrationCallback>> entry : this.getCustomMigrationCallbacks().entrySet()) {
log.info("execute migration callback under {}", entry.getKey());
for (BaseCustomMigrationCallback callback : entry.getValue()) {
callback.setName(callback.getClass().getName());
callback.setDbClient(this.getDbClient());
callback.setCoordinatorClient(this.getCoordinator());
log.info("Invoking migration callback: " + callback.getName());
try {
callback.process();
} catch (MigrationCallbackException e) {
log.error("invoke migration callback {} failed:{}", callback.getName(), e);
return false;
}
}
}
return true;
}
use of com.emc.storageos.db.client.upgrade.BaseCustomMigrationCallback in project coprhd-controller by CoprHD.
the class BlockSnapshotSessionMigrationTest method setup.
/**
* Setup method executed before test is executed.
*
* @throws IOException
*/
@BeforeClass
public static void setup() throws IOException {
customMigrationCallbacks.put("2.4", new ArrayList<BaseCustomMigrationCallback>() {
private static final long serialVersionUID = 1L;
{
// Add your implementation of migration callback below.
add(new BlockSnapshotSessionMigration());
}
});
// Adding this, which is typically executed in the base class
// call, as it is needed to clear the DB file between runs.
_dataDir = new File(dataDir);
if (_dataDir.exists() && _dataDir.isDirectory()) {
cleanDirectory(_dataDir);
}
_dataDir.mkdir();
// Commenting this out as it prevents the migration callback
// from being executed when the test is executed.
// DbsvcTestBase.setup();
}
use of com.emc.storageos.db.client.upgrade.BaseCustomMigrationCallback in project coprhd-controller by CoprHD.
the class XtremioBlockSnapshotDeviceLabelMigrationTest method setup.
@BeforeClass
public static void setup() throws IOException {
customMigrationCallbacks.put("2.3", new ArrayList<BaseCustomMigrationCallback>() {
{
add(new XtremioBlockSnapshotDeviceLabelMigration());
}
});
// Adding this, which is typically executed in the base class
// call, as it is needed to clear the DB file between runs.
_dataDir = new File(dataDir);
if (_dataDir.exists() && _dataDir.isDirectory()) {
cleanDirectory(_dataDir);
}
_dataDir.mkdir();
// Commenting this out as it prevents the migration callback
// from being executed when the test is executed.
// DbsvcTestBase.setup();
log.info("completed setup");
}
Aggregations