storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/3] storm git commit: STORM-2276 Remove twitter4j usages due to license issue (JSON.org is catalog X)
Date Fri, 06 Jan 2017 08:55:50 GMT
Repository: storm
Updated Branches:
  refs/heads/1.x-branch f75f3e3e3 -> c364f4daa


STORM-2276 Remove twitter4j usages due to license issue (JSON.org is catalog X)


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/e4cff9ba
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/e4cff9ba
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/e4cff9ba

Branch: refs/heads/1.x-branch
Commit: e4cff9ba5ca5015e3230211798d5e0dfacbf382f
Parents: f75f3e3
Author: Jungtaek Lim <kabhwan@gmail.com>
Authored: Thu Jan 5 13:05:11 2017 +0900
Committer: Jungtaek Lim <kabhwan@gmail.com>
Committed: Thu Jan 5 13:05:11 2017 +0900

----------------------------------------------------------------------
 examples/storm-starter/pom.xml                  |   5 -
 .../apache/storm/starter/PrintSampleStream.java |  58 -------
 .../storm/starter/spout/TwitterSampleSpout.java | 164 -------------------
 3 files changed, 227 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/e4cff9ba/examples/storm-starter/pom.xml
----------------------------------------------------------------------
diff --git a/examples/storm-starter/pom.xml b/examples/storm-starter/pom.xml
index 205f97d..5e981e4 100644
--- a/examples/storm-starter/pom.xml
+++ b/examples/storm-starter/pom.xml
@@ -79,11 +79,6 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-     <groupId>org.twitter4j</groupId>
-     <artifactId>twitter4j-stream</artifactId>
-     <version>3.0.3</version>
-    </dependency>
-    <dependency>
       <groupId>org.apache.storm</groupId>
       <artifactId>storm-core</artifactId>
       <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/storm/blob/e4cff9ba/examples/storm-starter/src/jvm/org/apache/storm/starter/PrintSampleStream.java
----------------------------------------------------------------------
diff --git a/examples/storm-starter/src/jvm/org/apache/storm/starter/PrintSampleStream.java
b/examples/storm-starter/src/jvm/org/apache/storm/starter/PrintSampleStream.java
deleted file mode 100644
index 466fca0..0000000
--- a/examples/storm-starter/src/jvm/org/apache/storm/starter/PrintSampleStream.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.starter;
-
-import java.util.Arrays;
-
-import org.apache.storm.Config;
-import org.apache.storm.LocalCluster;
-import org.apache.storm.topology.TopologyBuilder;
-import org.apache.storm.utils.Utils;
-
-import org.apache.storm.starter.bolt.PrinterBolt;
-import org.apache.storm.starter.spout.TwitterSampleSpout;
-
-public class PrintSampleStream {        
-    public static void main(String[] args) {
-        String consumerKey = args[0]; 
-        String consumerSecret = args[1]; 
-        String accessToken = args[2]; 
-        String accessTokenSecret = args[3];
-        String[] arguments = args.clone();
-        String[] keyWords = Arrays.copyOfRange(arguments, 4, arguments.length);
-        
-        TopologyBuilder builder = new TopologyBuilder();
-        
-        builder.setSpout("twitter", new TwitterSampleSpout(consumerKey, consumerSecret,
-                                accessToken, accessTokenSecret, keyWords));
-        builder.setBolt("print", new PrinterBolt())
-                .shuffleGrouping("twitter");
-                
-                
-        Config conf = new Config();
-        
-        
-        LocalCluster cluster = new LocalCluster();
-        
-        cluster.submitTopology("test", conf, builder.createTopology());
-        
-        Utils.sleep(10000);
-        cluster.shutdown();
-    }
-}

http://git-wip-us.apache.org/repos/asf/storm/blob/e4cff9ba/examples/storm-starter/src/jvm/org/apache/storm/starter/spout/TwitterSampleSpout.java
----------------------------------------------------------------------
diff --git a/examples/storm-starter/src/jvm/org/apache/storm/starter/spout/TwitterSampleSpout.java
b/examples/storm-starter/src/jvm/org/apache/storm/starter/spout/TwitterSampleSpout.java
deleted file mode 100644
index e8a2c05..0000000
--- a/examples/storm-starter/src/jvm/org/apache/storm/starter/spout/TwitterSampleSpout.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.storm.starter.spout;
-
-import java.util.Map;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import twitter4j.FilterQuery;
-import twitter4j.StallWarning;
-import twitter4j.Status;
-import twitter4j.StatusDeletionNotice;
-import twitter4j.StatusListener;
-import twitter4j.TwitterStream;
-import twitter4j.TwitterStreamFactory;
-import twitter4j.auth.AccessToken;
-import twitter4j.conf.ConfigurationBuilder;
-
-import org.apache.storm.Config;
-import org.apache.storm.spout.SpoutOutputCollector;
-import org.apache.storm.task.TopologyContext;
-import org.apache.storm.topology.OutputFieldsDeclarer;
-import org.apache.storm.topology.base.BaseRichSpout;
-import org.apache.storm.tuple.Fields;
-import org.apache.storm.tuple.Values;
-import org.apache.storm.utils.Utils;
-
-@SuppressWarnings("serial")
-public class TwitterSampleSpout extends BaseRichSpout {
-
-	SpoutOutputCollector _collector;
-	LinkedBlockingQueue<Status> queue = null;
-	TwitterStream _twitterStream;
-	String consumerKey;
-	String consumerSecret;
-	String accessToken;
-	String accessTokenSecret;
-	String[] keyWords;
-
-	public TwitterSampleSpout(String consumerKey, String consumerSecret,
-			String accessToken, String accessTokenSecret, String[] keyWords) {
-		this.consumerKey = consumerKey;
-		this.consumerSecret = consumerSecret;
-		this.accessToken = accessToken;
-		this.accessTokenSecret = accessTokenSecret;
-		this.keyWords = keyWords;
-	}
-
-	public TwitterSampleSpout() {
-		// TODO Auto-generated constructor stub
-	}
-
-	@Override
-	public void open(Map conf, TopologyContext context,
-			SpoutOutputCollector collector) {
-		queue = new LinkedBlockingQueue<Status>(1000);
-		_collector = collector;
-
-		StatusListener listener = new StatusListener() {
-
-			@Override
-			public void onStatus(Status status) {
-			
-				queue.offer(status);
-			}
-
-			@Override
-			public void onDeletionNotice(StatusDeletionNotice sdn) {
-			}
-
-			@Override
-			public void onTrackLimitationNotice(int i) {
-			}
-
-			@Override
-			public void onScrubGeo(long l, long l1) {
-			}
-
-			@Override
-			public void onException(Exception ex) {
-			}
-
-			@Override
-			public void onStallWarning(StallWarning arg0) {
-				// TODO Auto-generated method stub
-
-			}
-
-		};
-
-		_twitterStream = new TwitterStreamFactory(
-				new ConfigurationBuilder().setJSONStoreEnabled(true).build())
-				.getInstance();
-
-		_twitterStream.addListener(listener);
-		_twitterStream.setOAuthConsumer(consumerKey, consumerSecret);
-		AccessToken token = new AccessToken(accessToken, accessTokenSecret);
-		_twitterStream.setOAuthAccessToken(token);
-		
-		if (keyWords.length == 0) {
-
-			_twitterStream.sample();
-		}
-
-		else {
-
-			FilterQuery query = new FilterQuery().track(keyWords);
-			_twitterStream.filter(query);
-		}
-
-	}
-
-	@Override
-	public void nextTuple() {
-		Status ret = queue.poll();
-		if (ret == null) {
-			Utils.sleep(50);
-		} else {
-			_collector.emit(new Values(ret));
-
-		}
-	}
-
-	@Override
-	public void close() {
-		_twitterStream.shutdown();
-	}
-
-	@Override
-	public Map<String, Object> getComponentConfiguration() {
-		Config ret = new Config();
-		ret.setMaxTaskParallelism(1);
-		return ret;
-	}
-
-	@Override
-	public void ack(Object id) {
-	}
-
-	@Override
-	public void fail(Object id) {
-	}
-
-	@Override
-	public void declareOutputFields(OutputFieldsDeclarer declarer) {
-		declarer.declare(new Fields("tweet"));
-	}
-
-}


Mime
View raw message