当前位置: 首页>>代码示例>>Java>>正文


Java ReportedFailedException类代码示例

本文整理汇总了Java中backtype.storm.topology.ReportedFailedException的典型用法代码示例。如果您正苦于以下问题:Java ReportedFailedException类的具体用法?Java ReportedFailedException怎么用?Java ReportedFailedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ReportedFailedException类属于backtype.storm.topology包,在下文中一共展示了ReportedFailedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateState

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
@Override
public void updateState(MapState<Map<String, Object>> state, List<TridentTuple> tuples, TridentCollector collector) {
    List<Map<String, Object>> events = Lists.newArrayList();
    List<List<Object>> keys = Lists.newArrayList();
    for (TridentTuple t : tuples) {
        if(t!=null) {
            List<Object> l = Lists.newArrayList();
            l.add(_generalKey + t.getValueByField(_key));
            keys.add(l);
            events.add((Map<String, Object>) t.getValueByField(_value));

            //System.out.println("SAVED TO MEMCACHED KEY: " + _generalKey +t.getValueByField(_key) +
            //      " VALUE: " + t.getValueByField(_value));
        }
    }
    
    try {
        state.multiPut(keys, events);
    } catch (ReportedFailedException e) {
        Logger.getLogger(MemcachedUpdater.class.getName()).log(Level.WARNING, null, e);
    }
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:23,代码来源:MemcachedUpdater.java

示例2: updateState

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
@Override
public void updateState(MapState<Map<String, Object>> state, List<TridentTuple> tuples, TridentCollector collector) {
    List<Map<String, Object>> events = new ArrayList<>();
    List<List<Object>> keys = new ArrayList<>();
    for (TridentTuple t : tuples) {
        if (t != null) {
            List<Object> l = new ArrayList<>();
            l.add(_generalKey + t.getValueByField(_key));
            keys.add(l);
            if (t.getValueByField(_value) != null)
                events.add((Map<String, Object>) t.getValueByField(_value));

            if (_debug) {
                System.out.println("SAVED TO RIAK KEY: " + _generalKey + t.getValueByField(_key)
                        + " VALUE: " + t.getValueByField(_value));
            }
        }
    }

    try {
        if (!events.isEmpty())
            state.multiPut(keys, events);
    } catch (ReportedFailedException e) {
        Logger.getLogger(RiakUpdater.class.getName()).log(Level.WARNING, null, e);
    }
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:27,代码来源:RiakUpdater.java

示例3: checkCassandraException

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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 QueryTimeoutException ||
            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) {
        throw new ReportedFailedException(e);
    } else {
        throw new RuntimeException(e);
    }
}
 
开发者ID:hpcc-systems,项目名称:storm-cassandra-cql,代码行数:26,代码来源:CassandraCqlMapState.java

示例4: checkMemcachedException

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
private void checkMemcachedException(Exception e) {
    // _mexceptions.incr();
    if(e instanceof RequestException ||
       e instanceof ChannelException ||
       e instanceof ServiceException ||
       e instanceof ApplicationException ||
       e instanceof ApiException ||
       e instanceof CodecException ||
       e instanceof ChannelBufferUsageException) {
        throw new ReportedFailedException(e);
    } else {
        throw new RuntimeException(e);
    }        
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:15,代码来源:MemcachedState.java

示例5: failBatch

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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;
    }
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:11,代码来源:TridentBoltExecutor.java

示例6: handleLog

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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;
    }
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:28,代码来源:ShellBolt.java

示例7: handleRegular

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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);
	}

}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:14,代码来源:CoordinatedBolt.java

示例8: handlePrepareCommit

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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);
	}

}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:15,代码来源:CoordinatedBolt.java

示例9: handleRegular

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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);
    }

}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:14,代码来源:CoordinatedBolt.java

示例10: handlePrepareCommit

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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);
    }

}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:15,代码来源:CoordinatedBolt.java

示例11: handleLog

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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;
    }
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:28,代码来源:ShellBolt.java

示例12: execute

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
@Override
public void execute(Tuple tuple,
                    BasicOutputCollector outputCollector) {
  String customerId = tuple.getStringByField("customer");
  List<Sale> sales = (List<Sale>) tuple.getValueByField("sales");

  try {
    dbClient.save(customerId, sales);
  } catch (Timeout e) {
    throw new ReportedFailedException(e);
  }
}
 
开发者ID:Storm-Applied,项目名称:C6-Flash-sale-recommender,代码行数:13,代码来源:SaveRecommendedSales.java

示例13: handleRegular

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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);
    }
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:13,代码来源:CoordinatedBolt.java

示例14: handlePrepareCommit

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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);
    }
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:14,代码来源:CoordinatedBolt.java

示例15: failBatch

import backtype.storm.topology.ReportedFailedException; //导入依赖的package包/类
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;
    }
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:11,代码来源:TridentBoltExecutor.java


注:本文中的backtype.storm.topology.ReportedFailedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。