@Override public String valueOf(Schema schema) { return schema.getName(); } }), schemaObjs).toImmutable());
@Override public Predicate<? super ChecksumEntry> valueOf(Schema schema) { return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); } });
@Override public boolean accept(Schema schema) { return schema.isReadOnly(); } });
return new Schema(schemaName, systemDbPlatform.getObjectExclusionPredicateBuilder().add(excludedNameMap.toImmutable()), readOnly);
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()); return it.getName().equals("SCHEMA4_RO"); }).isReadOnly()); assertFalse(env2.getAllSchemas().detect(new Predicate<Schema>() { @Override return it.getName().equals("SCHEMA3"); }).isReadOnly()); assertTrue(env3.getAllSchemas().detect(new Predicate<Schema>() { @Override return it.getName().equals("SCHEMA4_RO"); }).isReadOnly()); assertFalse(env3.getAllSchemas().detect(new Predicate<Schema>() { @Override return it.getName().equals("SCHEMA3"); }).isReadOnly());
return new Schema(schemaName, systemDbPlatform.getObjectExclusionPredicateBuilder().add(excludedNameMap.toImmutable()), readOnly);
@Before public void setup() { this.env = new DbEnvironment(); this.env.setSchemas(Sets.immutable.with(new Schema(physicalSchema.getPhysicalName()))); this.sqlExecutor = new Db2SqlExecutor(dataSource, env); this.metricsCollector = new DeployMetricsCollectorImpl(); this.db2PostDeployAction = new Db2PostDeployAction(sqlExecutor, metricsCollector); }
@Override public String valueOf(Schema schema1) { return schema1.getName(); } }).contains(schema),
@Override public Predicate<? super ChecksumEntry> valueOf(Schema schema) { return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); } });
@Override public boolean accept(Schema schema) { return schema.isReadOnly(); } });
private void setupExecutor(boolean autoReorg) { this.db2JdbcTemplate = new JdbcHelper(); this.environment = new DbEnvironment(); this.environment.setSchemas(Sets.immutable.with(new Schema(physicalSchema.getPhysicalName()))); this.environment.setAutoReorgEnabled(autoReorg); this.executor = new Db2SqlExecutor(db2DataSource, this.environment); executorJdbc = this.executor.getJdbcTemplate(); }
@Override public String valueOf(Schema schema1) { return schema1.getName(); } }).toSet().toImmutable();
@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());
env.setDriverClassName(args.getDriverClass()); Schema schema = new Schema(args.getDbSchema()); env.setSchemas(Sets.immutable.with(schema));
@Override public String valueOf(Schema schema1) { return schema1.getName(); } }).contains(schema),
@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());
env.setDriverClassName(args.getDriverClass()); Schema schema = new Schema(args.getDbSchema()); env.setSchemas(Sets.immutable.with(schema));
@Override public String valueOf(Schema schema) { return schema.getName(); } });
assertTrue(schema.getObjectExclusionPredicateBuilder().getObjectNamesByType().isEmpty()); assertEquals("DEPLOY_TRACKER", env1.getPhysicalSchema("DEPLOY_TRACKER").getPhysicalName());
@Before public void setup() { this.env = new DbEnvironment(); this.env.setSchemas(Sets.immutable.with(new Schema(physicalSchema.getPhysicalName()))); this.sqlExecutor = new Db2SqlExecutor(dataSource, env); this.metricsCollector = new DeployMetricsCollectorImpl(); this.db2PostDeployAction = new Db2PostDeployAction(sqlExecutor, metricsCollector); }