本文整理汇总了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());
}
}
示例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);
}
示例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;
}