private static DataStream<String> getTextDataStream(
StreamExecutionEnvironment env) {
if (fromFile) {
// read the text file from given input path
return env.addSource(new TwitterSource(path));
} else {
// get default test text data
return env.fromElements(TwitterStreamData.TEXTS);
}
}