mirror of https://github.com/apache/druid.git
Fix the twitter firehose
* It was missing some json annotations
This commit is contained in:
parent
dfecfb71be
commit
92ea82da6d
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue