Java Code Examples for org.apache.nifi.reporting.Severity#ERROR

The following examples show how to use org.apache.nifi.reporting.Severity#ERROR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NodeClusterCoordinator.java    From localization_nifi with Apache License 2.0 6 votes vote down vote up
@Override
public void disconnectionRequestedByNode(final NodeIdentifier nodeId, final DisconnectionCode disconnectionCode, final String explanation) {
    logger.info("{} requested disconnection from cluster due to {}", nodeId, explanation == null ? disconnectionCode : explanation);
    updateNodeStatus(new NodeConnectionStatus(nodeId, disconnectionCode, explanation));

    final Severity severity;
    switch (disconnectionCode) {
        case STARTUP_FAILURE:
        case MISMATCHED_FLOWS:
        case UNKNOWN:
            severity = Severity.ERROR;
            break;
        case LACK_OF_HEARTBEAT:
            severity = Severity.WARNING;
            break;
        default:
            severity = Severity.INFO;
            break;
    }

    reportEvent(nodeId, severity, "Node disconnected from cluster due to " + explanation);
}
 
Example 2
Source File: NodeClusterCoordinator.java    From nifi with Apache License 2.0 6 votes vote down vote up
@Override
public void disconnectionRequestedByNode(final NodeIdentifier nodeId, final DisconnectionCode disconnectionCode, final String explanation) {
    logger.info("{} requested disconnection from cluster due to {}", nodeId, explanation == null ? disconnectionCode : explanation);
    updateNodeStatus(new NodeConnectionStatus(nodeId, disconnectionCode, explanation));

    final Severity severity;
    switch (disconnectionCode) {
        case STARTUP_FAILURE:
        case MISMATCHED_FLOWS:
        case UNKNOWN:
            severity = Severity.ERROR;
            break;
        case LACK_OF_HEARTBEAT:
            severity = Severity.WARNING;
            break;
        default:
            severity = Severity.INFO;
            break;
    }

    reportEvent(nodeId, severity, "Node disconnected from cluster due to " + explanation);
}