當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。