本文整理匯總了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 ) );
}