public class TwitterStreamer<K,V> extends StreamAdapter<String,K,V>
IgniteDataStreamer
instance.
This streamer uses https://dev.twitter.com/streaming API and supports Public API, User Streams, Site Streams and Firehose.
This Streamer features:
Modifier and Type | Field and Description |
---|---|
protected IgniteLogger |
log
Logger.
|
ignite
Constructor and Description |
---|
TwitterStreamer(OAuthSettings oAuthSettings) |
Modifier and Type | Method and Description |
---|---|
protected com.twitter.hbc.core.Client |
buildClient(BlockingQueue<String> tweetQueue,
com.twitter.hbc.core.HttpHosts hosts,
com.twitter.hbc.core.endpoint.StreamingEndpoint endpoint) |
protected com.twitter.hbc.core.Client |
getClient(BlockingQueue<String> tweetQueue) |
void |
setApiParams(Map<String,String> apiParams)
Sets API Params.
|
void |
setBufferCapacity(Integer bufferCapacity)
Sets Buffer capacity.
|
void |
setEndpointUrl(String endpointUrl)
Sets Endpoint URL.
|
void |
setThreadsCount(int threadsCount)
Sets Threads count.
|
void |
start()
Starts streamer.
|
void |
stop()
Stops streamer.
|
protected void |
validateConfig()
Validates config at start.
|
addMessage, getIgnite, getMultipleTupleExtractor, getSingleTupleExtractor, getStreamer, getTupleExtractor, setIgnite, setMultipleTupleExtractor, setSingleTupleExtractor, setStreamer, setTupleExtractor
protected IgniteLogger log
public TwitterStreamer(OAuthSettings oAuthSettings)
oAuthSettings
- OAuth Settingspublic void start()
public void stop()
protected void validateConfig()
protected com.twitter.hbc.core.Client getClient(BlockingQueue<String> tweetQueue)
tweetQueue
- Tweet queue.protected com.twitter.hbc.core.Client buildClient(BlockingQueue<String> tweetQueue, com.twitter.hbc.core.HttpHosts hosts, com.twitter.hbc.core.endpoint.StreamingEndpoint endpoint)
tweetQueue
- tweet Queue.hosts
- Hostes.endpoint
- Endpoint.public void setApiParams(Map<String,String> apiParams)
apiParams
- API Params.public void setEndpointUrl(String endpointUrl)
endpointUrl
- Endpoint URL.public void setBufferCapacity(Integer bufferCapacity)
bufferCapacity
- Buffer capacity.public void setThreadsCount(int threadsCount)
threadsCount
- Threads count.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019