public class TwitterUserLookupReader extends TwitterProxyReader
DataEndpoint.State
Modifier and Type | Field and Description |
---|---|
static int |
MAX_BATCH_SIZE |
EOF
fieldLineage, recordLineage
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
TwitterUserLookupReader(String consumerKey,
String consumerSecret,
DataReader nestedDataReader,
String sourceIdFieldName) |
TwitterUserLookupReader(String consumerKey,
String consumerSecret,
String accessToken,
String accessTokenSecret,
DataReader nestedDataReader,
String sourceIdFieldName) |
TwitterUserLookupReader(TwitterProvider provider,
DataReader nestedDataReader,
String sourceIdFieldName) |
Modifier and Type | Method and Description |
---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException . |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
int |
getBatchSize() |
DataWriter |
getDiscardWriter()
Returns the discard sink for records where the lookup failed or
null if one was not assigned. |
boolean |
isLookupById() |
boolean |
isLookupByScreenName() |
boolean |
isReturnOrphans()
Indicates if records failing the lookup should be returned — instead of being deleted (default is
false ). |
protected void |
onUserFound(Long userId,
String screenName,
Record record)
Called for each user found.
|
protected void |
onUserNotFound(Long userId,
String screenName,
Record record)
Called for each user not found.
|
void |
open()
Makes this endpoint ready for reading or writing.
|
protected Record |
readImpl()
Overridden by subclasses to read the next record from this
DataReader . |
TwitterUserLookupReader |
setBatchSize(int batchSize) |
TwitterUserLookupReader |
setDiscardWriter(DataWriter writer)
Assign a discard sink for records where the lookup failed.
|
TwitterUserLookupReader |
setLookupByScreenName(boolean lookupByScreenName) |
TwitterUserLookupReader |
setReturnOrphans(boolean returnOrphans)
Indicates if records failing the lookup should be returned — instead of being deleted (default is
false ). |
getApiLimitPolicy, getConverter, getEntityExpansionPolicy, getProvider, getRateLimit, getRateLimit, isRateLimitExceeded, onRateLimitExceeded, reloadRateLimit, setApiLimitPolicy, setConverter, setEntityExpansionPolicy, setRateLimit, setRateLimit, setRateLimitExceeded
available, getNestedReader, interceptRecord, map, map, setNestedDataReader, setNestedDataReader
addLineage, getBufferSize, getNestedEndpoint, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, pop, push, read, setSaveLineage, skip
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toString
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public static final int MAX_BATCH_SIZE
public TwitterUserLookupReader(String consumerKey, String consumerSecret, DataReader nestedDataReader, String sourceIdFieldName)
public TwitterUserLookupReader(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret, DataReader nestedDataReader, String sourceIdFieldName)
public TwitterUserLookupReader(TwitterProvider provider, DataReader nestedDataReader, String sourceIdFieldName)
public boolean isLookupByScreenName()
public boolean isLookupById()
public TwitterUserLookupReader setLookupByScreenName(boolean lookupByScreenName)
public DataWriter getDiscardWriter()
null
if one was not assigned.public TwitterUserLookupReader setDiscardWriter(DataWriter writer)
writer
- the discard sinkpublic boolean isReturnOrphans()
false
).public TwitterUserLookupReader setReturnOrphans(boolean returnOrphans)
false
).public int getBatchSize()
public TwitterUserLookupReader setBatchSize(int batchSize)
public void open() throws DataException
DataEndpoint
open
in class TwitterProxyReader
DataException
public void close() throws DataException
DataEndpoint
close
in class ProxyReader
DataException
protected Record readImpl() throws Throwable
DataReader
DataReader
. The default
implementation of DataReader.read()
now insures that this method will not be called again after it returns
a null
.
If no record is available, null
will be returned.
readImpl
in class ProxyReader
Throwable
protected void onUserFound(Long userId, String screenName, Record record)
userId
- protected void onUserNotFound(Long userId, String screenName, Record record)
public DataException addExceptionProperties(DataException exception)
Endpoint
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in class TwitterProxyReader
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.