clean up firehose module and introduce parsers module

This commit is contained in:
fjy 2014-04-25 14:20:02 -07:00
parent 171d20d52d
commit a33c2f7880
3 changed files with 54 additions and 3 deletions

View File

@ -53,10 +53,8 @@ public class FirehoseModule implements DruidModule
new NamedType(TimedShutoffFirehoseFactory.class, "timed"), new NamedType(TimedShutoffFirehoseFactory.class, "timed"),
new NamedType(IrcFirehoseFactory.class, "irc"), new NamedType(IrcFirehoseFactory.class, "irc"),
new NamedType(LocalFirehoseFactory.class, "local"), new NamedType(LocalFirehoseFactory.class, "local"),
new NamedType(ProtoBufInputRowParser.class, "protobuf"),
new NamedType(EventReceiverFirehoseFactory.class, "receiver") new NamedType(EventReceiverFirehoseFactory.class, "receiver")
) )
); );
} }
} }

View File

@ -0,0 +1,51 @@
/*
* Druid - a distributed column store.
* Copyright (C) 2012, 2013 Metamarkets Group Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package io.druid.guice;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.google.inject.Binder;
import io.druid.data.input.ProtoBufInputRowParser;
import io.druid.initialization.DruidModule;
import java.util.Arrays;
import java.util.List;
/**
*/
public class ParsersModule implements DruidModule
{
@Override
public void configure(Binder binder)
{
}
@Override
public List<? extends Module> getJacksonModules()
{
return Arrays.<Module>asList(
new SimpleModule("ParsersModule")
.registerSubtypes(
new NamedType(ProtoBufInputRowParser.class, "protobuf")
)
);
}
}

View File

@ -47,6 +47,7 @@ import io.druid.guice.JacksonConfigManagerModule;
import io.druid.guice.JsonConfigProvider; import io.druid.guice.JsonConfigProvider;
import io.druid.guice.LifecycleModule; import io.druid.guice.LifecycleModule;
import io.druid.guice.LocalDataStorageDruidModule; import io.druid.guice.LocalDataStorageDruidModule;
import io.druid.guice.ParsersModule;
import io.druid.guice.QueryRunnerFactoryModule; import io.druid.guice.QueryRunnerFactoryModule;
import io.druid.guice.QueryableModule; import io.druid.guice.QueryableModule;
import io.druid.guice.ServerModule; import io.druid.guice.ServerModule;
@ -327,7 +328,8 @@ public class Initialization
new JacksonConfigManagerModule(), new JacksonConfigManagerModule(),
new IndexingServiceDiscoveryModule(), new IndexingServiceDiscoveryModule(),
new LocalDataStorageDruidModule(), new LocalDataStorageDruidModule(),
new FirehoseModule() new FirehoseModule(),
new ParsersModule()
); );
ModuleList actualModules = new ModuleList(baseInjector); ModuleList actualModules = new ModuleList(baseInjector);