@Override public Predicate<? super ChecksumEntry> valueOf(Schema schema) { return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); } });
@Override public Predicate<? super ChecksumEntry> valueOf(Schema schema) { return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); } });
@Override public RichIterable<DbCleanCommand> valueOf(PhysicalSchema physicalSchema) { ImmutableList<DbCleanCommand> schemaDrops = getDropStatements(physicalSchema); MutableCollection<Schema> schemas = physicalSchemaToSchemaMap.get(physicalSchema); for (Schema schema : schemas) { schemaDrops = schemaDrops.select(schema.getObjectExclusionPredicateBuilder().build(new Function<DbCleanCommand, String>() { @Override public String valueOf(DbCleanCommand it) { return it.getObjectType().getName(); } }, DbCleanCommand.TO_OBJECT_NAME)); } return schemaDrops; } }).toList());
@Override public RichIterable<DbCleanCommand> valueOf(PhysicalSchema physicalSchema) { ImmutableList<DbCleanCommand> schemaDrops = getDropStatements(physicalSchema); MutableCollection<Schema> schemas = physicalSchemaToSchemaMap.get(physicalSchema); for (Schema schema : schemas) { schemaDrops = schemaDrops.select(schema.getObjectExclusionPredicateBuilder().build(new Function<DbCleanCommand, String>() { @Override public String valueOf(DbCleanCommand it) { return it.getObjectType().getName(); } }, DbCleanCommand.TO_OBJECT_NAME)); } return schemaDrops; } }).toList());
assertTrue(schema.getObjectExclusionPredicateBuilder().getObjectNamesByType().isEmpty()); assertEquals("DEPLOY_TRACKER", env1.getPhysicalSchema("DEPLOY_TRACKER").getPhysicalName());
expectedExclusions.putAll(ChangeType.VIEW_STR, Lists.immutable.with("view1Pat", "view2%Pat")); expectedExclusions.putAll(ChangeType.SP_STR, Lists.immutable.with("sp1", "sp2", "sp3", "sp4")); assertEquals(expectedExclusions, schema1.getObjectExclusionPredicateBuilder().getObjectNamesByType());