public class ContextRoundRobinTwitterSearchAPIDataset extends AbstractTwitterSearchDataset<Context>
TwitterSearchDataset to support multiple queries. All
attempts are made to access the Twitter API in a fair way. Each query is
handled in turn and backoffs, new results etc. are stored per query.
A round robin approach is used to fill the underlying
BlockingDroppingQueue. Each query is given a chance to fill the
queue, then all appropriate wait times are respected and the next query is
given a chance.
Further this round robin dataset passes QueryHoldingStatus instances
due to the variable queue.
config, logger, query, twitter| Constructor and Description |
|---|
ContextRoundRobinTwitterSearchAPIDataset(List<twitter4j.Query> queries,
TwitterAPIToken token,
BlockingDroppingQueue<Context> buffer) |
| Modifier and Type | Method and Description |
|---|---|
twitter4j.Query |
getQuery()
Get the current query
|
void |
registerStatus(twitter4j.Query query,
twitter4j.Status status,
String json)
Handle the given incoming status and optionally
BlockingDroppingBufferedStream.register(Object)
it with the stream. |
getRandomInstance, makeConfiguration, numInstancesclose, getBuffer, hasNext, next, registerfilter, forEach, forEach, forEach, iterator, map, map, parallelForEach, parallelForEach, remove, transformclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfilter, forEach, forEach, forEach, map, map, parallelForEach, parallelForEach, transformforEachRemaining, hasNext, next, removeforEach, iterator, spliteratorpublic ContextRoundRobinTwitterSearchAPIDataset(List<twitter4j.Query> queries, TwitterAPIToken token, BlockingDroppingQueue<Context> buffer)
queries - token - buffer - public twitter4j.Query getQuery()
AbstractTwitterSearchDatasetgetQuery in class AbstractTwitterSearchDataset<Context>public void registerStatus(twitter4j.Query query, twitter4j.Status status, String json) throws InterruptedException
AbstractTwitterSearchDatasetBlockingDroppingBufferedStream.register(Object)
it with the stream.registerStatus in class AbstractTwitterSearchDataset<Context>query - the querystatus - the parsed Statusjson - the raw json stringInterruptedException