org.eclipse.collections.api.set.MutableSet.withAll()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(72)

本文整理了Java中org.eclipse.collections.api.set.MutableSet.withAll()方法的一些代码示例,展示了MutableSet.withAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MutableSet.withAll()方法的具体详情如下:
包路径:org.eclipse.collections.api.set.MutableSet
类名称:MutableSet
方法名:withAll

MutableSet.withAll介绍

暂无

代码示例

代码示例来源:origin: com.goldmansachs.obevo/obevo-db

private ImmutableList<DbCleanCommand> getDropStatements(PhysicalSchema physicalSchema) {
  DaCatalog database = this.dbMetadataManager.getDatabase(physicalSchema, new DaSchemaInfoLevel().setRetrieveAllObjectsMinimum().setRetrieveTableForeignKeys(true), true, true);
  MutableSet<DbCleanCommand> cleanCommands = Sets.mutable.empty();
  cleanCommands.withAll(getRoutineDrops(database, physicalSchema));
  cleanCommands.withAll(getTableDrops(database, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getPackages(), ChangeType.PACKAGE_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getSequences(), ChangeType.SEQUENCE_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getSynonyms(), ChangeType.SYNONYM_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getRules(), ChangeType.RULE_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getUserTypes(), ChangeType.USERTYPE_STR, physicalSchema));
  return cleanCommands.toList().toImmutable();
}

代码示例来源:origin: goldmansachs/obevo

private ImmutableList<DbCleanCommand> getDropStatements(PhysicalSchema physicalSchema) {
  DaCatalog database = this.dbMetadataManager.getDatabase(physicalSchema, new DaSchemaInfoLevel().setRetrieveAllObjectsMinimum().setRetrieveTableForeignKeys(true), true, true);
  MutableSet<DbCleanCommand> cleanCommands = Sets.mutable.empty();
  cleanCommands.withAll(getRoutineDrops(database, physicalSchema));
  cleanCommands.withAll(getTableDrops(database, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getPackages(), ChangeType.PACKAGE_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getSequences(), ChangeType.SEQUENCE_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getSynonyms(), ChangeType.SYNONYM_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getRules(), ChangeType.RULE_STR, physicalSchema));
  cleanCommands.withAll(getObjectDrops(database.getUserTypes(), ChangeType.USERTYPE_STR, physicalSchema));
  return cleanCommands.toList().toImmutable();
}

代码示例来源:origin: goldmansachs/obevo

private void generate(String schema) {
  MutableSet<MyInput> inputs = Sets.mutable.empty();
  inputs.withAll(getUserTypes(numTypes));
  inputs.withAll(getTables());
  inputs.withAll(getViews());
  inputs.withAll(getSps());
  MutableSet<String> types = Sets.mutable.of("table", "view", "sp", "usertype");
  File outputDir = new File("./target/testoutput");
  FileUtils.deleteQuietly(outputDir);
  outputDir.mkdirs();
  for (MyInput input : inputs) {
    MutableMap<String, Object> params = Maps.mutable.<String, Object>empty().withKeyValue(
        "name", input.getName()
    );
    for (String type : types) {
      params.put("dependent" + type + "s", input.getDependenciesByType().get(type));
    }
    File outputFile = new File(outputDir, schema + "/" + input.getType() + "/" + input.getName() + ".sql");
    outputFile.getParentFile().mkdirs();
    TestTemplateUtil.getInstance().writeTemplate("schemagen/" + input.getType() + ".sql.ftl", params, outputFile);
  }
}

代码示例来源:origin: com.goldmansachs.obevo/obevo-db-db2

@VisibleForTesting
MutableSet<SchemaObjectRow> getInvalidObjects(Connection conn, RichIterable<PhysicalSchema> physicalSchemas) {
  LOG.info("Checking for invalid objects");
  String schemaInClause = physicalSchemas.collect(new Function<PhysicalSchema, String>() {
    @Override
    public String valueOf(PhysicalSchema physicalSchema) {
      return physicalSchema.getPhysicalName();
    }
  }).makeString("('", "','", "')");
  MutableSet<SchemaObjectRow> oldInvalidObjects = queryOldInvalidObjects(conn, schemaInClause);
  try {
    MutableSet<SchemaObjectRow> newInvalidObjects = queryNewInvalidObjects(conn, schemaInClause);
    if (oldInvalidObjects.isEmpty() && newInvalidObjects.notEmpty()) {
      deployMetricsCollector.addMetric("invalidObjectQuery.resultsOnlyInNew", true);
    } else if (oldInvalidObjects.notEmpty() && newInvalidObjects.isEmpty()) {
      deployMetricsCollector.addMetric("invalidObjectQuery.resultsOnlyInOld", true);
    }
    return oldInvalidObjects.withAll(newInvalidObjects);
  } catch (DataAccessException e) {
    deployMetricsCollector.addMetric("oldInvalidObjectQueryRequired", true);
    LOG.debug("Failed to execute new invalid objects SQL; falling back to old query");
    return oldInvalidObjects;
  }
}

代码示例来源:origin: goldmansachs/obevo

@VisibleForTesting
MutableSet<SchemaObjectRow> getInvalidObjects(Connection conn, RichIterable<PhysicalSchema> physicalSchemas) {
  LOG.info("Checking for invalid objects");
  String schemaInClause = physicalSchemas.collect(new Function<PhysicalSchema, String>() {
    @Override
    public String valueOf(PhysicalSchema physicalSchema) {
      return physicalSchema.getPhysicalName();
    }
  }).makeString("('", "','", "')");
  MutableSet<SchemaObjectRow> oldInvalidObjects = queryOldInvalidObjects(conn, schemaInClause);
  try {
    MutableSet<SchemaObjectRow> newInvalidObjects = queryNewInvalidObjects(conn, schemaInClause);
    if (oldInvalidObjects.isEmpty() && newInvalidObjects.notEmpty()) {
      deployMetricsCollector.addMetric("invalidObjectQuery.resultsOnlyInNew", true);
    } else if (oldInvalidObjects.notEmpty() && newInvalidObjects.isEmpty()) {
      deployMetricsCollector.addMetric("invalidObjectQuery.resultsOnlyInOld", true);
    }
    return oldInvalidObjects.withAll(newInvalidObjects);
  } catch (DataAccessException e) {
    deployMetricsCollector.addMetric("oldInvalidObjectQueryRequired", true);
    LOG.debug("Failed to execute new invalid objects SQL; falling back to old query");
    return oldInvalidObjects;
  }
}

代码示例来源:origin: goldmansachs/obevo

SetIterable<String> allChecksumKeys = newChecksumMap.keysView().toSet().withAll(existingChecksumMap.keysView());

代码示例来源:origin: com.goldmansachs.obevo/obevo-db

SetIterable<String> allChecksumKeys = newChecksumMap.keysView().toSet().withAll(existingChecksumMap.keysView());

相关文章

微信公众号

最新文章

更多