@Override public MutableSetMultimap<V, K> flip() { synchronized (this.lock) { return this.getDelegate().flip(); } }
@Override public MutableSetMultimap<V, K> flip() { return this.getMutableMap().flip(); }
@Override public MutableSetMultimap<V, K> flip() { return this.getMutableMap().flip(); }
@Override public MutableSetMultimap<V, K> flip() { synchronized (this.lock) { return this.getDelegate().flip(); } }
@Override public MutableSetMultimap<V, K> flip() { return this.getMutableMap().flip(); }
@Override public MutableSetMultimap<V, K> flip() { synchronized (this.lock) { return this.getDelegate().flip(); } }
/** * Returns true/false if all the schemas in the environment either need rollback (true) or don't (false). * * If some do and some don't, an exception is thrown. */ @Override public boolean determineRollback(final String productVersion, final ImmutableSet<String> schemas, final DeployExecutionDao deployExecutionDao) { MutableMap<String, Boolean> rollbackFlags = schemas.toMap( Functions.<String>getPassThru(), new Function<String, Boolean>() { @Override public Boolean valueOf(String schema) { LOG.info("Checking rollback status on Product Version {} and Schema {}", productVersion, schema); return DefaultRollbackDetector.this.determineRollbackForSchema(productVersion, deployExecutionDao.getDeployExecutions(schema)); } } ); MutableSet<Boolean> values = rollbackFlags.valuesView().toSet(); if (values.size() > 1) { MutableSetMultimap<Boolean, String> schemasByRollbackFlag = rollbackFlags.flip(); MutableSet<String> rollbackSchemas = schemasByRollbackFlag.get(Boolean.TRUE); MutableSet<String> nonrollbackSchemas = schemasByRollbackFlag.get(Boolean.FALSE); throw new IllegalArgumentException("The following schemas were calculated for rollback [" + rollbackSchemas + "], though the rest were not [" + nonrollbackSchemas + "]; cannot proceed in this mixed mode"); } return values.iterator().next().booleanValue(); }
/** * Returns true/false if all the schemas in the environment either need rollback (true) or don't (false). * * If some do and some don't, an exception is thrown. */ @Override public boolean determineRollback(final String productVersion, final ImmutableSet<String> schemas, final DeployExecutionDao deployExecutionDao) { MutableMap<String, Boolean> rollbackFlags = schemas.toMap( Functions.<String>getPassThru(), new Function<String, Boolean>() { @Override public Boolean valueOf(String schema) { LOG.info("Checking rollback status on Product Version {} and Schema {}", productVersion, schema); return DefaultRollbackDetector.this.determineRollbackForSchema(productVersion, deployExecutionDao.getDeployExecutions(schema)); } } ); MutableSet<Boolean> values = rollbackFlags.valuesView().toSet(); if (values.size() > 1) { MutableSetMultimap<Boolean, String> schemasByRollbackFlag = rollbackFlags.flip(); MutableSet<String> rollbackSchemas = schemasByRollbackFlag.get(Boolean.TRUE); MutableSet<String> nonrollbackSchemas = schemasByRollbackFlag.get(Boolean.FALSE); throw new IllegalArgumentException("The following schemas were calculated for rollback [" + rollbackSchemas + "], though the rest were not [" + nonrollbackSchemas + "]; cannot proceed in this mixed mode"); } return values.iterator().next().booleanValue(); }