public class TwitterEngagersProvider extends TwitterTimelineProvider implements StreamsProvider, Serializable
Modifier and Type | Field and Description |
---|---|
protected com.google.common.util.concurrent.ListeningExecutorService |
executor |
protected ReadWriteLock |
lock |
protected Queue<StreamsDatum> |
providerQueue |
protected AtomicBoolean |
running |
client, end, ids, idsCount, MAX_NUMBER_WAITING, names, start
Constructor and Description |
---|
TwitterEngagersProvider(TwitterEngagersProviderConfiguration config) |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
protected Queue<StreamsDatum> |
constructQueue() |
TwitterEngagersProviderConfiguration |
getConfig() |
String |
getId() |
Queue<StreamsDatum> |
getProviderQueue() |
boolean |
isRunning() |
static void |
main(String[] args)
To use from command line:
Supply (at least) the following required configuration in application.conf:
twitter.oauth.consumerKey
twitter.oauth.consumerSecret
twitter.oauth.accessToken
twitter.oauth.accessTokenSecret
twitter.info
Launch using:
mvn exec:java -Dexec.mainClass=org.apache.streams.twitter.provider.TwitterEngagersProvider -Dexec.args="application.conf retweeters.json.txt"
|
void |
prepare(Object configurationObject) |
StreamsResultSet |
readCurrent() |
StreamsResultSet |
readNew(BigInteger sequence) |
StreamsResultSet |
readRange(org.joda.time.DateTime start,
org.joda.time.DateTime end) |
void |
startStream() |
protected void |
submitRetweeterIdsTaskThread(Long postId) |
getTwitterClient, submitTimelineThreads
protected final ReadWriteLock lock
protected volatile Queue<StreamsDatum> providerQueue
protected final AtomicBoolean running
protected com.google.common.util.concurrent.ListeningExecutorService executor
public TwitterEngagersProvider(TwitterEngagersProviderConfiguration config)
public TwitterEngagersProviderConfiguration getConfig()
getConfig
in class TwitterTimelineProvider
public static void main(String[] args) throws Exception
args
- argsException
- Exceptionpublic Queue<StreamsDatum> getProviderQueue()
getProviderQueue
in class TwitterTimelineProvider
public String getId()
getId
in interface StreamsOperation
getId
in class TwitterTimelineProvider
public void prepare(Object configurationObject)
prepare
in interface StreamsOperation
prepare
in class TwitterTimelineProvider
public void startStream()
startStream
in interface StreamsProvider
startStream
in class TwitterTimelineProvider
protected void submitRetweeterIdsTaskThread(Long postId)
public StreamsResultSet readCurrent()
readCurrent
in interface StreamsProvider
readCurrent
in class TwitterTimelineProvider
protected Queue<StreamsDatum> constructQueue()
constructQueue
in class TwitterTimelineProvider
public StreamsResultSet readNew(BigInteger sequence)
readNew
in interface StreamsProvider
readNew
in class TwitterTimelineProvider
public StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange
in interface StreamsProvider
readRange
in class TwitterTimelineProvider
public void cleanUp()
cleanUp
in interface StreamsOperation
cleanUp
in class TwitterTimelineProvider
public boolean isRunning()
isRunning
in interface StreamsProvider
isRunning
in class TwitterTimelineProvider
Copyright © 2018 The Apache Software Foundation. All rights reserved.