Package tutorial.storm.trident.testutil

Examples of tutorial.storm.trident.testutil.Content


*/
public class GetContentName extends BaseFunction {

    @Override
    public void execute(TridentTuple objects, TridentCollector tridentCollector) {
        Content content = (Content) objects.getValueByField("content");
        tridentCollector.emit(new Values(content.getContentName()));
    }
View Full Code Here


public class ExtractLocation extends BaseFunction {

    @Override
    public void execute(TridentTuple tuple, TridentCollector collector) {
        Status status = (Status) tuple.get(0);
        Content content = (Content) tuple.get(1);

        collector.emit(new Values(status.getPlace().getCountryCode(), content.getContentName()));
    }
View Full Code Here

*/
public class OnlyUrls extends BaseFilter {

    @Override
    public boolean isKeep(TridentTuple tuple) {
        Content content = (Content) tuple.getValueByField("content");
        return "url".equals(content.getContentType());
    }
View Full Code Here

*/
public class TweetIdExtractor extends BaseFunction {

    @Override
    public void execute(TridentTuple objects, TridentCollector tridentCollector) {
        Content content = (Content) objects.getValueByField("content");
        tridentCollector.emit(new Values(content.getTweetId()));
    }
View Full Code Here

* @author Enno Shioji (enno.shioji@peerindex.com)
*/
public class OnlyHashtags extends BaseFilter {
    @Override
    public boolean isKeep(TridentTuple tuple) {
        Content content = (Content)tuple.get(0);
        return "hashtag".equals(content.getContentType());
    }
View Full Code Here

* @author Enno Shioji (enno.shioji@peerindex.com)
*/
public class ExtractFollowerClassAndContentName extends BaseFunction {
    @Override
    public void execute(TridentTuple tuple, TridentCollector collector) {
        Content content = (Content)tuple.get(0);
        User user = (User)tuple.get(1);

        String followerClass = classify(user.getFollowersCount());

        collector.emit(new Values(followerClass, content.getContentName()));
    }
View Full Code Here

TOP

Related Classes of tutorial.storm.trident.testutil.Content

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.