public class TwitterStreamDataset extends AbstractTwitterStreamDataset<twitter4j.Status>
AbstractTwitterStreamDataset
which pushes
the Status
s into the stream.Constructor and Description |
---|
TwitterStreamDataset(TwitterAPIToken token)
Construct the dataset from the given API token.
|
TwitterStreamDataset(TwitterAPIToken token,
BlockingDroppingQueue<twitter4j.Status> buffer)
Construct the dataset from the given API token and buffer.
|
Modifier and Type | Method and Description |
---|---|
protected void |
registerStatus(twitter4j.Status status,
String json)
Handle the given incoming status and optionally
BlockingDroppingBufferedStream.register(Object)
it with the stream. |
getRandomInstance, numInstances
close, getBuffer, hasNext, next, register
filter, forEach, forEach, forEach, iterator, map, map, parallelForEach, parallelForEach, remove, transform
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
filter, forEach, forEach, forEach, map, map, parallelForEach, parallelForEach, transform
forEachRemaining, hasNext, next, remove
forEach, iterator, spliterator
public TwitterStreamDataset(TwitterAPIToken token)
ArrayBlockingDroppingQueue
with a single item capacity.token
- the Twitter api authentication credentialspublic TwitterStreamDataset(TwitterAPIToken token, BlockingDroppingQueue<twitter4j.Status> buffer)
token
- the Twitter api authentication credentialsbuffer
- the buffer to hold Status
s before they are consumed.protected void registerStatus(twitter4j.Status status, String json) throws InterruptedException
AbstractTwitterStreamDataset
BlockingDroppingBufferedStream.register(Object)
it with the stream.registerStatus
in class AbstractTwitterStreamDataset<twitter4j.Status>
status
- the parsed Status
json
- the json stringInterruptedException