use of org.apache.ignite.internal.cache.query.index.sorted.DurableBackgroundCleanupIndexTreeTask in project ignite by apache.
the class LongDestroyDurableBackgroundTaskTest method testConvertOldTaskToNew.
/**
* Checking the converting of the old problem into the new one.
*/
@Test
public void testConvertOldTaskToNew() {
String grpName = "grpTest";
String cacheName = "cacheTest";
String treeName = "treeTest";
String idxName = "idxTest";
List<Long> pages = F.asList(100L);
DurableBackgroundCleanupIndexTreeTask oldTask = new DurableBackgroundCleanupIndexTreeTask(pages, emptyList(), grpName, cacheName, new IndexName(cacheName, "schemaTest", "tableTest", idxName), treeName);
DurableBackgroundTask convertedTask = oldTask.convertAfterRestoreIfNeeded();
assertTrue(convertedTask instanceof DurableBackgroundCleanupIndexTreeTaskV2);
assertEquals(grpName, getFieldValue(convertedTask, "grpName"));
assertEquals(cacheName, getFieldValue(convertedTask, "cacheName"));
assertEquals(treeName, getFieldValue(convertedTask, "oldTreeName"));
assertNotNull(getFieldValue(convertedTask, "newTreeName"));
assertEquals(idxName, getFieldValue(convertedTask, "idxName"));
assertEquals(pages.size(), (int) getFieldValue(convertedTask, "segments"));
}
Aggregations