Skip to content

Commit

Permalink
Mark StreamRouterEngine#matchWithTimeOut() as nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jochen Schalanda committed Jul 17, 2015
1 parent 066de1b commit b338a2d
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -188,9 +188,10 @@ public List<Stream> match(Message message) {
return ImmutableList.copyOf(result); return ImmutableList.copyOf(result);
} }


@Nullable
private Stream matchWithTimeOut(final Message message, final Rule rule) { private Stream matchWithTimeOut(final Message message, final Rule rule) {
Stream matchedStream = null; Stream matchedStream = null;
try (final Timer.Context timer = streamMetrics.getExecutionTimer(rule.getStreamRule().getId()).time()) { try (final Timer.Context ignored = streamMetrics.getExecutionTimer(rule.getStreamRule().getId()).time()) {
matchedStream = timeLimiter.callWithTimeout(new Callable<Stream>() { matchedStream = timeLimiter.callWithTimeout(new Callable<Stream>() {
@Override @Override
public Stream call() throws Exception { public Stream call() throws Exception {
Expand Down Expand Up @@ -256,7 +257,7 @@ public Stream.MatchingType getMatchingType() {
@Nullable @Nullable
public Stream match(Message message) { public Stream match(Message message) {
// TODO Add missing message recordings! // TODO Add missing message recordings!
try (final Timer.Context timer = streamMetrics.getExecutionTimer(rule.getId()).time()) { try (final Timer.Context ignored = streamMetrics.getExecutionTimer(rule.getId()).time()) {
if (matcher.match(message, rule)) { if (matcher.match(message, rule)) {
return stream; return stream;
} else { } else {
Expand Down

0 comments on commit b338a2d

Please sign in to comment.