backtype.storm.topology.ReportedFailedException Java Examples

The following examples show how to use backtype.storm.topology.ReportedFailedException. 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: CassandraCqlMapState.java    From storm-cassandra-cql with Apache License 2.0 5 votes vote down vote up
protected void checkCassandraException(Exception e) {
    _mexceptions.incr();
    if (e instanceof AlreadyExistsException ||
            e instanceof AuthenticationException ||
            e instanceof DriverException ||
            e instanceof DriverInternalError ||
            e instanceof InvalidConfigurationInQueryException ||
            e instanceof InvalidQueryException ||
            e instanceof InvalidTypeException ||
            e instanceof QueryExecutionException ||
            e instanceof QueryValidationException ||
            e instanceof ReadTimeoutException ||
            e instanceof SyntaxError ||
            e instanceof TraceRetrievalException ||
            e instanceof TruncateException ||
            e instanceof UnauthorizedException ||
            e instanceof UnavailableException ||
            e instanceof ReadTimeoutException ||
            e instanceof WriteTimeoutException ||
            e instanceof ReadFailureException ||
            e instanceof WriteFailureException ||
            e instanceof FunctionExecutionException) {
        throw new ReportedFailedException(e);
    } else {
        throw new RuntimeException(e);
    }
}
 
Example #2
Source File: CoordinatedBolt.java    From jstorm with Apache License 2.0 5 votes vote down vote up
public void handleRegular(Tuple tuple) {
    basicCollector.setContext(tuple);
    try {
        delegate.execute(tuple, basicCollector);
        collector.ack(tuple);
    } catch (FailedException e) {
        if (e instanceof ReportedFailedException) {
            collector.reportError(e);
        }
        collector.fail(tuple);
    }
}
 
Example #3
Source File: CoordinatedBolt.java    From jstorm with Apache License 2.0 5 votes vote down vote up
public void handlePrepareCommit(Tuple tuple) {
    basicCollector.setContext(tuple);
    try {
        BatchId id = (BatchId) tuple.getValue(0);
        ((IPrepareCommit) delegate).prepareCommit(id, basicCollector);
        collector.ack(tuple);
    } catch (FailedException e) {
        if (e instanceof ReportedFailedException) {
            collector.reportError(e);
        }
        collector.fail(tuple);
    }
}
 
Example #4
Source File: TridentBoltExecutor.java    From jstorm with Apache License 2.0 5 votes vote down vote up
private void failBatch(TrackedBatch tracked, FailedException e) {
    if (e != null && e instanceof ReportedFailedException) {
        _collector.reportError(e);
    }
    tracked.failed = true;
    if (tracked.delayedAck != null) {
        _collector.fail(tracked.delayedAck);
        tracked.delayedAck = null;
    }
}
 
Example #5
Source File: ShellBolt.java    From jstorm with Apache License 2.0 5 votes vote down vote up
private void handleLog(ShellMsg shellMsg) {
    String msg = shellMsg.getMsg();
    msg = "ShellLog " + _process.getProcessInfoString() + " " + msg;
    ShellMsg.ShellLogLevel logLevel = shellMsg.getLogLevel();

    switch (logLevel) {
        case TRACE:
            LOG.trace(msg);
            break;
        case DEBUG:
            LOG.debug(msg);
            break;
        case INFO:
            LOG.info(msg);
            break;
        case WARN:
            LOG.warn(msg);
            break;
        case ERROR:
            LOG.error(msg);
            _collector.reportError(new ReportedFailedException(msg));
            break;
        default:
            LOG.info(msg);
            break;
    }
}