Search in sources :

Example 1 with SchemaMigration

use of uk.gov.gchq.gaffer.graph.hook.migrate.SchemaMigration in project Gaffer by gchq.

the class SchemaMigrationIT method createMigration.

private SchemaMigration createMigration() {
    final SchemaMigration migration = new SchemaMigration();
    migration.setEntities(Collections.singletonList(new MigrateElement(MigrateElement.ElementType.ENTITY, "entityOld", "entityNew", new ElementTransformer.Builder().select("count").execute(new ToLong()).project("count").build(), new ElementTransformer.Builder().select("count").execute(new ToInteger()).project("count").build())));
    migration.setEdges(Arrays.asList(new MigrateElement(MigrateElement.ElementType.EDGE, "edgeOld", "edgeNew", new ElementTransformer.Builder().select("count").execute(new ToLong()).project("count").build(), new ElementTransformer.Builder().select("count").execute(new ToInteger()).project("count").build()), new MigrateElement(MigrateElement.ElementType.EDGE, "edgeAgg", "edgeAggNew", new ElementTransformer.Builder().select("count").execute(new ToLong()).project("count").build(), new ElementTransformer.Builder().select("count").execute(new ToInteger()).project("count").build()), new MigrateElement(MigrateElement.ElementType.EDGE, "oldEdgePostOpAgg", "newEdgePostOpAgg", new ElementTransformer.Builder().select("count").execute(new ToLong()).project("count").build(), new ElementTransformer.Builder().select("count").execute(new ToInteger()).project("count").build()), new MigrateElement(MigrateElement.ElementType.EDGE, "oldEdgeAggBeforePostFilter", "newEdgeAggBeforePostFilter", new ElementTransformer.Builder().select("count").execute(new ToLong()).project("count").build(), new ElementTransformer.Builder().select("count").execute(new ToInteger()).project("count").build()), new MigrateElement(MigrateElement.ElementType.EDGE, "edgeOldOpChain", "edgeNewOpChain", new ElementTransformer.Builder().select("count").execute(new ToLong()).project("count").build(), new ElementTransformer.Builder().select("count").execute(new ToInteger()).project("count").build())));
    return migration;
}
Also used : ToLong(uk.gov.gchq.koryphe.impl.function.ToLong) ElementTransformer(uk.gov.gchq.gaffer.data.element.function.ElementTransformer) ToInteger(uk.gov.gchq.koryphe.impl.function.ToInteger) SchemaMigration(uk.gov.gchq.gaffer.graph.hook.migrate.SchemaMigration) MigrateElement(uk.gov.gchq.gaffer.graph.hook.migrate.MigrateElement)

Aggregations

ElementTransformer (uk.gov.gchq.gaffer.data.element.function.ElementTransformer)1 MigrateElement (uk.gov.gchq.gaffer.graph.hook.migrate.MigrateElement)1 SchemaMigration (uk.gov.gchq.gaffer.graph.hook.migrate.SchemaMigration)1 ToInteger (uk.gov.gchq.koryphe.impl.function.ToInteger)1 ToLong (uk.gov.gchq.koryphe.impl.function.ToLong)1