本文整理汇总了Java中org.apache.storm.guava.collect.Sets类的典型用法代码示例。如果您正苦于以下问题:Java Sets类的具体用法?Java Sets怎么用?Java Sets使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Sets类属于org.apache.storm.guava.collect包,在下文中一共展示了Sets类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StopWords
import org.apache.storm.guava.collect.Sets; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private StopWords() {
m_stopwords = Sets.newHashSet(STOP_WORDS);
List<String> files = Configuration.getStopWords();
if (files != null) {
for (String file : files) {
// Try deserialization of file
String serializationFile = file + ".ser";
if (IOUtils.exists(serializationFile)) {
LOG.info("Deserialize FirstNames from: " + serializationFile);
m_stopwords.addAll((Set<String>) SerializationUtils
.deserialize(serializationFile));
} else {
LOG.info("Load StopWords from: " + file);
Set<String> stopWords = FileUtils.readFile(file, true);
SerializationUtils.serializeCollection(stopWords, serializationFile);
m_stopwords.addAll(stopWords);
}
}
}
}
示例2: StopWords
import org.apache.storm.guava.collect.Sets; //导入依赖的package包/类
private StopWords() {
m_stopwords = Sets.newHashSet(STOP_WORDS);
List<String> files = Configuration.getStopWords();
if (files != null) {
for (String file : files) {
LOG.info("Load StopWords from: " + file);
m_stopwords.addAll(FileUtils.readFile(file));
}
}
}