public ImmutableSet<PhysicalSchema> getAllPhysicalSchemas() { return this.getAllSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema1) { return schema1.getName(); } }).collect(new Function<String, PhysicalSchema>() { @Override public PhysicalSchema valueOf(String schema) { return Environment.this.getPhysicalSchema(schema); } }); }
public ImmutableSet<PhysicalSchema> getPhysicalSchemas() { return this.getSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema1) { return schema1.getName(); } }).collect(new Function<String, PhysicalSchema>() { @Override public PhysicalSchema valueOf(String schema) { return Environment.this.getPhysicalSchema(schema); } }); }
public ImmutableSet<PhysicalSchema> getAllPhysicalSchemas() { return this.getAllSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema1) { return schema1.getName(); } }).collect(new Function<String, PhysicalSchema>() { @Override public PhysicalSchema valueOf(String schema) { return Environment.this.getPhysicalSchema(schema); } }); }
public ImmutableSet<PhysicalSchema> getPhysicalSchemas() { return this.getSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema1) { return schema1.getName(); } }).collect(new Function<String, PhysicalSchema>() { @Override public PhysicalSchema valueOf(String schema) { return Environment.this.getPhysicalSchema(schema); } }); }
public ImmutableSet<String> getSchemaNames() { return this.getSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema) { return schema.getName(); } }); }
public ImmutableSet<String> getSchemaNames() { return this.getSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema) { return schema.getName(); } }); }
@Override public String valueOf(T t) { return t.getComponents().collect(new Function<SortableDependency, String>() { @Override public String valueOf(SortableDependency sortableDependency) { return "[" + sortableDependency.getChangeKey().getObjectKey().getObjectName() + "." + sortableDependency.getChangeKey().getChangeName() + "]"; } }).makeString(", "); } },
@Override public String valueOf(T t) { return t.getComponents().collect(new Function<SortableDependency, String>() { @Override public String valueOf(SortableDependency sortableDependency) { return "[" + sortableDependency.getChangeKey().getObjectKey().getObjectName() + "." + sortableDependency.getChangeKey().getChangeName() + "]"; } }).makeString(", "); } },
private Predicate<? super ChecksumEntry> getSourceChangesInclusionPredicate(final DbEnvironment env, final ImmutableList<Change> sourceChanges) { // 3) only include the predicate types that we care about ImmutableSet<String> requiredValidationObjectTypes = env.getPlatform().getRequiredValidationObjectTypes(); ImmutableSet<ChecksumEntryInclusionPredicate> checksumEntryPredicates = requiredValidationObjectTypes.collect(new Function<String, ChecksumEntryInclusionPredicate>() { @Override public ChecksumEntryInclusionPredicate valueOf(String changeType) { return createLookupIndexForObjectType(env, sourceChanges, changeType); } }); return Predicates.or(checksumEntryPredicates); }
private Predicate<? super ChecksumEntry> getSourceChangesInclusionPredicate(final DbEnvironment env, final ImmutableList<Change> sourceChanges) { // 3) only include the predicate types that we care about ImmutableSet<String> requiredValidationObjectTypes = env.getPlatform().getRequiredValidationObjectTypes(); ImmutableSet<ChecksumEntryInclusionPredicate> checksumEntryPredicates = requiredValidationObjectTypes.collect(new Function<String, ChecksumEntryInclusionPredicate>() { @Override public ChecksumEntryInclusionPredicate valueOf(String changeType) { return createLookupIndexForObjectType(env, sourceChanges, changeType); } }); return Predicates.or(checksumEntryPredicates); }
@Override public ImmutableSet<String> getGroupNamesOptional(Connection conn, PhysicalSchema physicalSchema) throws SQLException { return Sets.immutable .withAll(jdbc.query(conn, "select rolname from pg_roles", new ColumnListHandler<String>())) .collect(StringFunctions.trim()); } }
@Override public Iterable<Pair<T, SortableDependency>> valueOf(T group) { return group.getComponents().collect(Functions.pair(Functions.getFixedValue(group), Functions.<SortableDependency>getPassThru())); } });
@Override public Iterable<Pair<T, SortableDependency>> valueOf(T group) { return group.getComponents().collect(Functions.pair(Functions.getFixedValue(group), Functions.<SortableDependency>getPassThru())); } });
@Override public ImmutableSet<String> getGroupNamesOptional(Connection conn, PhysicalSchema physicalSchema) throws SQLException { return Sets.immutable .withAll(jdbc.query(conn, "select ROLE from DBA_ROLES", new ColumnListHandler<String>())) .collect(StringFunctions.trim()); }
public String getPhysicalSchemaPrefixInternal(String schema) { Validate.isTrue(getAllSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema1) { return schema1.getName(); } }).contains(schema), "Schema does not exist in the environment. Requested schema: " + schema + "; available schemas: " + getSchemaNames().makeString(",")); return ObjectUtils.defaultIfNull(this.schemaNameOverrides.get(schema), schema); }
public String getPhysicalSchemaPrefixInternal(String schema) { Validate.isTrue(getAllSchemas().collect(new Function<Schema, String>() { @Override public String valueOf(Schema schema1) { return schema1.getName(); } }).contains(schema), "Schema does not exist in the environment. Requested schema: " + schema + "; available schemas: " + getSchemaNames().makeString(",")); return ObjectUtils.defaultIfNull(this.schemaNameOverrides.get(schema), schema); }
@Override public ImmutableSet<String> getGroupNamesOptional(Connection conn, PhysicalSchema physicalSchema) throws SQLException { return Sets.immutable .withAll(jdbc.query(conn, "select ROLENAME from sysibm.SYSROLES", new ColumnListHandler<String>())) .newWithAll(jdbc.query(conn, "select GRANTEE from sysibm.SYSDBAUTH", new ColumnListHandler<String>())) .collect(StringFunctions.trim()); // db2 sometimes has whitespace in its return results that needs trimming } }
@Override public String getDisplayString() { String connectionInfo; if (this.getJdbcUrl() != null) { connectionInfo = this.getJdbcUrl(); } else if (this.getDbDataSourceName() != null) { connectionInfo = this.getDbDataSourceName(); } else if (this.getDbServer() != null) { connectionInfo = this.getDbHost() + ":" + this.getDbPort() + "/" + this.getDbServer(); } else { connectionInfo = this.getDbHost() + ":" + this.getDbPort(); } return super.getDisplayString() + ": Connecting to [" + connectionInfo + "] against schemas [" + this.getPhysicalSchemas().collect(new Function<PhysicalSchema, String>() { @Override public String valueOf(PhysicalSchema physicalSchema) { return physicalSchema.getPhysicalName(); } }).makeString(",") + "]"; }
@Override public String getDisplayString() { String connectionInfo; if (this.getJdbcUrl() != null) { connectionInfo = this.getJdbcUrl(); } else if (this.getDbDataSourceName() != null) { connectionInfo = this.getDbDataSourceName(); } else if (this.getDbServer() != null) { connectionInfo = this.getDbHost() + ":" + this.getDbPort() + "/" + this.getDbServer(); } else { connectionInfo = this.getDbHost() + ":" + this.getDbPort(); } return super.getDisplayString() + ": Connecting to [" + connectionInfo + "] against schemas [" + this.getPhysicalSchemas().collect(new Function<PhysicalSchema, String>() { @Override public String valueOf(PhysicalSchema physicalSchema) { return physicalSchema.getPhysicalName(); } }).makeString(",") + "]"; }
private Predicate<? super ChecksumEntry> getPlatformInclusionPredicate(DbEnvironment env) { // 1) exclude those tables that are excluded by default from source code, e.g. explain tables or others that users configure ImmutableSet<Predicate<? super ChecksumEntry>> schemaObjectNamePredicates = env.getSchemas().collect(new Function<Schema, Predicate<? super ChecksumEntry>>() { @Override public Predicate<? super ChecksumEntry> valueOf(Schema schema) { return schema.getObjectExclusionPredicateBuilder().build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); } }); // 2) exclude the audit tables MutableMultimap<String, String> tablesToExclude = Multimaps.mutable.set.empty(); tablesToExclude.putAll(ChangeType.TABLE_STR, Sets.immutable.with( env.getPlatform().convertDbObjectName().valueOf(getArtifactDeployerDao().getAuditContainerName()), env.getPlatform().convertDbObjectName().valueOf(dbChecksumManager.getChecksumContainerName()), env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionContainerName()), env.getPlatform().convertDbObjectName().valueOf(getDeployExecutionDao().getExecutionAttributeContainerName()) )); ObjectTypeAndNamePredicateBuilder auditTablePredicateBuilder = new ObjectTypeAndNamePredicateBuilder(tablesToExclude.toImmutable(), ObjectTypeAndNamePredicateBuilder.FilterType.EXCLUDE); Predicates<? super ChecksumEntry> auditTablePredicate = auditTablePredicateBuilder.build(ChecksumEntry.TO_OBJECT_TYPE, ChecksumEntry.TO_NAME1); return auditTablePredicate.and(schemaObjectNamePredicates); }