NIFI-11591: Added additional logging for DynamicallyModifyClasspath system test

This closes #7312

Signed-off-by: David Handermann <exceptionfactory@apache.org>
(cherry picked from commit 4b7e20740e4777f6e64e69db7b0c597cc0fb7e5e)
This commit is contained in:
Mark Payne 2023-05-30 10:33:44 -04:00 committed by exceptionfactory
parent 649494f7c1
commit bd26936f24
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
2 changed files with 10 additions and 0 deletions

View File

@ -287,6 +287,8 @@ public abstract class AbstractFlowFileQueue implements FlowFileQueue {
dropRequest.setDroppedSize(originalSize);
dropRequest.setState(DropFlowFileState.COMPLETE);
dropRequestMap.put(requestIdentifier, dropRequest);
logger.info("No FlowFiles to drop from {} for request {} because the queue is empty", this, requestIdentifier);
return dropRequest;
}

View File

@ -98,11 +98,15 @@ public class DynamicallyModifyClasspath extends AbstractProcessor {
final long sleepMillis = context.getProperty(SLEEP_DURATION).evaluateAttributeExpressions(flowFile).asTimePeriod(TimeUnit.MILLISECONDS);
if (sleepMillis > 0) {
getLogger().info("Sleeping for {} millis", sleepMillis);
try {
Thread.sleep(sleepMillis);
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
}
getLogger().info("Finished sleeping");
}
final String classToLoad = context.getProperty(CLASS_TO_LOAD).getValue();
@ -118,8 +122,12 @@ public class DynamicallyModifyClasspath extends AbstractProcessor {
}
session.transfer(flowFile, REL_SUCCESS);
getLogger().info("Transferred {} to success", flowFile);
} catch (final Exception e) {
getLogger().error("Failed to update {}", flowFile, e);
session.transfer(flowFile, REL_FAILURE);
getLogger().info("Transferred {} to failure", flowFile);
}
}
}