Skip to content

Commit

Permalink
do not silently ingnore rows
Browse files Browse the repository at this point in the history
  • Loading branch information
pjain1 committed Mar 16, 2016
1 parent ec949d7 commit 948b19a
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package io.druid.segment.realtime.firehose;

import com.google.common.base.Predicate;
import com.metamx.common.logger.Logger;
import io.druid.data.input.Firehose;
import io.druid.data.input.InputRow;

Expand All @@ -31,6 +32,10 @@
*/
public class PredicateFirehose implements Firehose
{
private static final Logger log = new Logger(PredicateFirehose.class);
private static final int IGNORE_THRESHOLD = 5000;
private long ignored = 0;

private final Firehose firehose;
private final Predicate<InputRow> predicate;

Expand All @@ -55,6 +60,11 @@ public boolean hasMore()
savedInputRow = row;
return true;
}
// Do not silently discard the rows
if (ignored % IGNORE_THRESHOLD == 0) {
log.warn("[%,d] InputRow(s) ignored as they do not satisfy the predicate", ignored);
}
ignored++;
}

return false;
Expand Down

0 comments on commit 948b19a

Please sign in to comment.