mirror of https://github.com/apache/nifi.git
NIFI-1176: Use a smaller internal blocking queue size of only 5000 messages; do not create a new queue every time the processor is scheduled to run
Signed-off-by: Aldrin Piri <aldrin@apache.org>
This commit is contained in:
parent
93be753301
commit
180ea1ba22
|
@ -156,7 +156,7 @@ public class GetTwitter extends AbstractProcessor {
|
||||||
private final BlockingQueue<Event> eventQueue = new LinkedBlockingQueue<>(1000);
|
private final BlockingQueue<Event> eventQueue = new LinkedBlockingQueue<>(1000);
|
||||||
|
|
||||||
private volatile Client client;
|
private volatile Client client;
|
||||||
private volatile BlockingQueue<String> messageQueue = new LinkedBlockingQueue<>(10000);
|
private volatile BlockingQueue<String> messageQueue = new LinkedBlockingQueue<>(5000);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init(final ProcessorInitializationContext context) {
|
protected void init(final ProcessorInitializationContext context) {
|
||||||
|
@ -222,8 +222,6 @@ public class GetTwitter extends AbstractProcessor {
|
||||||
|
|
||||||
@OnScheduled
|
@OnScheduled
|
||||||
public void onScheduled(final ProcessContext context) throws MalformedURLException {
|
public void onScheduled(final ProcessContext context) throws MalformedURLException {
|
||||||
messageQueue = new LinkedBlockingQueue<>(100000);
|
|
||||||
|
|
||||||
final String endpointName = context.getProperty(ENDPOINT).getValue();
|
final String endpointName = context.getProperty(ENDPOINT).getValue();
|
||||||
final Authentication oauth = new OAuth1(context.getProperty(CONSUMER_KEY).getValue(),
|
final Authentication oauth = new OAuth1(context.getProperty(CONSUMER_KEY).getValue(),
|
||||||
context.getProperty(CONSUMER_SECRET).getValue(),
|
context.getProperty(CONSUMER_SECRET).getValue(),
|
||||||
|
|
Loading…
Reference in New Issue