clean up event receiver firehose factory

This commit is contained in:
fjy 2014-05-15 14:23:13 -07:00
parent c57a18d6b6
commit 6098cff37a
1 changed files with 4 additions and 6 deletions

View File

@ -67,10 +67,8 @@ public class EventReceiverFirehoseFactory implements FirehoseFactory<MapInputRow
public EventReceiverFirehoseFactory(
@JsonProperty("serviceName") String serviceName,
@JsonProperty("bufferSize") Integer bufferSize,
@JsonProperty("parser") Map<String, Object> parser,
@JacksonInject ChatHandlerProvider chatHandlerProvider,
// for backwards compat
@JacksonInject ObjectMapper jsonMapper
@JsonProperty("parser") InputRowParser parser,
@JacksonInject ChatHandlerProvider chatHandlerProvider
)
{
Preconditions.checkNotNull(parser, "parser");
@ -78,8 +76,8 @@ public class EventReceiverFirehoseFactory implements FirehoseFactory<MapInputRow
this.serviceName = serviceName;
this.bufferSize = bufferSize == null || bufferSize <= 0 ? DEFAULT_BUFFER_SIZE : bufferSize;
parser.put("type", "map");
this.parser = jsonMapper.convertValue(parser, MapInputRowParser.class);
// this is really for backwards compatibility
this.parser = new MapInputRowParser(parser.getParseSpec(), null, null, null, null);
this.chatHandlerProvider = Optional.fromNullable(chatHandlerProvider);
}