Package tutorial.storm.trident.operations

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

package tutorial.storm.trident.operations;

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


/**
* @author Enno Shioji (enno.shioji@peerindex.com)
*/
public class OnlyGeo extends BaseFilter {
    @Override
    public boolean isKeep(TridentTuple tuple) {
        Status status = (Status) tuple.get(0);
        return !(null == status.getPlace() || null == status.getPlace().getCountryCode());
    }
}
TOP

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

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.