@Override public boolean accept(String key) { return !TextMarkupDocumentSection.this.toggles.contains(key); } }));
@Override public boolean accept(String key) { return !TextMarkupDocumentSection.this.toggles.contains(key); } }));
@Override public boolean accept(String each) { return values.contains(each); }
@Override public boolean accept(String each) { return values.contains(each); }
public boolean isTogglePresent(String toggle) { return this.toggles.contains(toggle); }
public boolean isTogglePresent(String toggle) { return this.toggles.contains(toggle); }
@Override public boolean accept(Change it) { return env.getSchemaNames().contains(it.getSchema()); } }).toImmutable();
@Override public boolean accept(Change change) { return change.getChangeset() != null && changesetNames.contains(change.getChangeset()); } };
@Override public boolean accept(Change change) { return change.getChangeset() != null && changesetNames.contains(change.getChangeset()); } };
@Override public boolean accept(Change it) { return env.getSchemaNames().contains(it.getSchema()); } }).toImmutable();
private String tokenizeDefaultSchema(String schema, String content, ChangeType objType, String objectName) { ImmutableSet<String> tokenizableChangeTypes = Sets.immutable.with(ChangeType.FUNCTION_STR, ChangeType.SP_STR, ChangeType.VIEW_STR, UnclassifiedChangeType.INSTANCE.getName()); // only tokenize the schema name for functions, sps, views, and other if (tokenizableChangeTypes.contains(objType.getName())) { File tempFile; try { // ensure the prefix is at least 3 chars long. Otherwise it will fail String padName = ""; if (objectName.length() < 3) { padName = "123"; } tempFile = File.createTempFile(objectName + padName, ".sql"); } catch (IOException e) { throw new RuntimeException("failed creating a temp file for " + objectName, e); } System.out.println("using temp file " + tempFile); // tokenize the default schema String tokenName = "${" + schema.toLowerCase() + ".token}"; content = content.replace(schema.toLowerCase() + ".", tokenName + "."); content = content.replace(schema.toUpperCase() + ".", tokenName + "."); FileUtilsCobra.writeStringToFile(tempFile, content); return content; } return content; }
private String tokenizeDefaultSchema(String schema, String content, ChangeType objType, String objectName) { ImmutableSet<String> tokenizableChangeTypes = Sets.immutable.with(ChangeType.FUNCTION_STR, ChangeType.SP_STR, ChangeType.VIEW_STR, UnclassifiedChangeType.INSTANCE.getName()); // only tokenize the schema name for functions, sps, views, and other if (tokenizableChangeTypes.contains(objType.getName())) { File tempFile; try { // ensure the prefix is at least 3 chars long. Otherwise it will fail String padName = ""; if (objectName.length() < 3) { padName = "123"; } tempFile = File.createTempFile(objectName + padName, ".sql"); } catch (IOException e) { throw new RuntimeException("failed creating a temp file for " + objectName, e); } System.out.println("using temp file " + tempFile); // tokenize the default schema String tokenName = "${" + schema.toLowerCase() + ".token}"; content = content.replace(schema.toLowerCase() + ".", tokenName + "."); content = content.replace(schema.toUpperCase() + ".", tokenName + "."); FileUtilsCobra.writeStringToFile(tempFile, content); return content; } return content; }
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 RerunnableObjectInfo value(RerunnableObjectInfo rerunnableObjectInfo1, ChangePair changePair) { // TODO make this a bit more OO, e.g. avoid the instanceof all over the place Change source = changePair.getSourceChange(); Change deployed = changePair.getDeployedChange(); if (source == null && deployed == null) { // this branch and exception throwing here is to avoid null deference warnings in findbugs for the next else branch throw new IllegalStateException("This code branch should never happen; either of source or deployed should exist"); } if (source == null && deployed != null) { // In this case - the change exists in the target DB but was removed from the source rerunnableObjectInfo1.addDroppedObject(deployed); } else if (source != null && deployed == null) { rerunnableObjectInfo1.addChangedObject(source); } else if (ObjectUtils.equals(source.getContentHash(), deployed.getContentHash()) || source.getAcceptableHashes().contains(deployed.getContentHash())) { // In this case - the change exists in both the source and target db. // We need to check if anything has changed, using the hash LOG.trace("Nothing to do here; source [{}] and target [{}] match in hash", source, deployed); } else { rerunnableObjectInfo1.addChangedObject(source); } return rerunnableObjectInfo1; } });
@Override public RerunnableObjectInfo value(RerunnableObjectInfo rerunnableObjectInfo1, ChangePair changePair) { // TODO make this a bit more OO, e.g. avoid the instanceof all over the place Change source = changePair.getSourceChange(); Change deployed = changePair.getDeployedChange(); if (source == null && deployed == null) { // this branch and exception throwing here is to avoid null deference warnings in findbugs for the next else branch throw new IllegalStateException("This code branch should never happen; either of source or deployed should exist"); } if (source == null && deployed != null) { // In this case - the change exists in the target DB but was removed from the source rerunnableObjectInfo1.addDroppedObject(deployed); } else if (source != null && deployed == null) { rerunnableObjectInfo1.addChangedObject(source); } else if (ObjectUtils.equals(source.getContentHash(), deployed.getContentHash()) || source.getAcceptableHashes().contains(deployed.getContentHash())) { // In this case - the change exists in both the source and target db. // We need to check if anything has changed, using the hash LOG.trace("Nothing to do here; source [{}] and target [{}] match in hash", source, deployed); } else { rerunnableObjectInfo1.addChangedObject(source); } return rerunnableObjectInfo1; } });
if (!changesForTypeSet.contains(changeToAddBack)) { newChangesToAdd.add(changeToAddBack);
if (!changesForTypeSet.contains(changeToAddBack)) { newChangesToAdd.add(changeToAddBack);
for (ImmutableHierarchicalConfiguration schemaOverride : iterConfig(envCfg, "schemaOverrides.schemaOverride")) { String schema = schemaOverride.getString("schema"); if (schemaNames.contains(schema)) { schemaNameOverrides.put(schema, schemaOverride.getString("overrideValue")); } else {
for (ImmutableHierarchicalConfiguration schemaOverride : iterConfig(envCfg, "schemaOverrides.schemaOverride")) { String schema = schemaOverride.getString("schema"); if (schemaNames.contains(schema)) { schemaNameOverrides.put(schema, schemaOverride.getString("overrideValue")); } else {