NIFI-1627: Do not call context.yield for funnels and local ports; use batch size of 100 instead of 10 for local ports and funnels

Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
Mark Payne 2016-03-15 11:45:29 -04:00 committed by joewitt
parent 54670486bc
commit a4a7d53769
2 changed files with 3 additions and 11 deletions

View File

@ -349,22 +349,16 @@ public class StandardFunnel implements Funnel {
readLock.lock();
try {
Set<Relationship> available = context.getAvailableRelationships();
int transferred = 0;
while (!available.isEmpty()) {
final List<FlowFile> flowFiles = session.get(10);
final List<FlowFile> flowFiles = session.get(100);
if (flowFiles.isEmpty()) {
break;
}
transferred += flowFiles.size();
session.transfer(flowFiles, Relationship.ANONYMOUS);
session.commit();
available = context.getAvailableRelationships();
}
if (transferred == 0) {
context.yield();
}
} finally {
readLock.unlock();
}

View File

@ -73,10 +73,8 @@ public class LocalPort extends AbstractPort {
public void onTrigger(final ProcessContext context, final ProcessSession session) {
readLock.lock();
try {
final List<FlowFile> flowFiles = session.get(10);
if (flowFiles.isEmpty()) {
context.yield();
} else {
final List<FlowFile> flowFiles = session.get(100);
if (!flowFiles.isEmpty()) {
session.transfer(flowFiles, Relationship.ANONYMOUS);
}
} finally {