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


Java JavaConversions.setAsJavaSet方法代码示例

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


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

示例1: topicMetaData

import scala.collection.JavaConversions; //导入方法依赖的package包/类
/**
 * Returns the metadata for the specified topic names
 * @param topicNames The topic names to retrieve metadata for, or null/empty array for all topics
 * @return a map of TopicMetadatas keyed by topic name 
 */
public Map<String, TopicMetadata> topicMetaData(final String...topicNames) {
	if(!connected.get()) throw new IllegalStateException("The KafkaTestServer is not running");
	final Set<String> set = (topicNames==null || topicNames.length==0) ? topicNames() : new LinkedHashSet<String>(Arrays.asList(topicNames));		
	final Set<TopicMetadata> meta = JavaConversions.setAsJavaSet(AdminUtils.fetchTopicMetadataFromZk(JavaConverters.asScalaSetConverter(set).asScala(), zkUtils));
	final Map<String, TopicMetadata> map = new HashMap<String, TopicMetadata>(meta.size());
	for(TopicMetadata tm: meta) {
		map.put(tm.topic(), tm);
	}
	return map;
}
 
开发者ID:nickman,项目名称:HeliosStreams,代码行数:16,代码来源:KafkaAdminClient.java

示例2: topicMetaData

import scala.collection.JavaConversions; //导入方法依赖的package包/类
/**
 * Returns the metadata for the specified topic names
 * @param topicNames The topic names to retrieve metadata for, or null/empty array for all topics
 * @return a map of TopicMetadatas keyed by topic name 
 */
public Map<String, TopicMetadata> topicMetaData(final String...topicNames) {
	if(!running.get()) throw new IllegalStateException("The KafkaTestServer is not running");
	final ZkUtils z = getZkUtils();
	final Set<String> set = (topicNames==null || topicNames.length==0) ? topicNames() : new LinkedHashSet<String>(Arrays.asList(topicNames));		
	final Set<TopicMetadata> meta = JavaConversions.setAsJavaSet(AdminUtils.fetchTopicMetadataFromZk(JavaConverters.asScalaSetConverter(set).asScala(), z));
	final Map<String, TopicMetadata> map = new HashMap<String, TopicMetadata>(meta.size());
	for(TopicMetadata tm: meta) {
		map.put(tm.topic(), tm);
	}
	return map;
}
 
开发者ID:nickman,项目名称:HeliosStreams,代码行数:17,代码来源:KafkaTestServer.java

示例3: getAllPartitions

import scala.collection.JavaConversions; //导入方法依赖的package包/类
public static Set<TopicAndPartition> getAllPartitions() {
	return JavaConversions.setAsJavaSet(zkUtilsFromKafka.getAllPartitions());
}
 
开发者ID:chickling,项目名称:kmanager,代码行数:4,代码来源:ZKUtils.java

示例4: getSourceFiles

import scala.collection.JavaConversions; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Set<File> getSourceFiles()
{
    return JavaConversions.setAsJavaSet( analysis.apis().internal().keySet() );
}
 
开发者ID:sbt-compiler-maven-plugin,项目名称:sbt-compiler-maven-plugin,代码行数:9,代码来源:SBT013Analysis.java

示例5: getProducts

import scala.collection.JavaConversions; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Set<File> getProducts( File sourceFile )
{
    return JavaConversions.setAsJavaSet( analysis.relations().products( sourceFile ) );
}
 
开发者ID:sbt-compiler-maven-plugin,项目名称:sbt-compiler-maven-plugin,代码行数:9,代码来源:SBT013Analysis.java


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