本文整理汇总了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;
}
示例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;
}
示例3: getAllPartitions
import scala.collection.JavaConversions; //导入方法依赖的package包/类
public static Set<TopicAndPartition> getAllPartitions() {
return JavaConversions.setAsJavaSet(zkUtilsFromKafka.getAllPartitions());
}
示例4: getSourceFiles
import scala.collection.JavaConversions; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Set<File> getSourceFiles()
{
return JavaConversions.setAsJavaSet( analysis.apis().internal().keySet() );
}
示例5: getProducts
import scala.collection.JavaConversions; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Set<File> getProducts( File sourceFile )
{
return JavaConversions.setAsJavaSet( analysis.relations().products( sourceFile ) );
}