当前位置: 首页>>代码示例>>Java>>正文


Java Sets.newHashSet方法代码示例

本文整理汇总了Java中jersey.repackaged.com.google.common.collect.Sets.newHashSet方法的典型用法代码示例。如果您正苦于以下问题:Java Sets.newHashSet方法的具体用法?Java Sets.newHashSet怎么用?Java Sets.newHashSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jersey.repackaged.com.google.common.collect.Sets的用法示例。


在下文中一共展示了Sets.newHashSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateFederatedMetastoreDatabases

import jersey.repackaged.com.google.common.collect.Sets; //导入方法依赖的package包/类
private void validateFederatedMetastoreDatabases(List<String> mappableDatabases, MetaStoreMapping metaStoreMapping) {
  try {
    Set<String> allPrimaryDatabases = Sets.newHashSet(primaryDatabasesCache.get(PRIMARY_KEY));
    for (String database : mappableDatabases) {
      if (allPrimaryDatabases.contains(database.toLowerCase())) {
        throw new WaggleDanceException("Database clash, found '"
            + database
            + "' to be mapped for the federated metastore '"
            + metaStoreMapping.getMetastoreMappingName()
            + "' already present in the primary database, please remove the database from the list it can't be accessed via Waggle Dance");
      }
      if (mappingsByDatabaseName.containsKey(database.toLowerCase())) {
        throw new WaggleDanceException("Database clash, found '"
            + database
            + "' to be mapped for the federated metastore '"
            + metaStoreMapping.getMetastoreMappingName()
            + "' already present in another federated database, please remove the database from the list it can't be accessed via Waggle Dance");
      }
    }
  } catch (ExecutionException e) {
    throw new WaggleDanceException("Can't validate database clashes", e.getCause());
  }
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:24,代码来源:StaticDatabaseMappingService.java

示例2: testMethodGauges

import jersey.repackaged.com.google.common.collect.Sets; //导入方法依赖的package包/类
@Test
public void testMethodGauges() throws Exception {
  Configuration conf = new Configuration();
  conf.set(LensConfConstants.QUERY_METRIC_UNIQUE_ID_CONF_KEY, TestQueryMetrics.class.getSimpleName());
  conf.set(LensConfConstants.QUERY_METRIC_DRIVER_STACK_NAME, "testCubeRewriteStackName");

  rewriteCtx("select" + " SUM(msr2) from testCube where " + TWO_DAYS_RANGE, conf);
  MetricRegistry reg = LensMetricsRegistry.getStaticRegistry();
  CubeQueryRewriter cubeQueryRewriter = new CubeQueryRewriter(new Configuration(), new HiveConf());
  Set<String> expected = Sets.newHashSet();
  int index = 0;
  for (ContextRewriter contextRewriter : cubeQueryRewriter.getRewriters()) {
    expected.add("lens.MethodMetricGauge.testCubeRewriteStackName-"
      + contextRewriter.getClass().getName() + "-ITER-" + index);
    index++;
  }
  Assert.assertEquals(reg.getGauges().keySet(), expected);
}
 
开发者ID:apache,项目名称:lens,代码行数:19,代码来源:TestQueryMetrics.java

示例3: getClasses

import jersey.repackaged.com.google.common.collect.Sets; //导入方法依赖的package包/类
@Override
public Set<Class<?>> getClasses() {
    Set<Class<?>> classes = Sets.newHashSet();
    classes.add(GreetingEndpoint.class);
    return classes;
}
 
开发者ID:joshlong,项目名称:boot-examples,代码行数:7,代码来源:Application.java


注:本文中的jersey.repackaged.com.google.common.collect.Sets.newHashSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。