Fix the twitter firehose

* It was missing some json annotations
This commit is contained in:
Charles Allen 2014-12-11 16:18:12 -08:00
parent dfecfb71be
commit 92ea82da6d
1 changed files with 15 additions and 4 deletions

View File

@ -210,22 +210,22 @@ public class TwitterSpritzerFirehoseFactory implements FirehoseFactory<InputRowP
}; };
private long rowCount = 0L; private long rowCount = 0L;
private boolean waitIfmax = (maxEventCount < 0L); private boolean waitIfmax = (getMaxEventCount() < 0L);
private final Map<String, Object> theMap = new HashMap<String, Object>(2); private final Map<String, Object> theMap = new HashMap<String, Object>(2);
// DIY json parsing // private final ObjectMapper omapper = new ObjectMapper(); // DIY json parsing // private final ObjectMapper omapper = new ObjectMapper();
private boolean maxTimeReached() private boolean maxTimeReached()
{ {
if (maxRunMinutes <= 0) { if (getMaxRunMinutes() <= 0) {
return false; return false;
} else { } else {
return (System.currentTimeMillis() - startMsec) / 60000L >= maxRunMinutes; return (System.currentTimeMillis() - startMsec) / 60000L >= getMaxRunMinutes();
} }
} }
private boolean maxCountReached() private boolean maxCountReached()
{ {
return maxEventCount >= 0 && rowCount >= maxEventCount; return getMaxEventCount() >= 0 && rowCount >= getMaxEventCount();
} }
@Override @Override
@ -311,4 +311,15 @@ public class TwitterSpritzerFirehoseFactory implements FirehoseFactory<InputRowP
}; };
} }
@JsonProperty
public int getMaxEventCount()
{
return maxEventCount;
}
@JsonProperty
public int getMaxRunMinutes()
{
return maxRunMinutes;
}
} }