mirror of
https://github.com/apache/druid.git
synced 2025-02-17 07:25:02 +00:00
some changes to how handlers are registered
This commit is contained in:
parent
6b247f1599
commit
51cd361fbe
@ -30,7 +30,7 @@ import com.metamx.common.lifecycle.LifecycleStart;
|
||||
import com.metamx.common.lifecycle.LifecycleStop;
|
||||
import com.metamx.common.logger.Logger;
|
||||
import com.metamx.druid.http.RequestLogger;
|
||||
import com.metamx.druid.index.v1.serde.ComplexMetricRegistererer;
|
||||
import com.metamx.druid.index.v1.serde.Registererer;
|
||||
import com.metamx.druid.initialization.Initialization;
|
||||
import com.metamx.druid.initialization.ServerConfig;
|
||||
import com.metamx.druid.initialization.ZkClientConfig;
|
||||
@ -174,7 +174,7 @@ public abstract class BaseNode<T extends BaseNode>
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public T registerComplexMetric(ComplexMetricRegistererer registererer)
|
||||
public T registerHandler(Registererer registererer)
|
||||
{
|
||||
registererer.register();
|
||||
return (T) this;
|
||||
|
@ -36,12 +36,10 @@ import org.joda.time.Interval;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -20,14 +20,14 @@
|
||||
package com.metamx.druid.index.v1.serde;
|
||||
|
||||
/**
|
||||
* This is a "factory" interface for registering complex metrics in the system. It exists because I'm unaware of
|
||||
* This is a "factory" interface for registering handlers in the system. It exists because I'm unaware of
|
||||
* another way to register the complex serdes in the MR jobs that run on Hadoop. As such, instances of this interface
|
||||
* must be instantiatable via a no argument default constructor (the MR jobs on Hadoop use reflection to instantiate
|
||||
* instances).
|
||||
*
|
||||
* The name is not a typo, I felt that it needed an extra "er" to make the pronunciation that much more difficult.
|
||||
*/
|
||||
public interface ComplexMetricRegistererer
|
||||
public interface Registererer
|
||||
{
|
||||
public void register();
|
||||
}
|
@ -41,6 +41,7 @@ import com.metamx.druid.http.GuiceServletConfig;
|
||||
import com.metamx.druid.http.RedirectFilter;
|
||||
import com.metamx.druid.http.RedirectInfo;
|
||||
import com.metamx.druid.http.StatusServlet;
|
||||
import com.metamx.druid.index.v1.serde.Registererer;
|
||||
import com.metamx.druid.initialization.Initialization;
|
||||
import com.metamx.druid.initialization.ServerConfig;
|
||||
import com.metamx.druid.initialization.ServiceDiscoveryConfig;
|
||||
@ -182,6 +183,12 @@ public class IndexerCoordinatorNode
|
||||
this.taskRunnerFactory = taskRunnerFactory;
|
||||
}
|
||||
|
||||
public IndexerCoordinatorNode registerHandler(Registererer registererer)
|
||||
{
|
||||
registererer.register();
|
||||
return this;
|
||||
}
|
||||
|
||||
public void init() throws Exception
|
||||
{
|
||||
scheduledExecutorFactory = ScheduledExecutors.createFactory(lifecycle);
|
||||
|
@ -29,6 +29,7 @@ import com.metamx.common.lifecycle.LifecycleStart;
|
||||
import com.metamx.common.lifecycle.LifecycleStop;
|
||||
import com.metamx.common.logger.Logger;
|
||||
import com.metamx.druid.http.StatusServlet;
|
||||
import com.metamx.druid.index.v1.serde.Registererer;
|
||||
import com.metamx.druid.initialization.CuratorConfig;
|
||||
import com.metamx.druid.initialization.Initialization;
|
||||
import com.metamx.druid.initialization.ServerConfig;
|
||||
@ -147,6 +148,12 @@ public class WorkerNode
|
||||
return this;
|
||||
}
|
||||
|
||||
public WorkerNode registerHandler(Registererer registererer)
|
||||
{
|
||||
registererer.register();
|
||||
return this;
|
||||
}
|
||||
|
||||
public void init() throws Exception
|
||||
{
|
||||
initializeEmitter();
|
||||
|
Loading…
x
Reference in New Issue
Block a user