Package tutorial.storm.trident.operations

Source Code of tutorial.storm.trident.operations.OnlyEnglish

package tutorial.storm.trident.operations;

import storm.trident.operation.BaseFilter;
import storm.trident.tuple.TridentTuple;
import twitter4j.User;


/**
* @author Enno Shioji (enno.shioji@peerindex.com)
*/
public class OnlyEnglish extends BaseFilter {
    @Override
    public boolean isKeep(TridentTuple tuple) {
        User user = (User)tuple.get(0);

        return "en".equals(user.getLang());
    }
}
TOP

Related Classes of tutorial.storm.trident.operations.OnlyEnglish

TOP
Copyright © 2018 www.massapi.com. 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.