Package org.apache.helix.healthcheck

Examples of org.apache.helix.healthcheck.ParticipantHealthReportCollectorImpl


    HelixManager manager = new HelixConnectionAdaptor(this);
    _stateMachineEngine = new HelixStateMachineEngine(manager);
    _preConnectCallbacks = new ArrayList<PreConnectCallback>();
    _timerTasks = new ArrayList<HelixTimerTask>();
    _participantHealthInfoCollector =
        new ParticipantHealthReportCollectorImpl(manager, participantId.stringify());

    _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

  }
View Full Code Here


      if (fromState.toString().equalsIgnoreCase("SLAVE")
          && toState.toString().equalsIgnoreCase("MASTER")) {
        // add a stat and report to ZK
        // perhaps should keep reporter per instance...
        ParticipantHealthReportCollectorImpl reporter =
            new ParticipantHealthReportCollectorImpl(manager, instance);
        MockEspressoHealthReportProvider provider = new MockEspressoHealthReportProvider();
        reporter.addHealthReportProvider(provider);
        String statName = "latency";
        // using constant as timestamp so that when each partition does this transition,
        // they do not advance timestamp, and no stats double-counted
        String timestamp = "12345";
        provider.setStat(_dbName, statName, "15", timestamp);

        // sleep for random time and see about errors.
        /*
         * Random r = new Random();
         * int x = r.nextInt(30000);
         * try {
         * Thread.sleep(x);
         * } catch (InterruptedException e) {
         * // TODO Auto-generated catch block
         * e.printStackTrace();
         * }
         */

        reporter.transmitHealthReports();

        /*
         * for (int i = 0; i < 5; i++)
         * {
         * accessor.setProperty(PropertyType.HEALTHREPORT,
 
View Full Code Here

     */
    switch (instanceType) {
    case PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

      break;
    case CONTROLLER:
      _stateMachineEngine = null;
      _participantHealthInfoCollector = null;
      _controllerTimerTasks.add(new HealthStatsAggregationTask(new HealthStatsAggregator(this)));
      _controllerTimerTasks.add(new StatusDumpTask(_zkclient, this));

      break;
    case CONTROLLER_PARTICIPANT:
      _stateMachineEngine = new HelixStateMachineEngine(this);
      _participantHealthInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);

      _timerTasks.add(new ParticipantHealthReportTask(_participantHealthInfoCollector));

      _controllerTimerTasks.add(new HealthStatsAggregationTask(new HealthStatsAggregator(this)));
      _controllerTimerTasks.add(new StatusDumpTask(_zkclient, this));
View Full Code Here

      if (fromState.toString().equalsIgnoreCase("SLAVE")
          && toState.toString().equalsIgnoreCase("MASTER")) {

        // add a stat and report to ZK
        // perhaps should keep reporter per instance...
        ParticipantHealthReportCollectorImpl reporter =
            new ParticipantHealthReportCollectorImpl(manager, instance);
        MockEspressoHealthReportProvider provider = new MockEspressoHealthReportProvider();
        reporter.addHealthReportProvider(provider);
        String statName = "latency";
        provider.setStat(_dbName, statName, "" + (0.1 + _alertValue));
        reporter.transmitHealthReports();

        /*
         * for (int i = 0; i < 5; i++)
         * {
         * accessor.setProperty(PropertyType.HEALTHREPORT,
 
View Full Code Here

      if (fromState.toString().equalsIgnoreCase("SLAVE")
          && toState.toString().equalsIgnoreCase("MASTER")) {

        // add a stat and report to ZK
        // perhaps should keep reporter per instance...
        ParticipantHealthReportCollectorImpl reporter =
            new ParticipantHealthReportCollectorImpl(manager, instance);
        MockEspressoHealthReportProvider provider = new MockEspressoHealthReportProvider();
        reporter.addHealthReportProvider(provider);
        String statName = "latency";
        provider.setStat(_dbName, statName, "" + (0.1 + _alertValue));
        reporter.transmitHealthReports();

        /*
         * for (int i = 0; i < 5; i++)
         * {
         * accessor.setProperty(PropertyType.HEALTHREPORT,
 
View Full Code Here

    _stateMachEngine.registerStateModelFactory(DefaultSchedulerMessageHandlerFactory.SCHEDULER_TASK_QUEUE, stStateModelFactory);

    if (_participantHealthCheckInfoCollector == null)
    {
      _participantHealthCheckInfoCollector =
          new ParticipantHealthReportCollectorImpl(this, _instanceName);
      _participantHealthCheckInfoCollector.start();
    }
    // start the participant health check timer, also create zk path for health
    // check info
    String healthCheckInfoPath =
View Full Code Here

TOP

Related Classes of org.apache.helix.healthcheck.ParticipantHealthReportCollectorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.