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