本文整理汇总了Java中backtype.storm.spout.Scheme类的典型用法代码示例。如果您正苦于以下问题:Java Scheme类的具体用法?Java Scheme怎么用?Java Scheme使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Scheme类属于backtype.storm.spout包,在下文中一共展示了Scheme类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FileSpout
import backtype.storm.spout.Scheme; //导入依赖的package包/类
public FileSpout(String dir, String filter, Scheme scheme) {
Path pdir = Paths.get(dir);
List<String> f = new LinkedList<String>();
try (DirectoryStream<Path> stream = Files.newDirectoryStream(pdir,
filter)) {
for (Path entry : stream) {
String inputFile = entry.toAbsolutePath().toString();
f.add(inputFile);
LOG.info("Input : {}", inputFile);
}
} catch (IOException ioe) {
LOG.error("IOException: %s%n", ioe);
}
_inputFiles = f.toArray(new String[f.size()]);
_scheme = scheme;
}
示例2: getSchemeFromClassName
import backtype.storm.spout.Scheme; //导入依赖的package包/类
private static Scheme getSchemeFromClassName(String spoutSchemeCls) throws Exception {
return (Scheme)Class.forName(spoutSchemeCls).getConstructor().newInstance();
}
示例3: BasicSchemeSpout
import backtype.storm.spout.Scheme; //导入依赖的package包/类
public BasicSchemeSpout(final Scheme scheme) {
Validate.notNull(scheme, "Scheme is required");
this.scheme = scheme;
}
示例4: KafkaSpout
import backtype.storm.spout.Scheme; //导入依赖的package包/类
/**
* Default constructor. Actual Kafka consumers are be created and started on {@link #open()}.
*
* @param kafkaProperties
* Properties to be used when constructing the Kafka {@link ConsumerConnector}.
* @param topic
* The Kafka topic to consumer from.
* @param scheme
* A {@link Scheme} that will be responsible for deserializing messages coming from Kafka. Whatever objects
* this produces needs to be natively understood by Storm or needs to be <a
* href="https://github.com/nathanmarz/storm/wiki/Serialization">registered with Storm</a> as a serializable
* type. Your best bet however is to stick to "native" types and use the internal tuple structure.
*/
public KafkaSpout(final Properties kafkaProperties, final String topic, final Scheme scheme) {
super(scheme);
this.kafkaProperties = kafkaProperties;
this.topic = topic;
}
示例5: getScheme
import backtype.storm.spout.Scheme; //导入依赖的package包/类
Scheme getScheme();
示例6: setScheme
import backtype.storm.spout.Scheme; //导入依赖的package包/类
void setScheme(Scheme scheme);