Ejemplo n.º 1
0
  public void init() throws Exception {
    initializeEmitter();
    initializeMonitors();
    initializeMergerConfig();
    initializeTaskToolbox();
    initializeJacksonInjections();
    initializeJacksonSubtypes();
    initializeCuratorFramework();
    initializeCuratorCoordinator();
    initializeTaskMonitor();
    initializeServer();

    final ScheduledExecutorFactory scheduledExecutorFactory =
        ScheduledExecutors.createFactory(lifecycle);
    final ScheduledExecutorService globalScheduledExec =
        scheduledExecutorFactory.create(1, "Global--%d");
    final MonitorScheduler monitorScheduler =
        new MonitorScheduler(
            configFactory.build(MonitorSchedulerConfig.class),
            globalScheduledExec,
            emitter,
            monitors);
    lifecycle.addManagedInstance(monitorScheduler);

    final Context root = new Context(server, "/", Context.SESSIONS);

    root.addServlet(new ServletHolder(new StatusServlet()), "/status");
    root.addServlet(new ServletHolder(new DefaultServlet()), "/mmx/*");
    root.addFilter(GuiceFilter.class, "/mmx/indexer/worker/v1/*", 0);
  }
Ejemplo n.º 2
0
  DruidCoordinator(
      DruidCoordinatorConfig config,
      ZkPathsConfig zkPaths,
      JacksonConfigManager configManager,
      DatabaseSegmentManager databaseSegmentManager,
      ServerInventoryView serverInventoryView,
      DatabaseRuleManager databaseRuleManager,
      CuratorFramework curator,
      ServiceEmitter emitter,
      ScheduledExecutorFactory scheduledExecutorFactory,
      IndexingServiceClient indexingServiceClient,
      LoadQueueTaskMaster taskMaster,
      ServiceAnnouncer serviceAnnouncer,
      DruidNode self,
      ConcurrentMap<String, LoadQueuePeon> loadQueuePeonMap) {
    this.config = config;
    this.zkPaths = zkPaths;
    this.configManager = configManager;

    this.databaseSegmentManager = databaseSegmentManager;
    this.serverInventoryView = serverInventoryView;
    this.databaseRuleManager = databaseRuleManager;
    this.curator = curator;
    this.emitter = emitter;
    this.indexingServiceClient = indexingServiceClient;
    this.taskMaster = taskMaster;
    this.serviceAnnouncer = serviceAnnouncer;
    this.self = self;

    this.exec = scheduledExecutorFactory.create(1, "Coordinator-Exec--%d");

    this.leaderLatch = new AtomicReference<>(null);
    this.dynamicConfigs = new AtomicReference<>(null);
    this.loadManagementPeons = loadQueuePeonMap;
  }