This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package storm.cookbook.tfidf.functions; | |
import java.util.Map; | |
import storm.trident.operation.MultiReducer; | |
import storm.trident.operation.TridentCollector; | |
import storm.trident.operation.TridentMultiReducerContext; | |
import storm.trident.tuple.TridentTuple; | |
import backtype.storm.tuple.Values; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void test() { | |
Date start = new Date(); | |
//GraphHopper gh = new GraphHopper().forServer(); //<- this works, line below doesn't | |
GraphHopper gh = new GraphHopper().forServer().contractionHierarchies(true); | |
gh.load("./london.osm"); | |
Date end = new Date(); | |
System.out.println("Load Time: " + (end.getTime() - start.getTime())); | |
GHRequest request = new GHRequest(51.430896,0.115356, | |
51.564266,-0.219727); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings({ "rawtypes", "unchecked" }) | |
public static Stream getSentenceStream(TridentTopology topology, ITridentSpout spout){ | |
Stream sentenceStream = null; | |
if(spout == null){ | |
FixedBatchSpout fixedSpout = new FixedBatchSpout(new Fields("sentence"), 3, | |
new Values("the cow jumped over the moon"), | |
new Values("the man went to the store and bought some candy"), | |
new Values("four score and seven years ago"), | |
new Values("how many apples can you eat"), | |
new Values("to be or not to be the person")); |
NewerOlder