Package org.apache.helix.healthcheck

Examples of org.apache.helix.healthcheck.ParticipantHealthReportCollectorImpl


    addControllerListener(_helixAccessor);

    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


          && toState.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

          && toState.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.equalsIgnoreCase("SLAVE") && toState.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

  protected MockHealthReportProvider _mockProvider;
 
   @BeforeMethod (groups = {"unitTest"})
  public void setup()
  {
     _providerImpl = new ParticipantHealthReportCollectorImpl(new MockManager(), "instance_123");
     _mockProvider = new MockHealthReportProvider();
  }
View Full Code Here

          && toState.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,"15");
       reporter.transmitHealthReports();


      /*
        for (int i = 0; i < 5; i++)
        {
View Full Code Here

          && toState.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,"15");
       reporter.transmitHealthReports();

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

      if (fromState.equalsIgnoreCase("SLAVE") && toState.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, "15");
        reporter.transmitHealthReports();

        // sleep long enough for first set of alerts to report and alert to get deleted
        // then change reported data
        try
        {
          Thread.sleep(10000);
        }
        catch (InterruptedException e)
        {
          System.err.println("Error sleeping");
        }
        provider.setStat(_dbName, statName, "1");
        reporter.transmitHealthReports();

        /*
         * for (int i = 0; i < 5; i++) { accessor.setProperty(PropertyType.HEALTHREPORT,
         * new ZNRecord("mockAlerts" + i), instance, "mockAlerts"); try {
         * Thread.sleep(1000); } catch (InterruptedException e) { // TODO Auto-generated
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.equalsIgnoreCase("SLAVE") && toState.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, "15");
        reporter.transmitHealthReports();

        /*
         * for (int i = 0; i < 5; i++)
         * {
         * accessor.setProperty(PropertyType.HEALTHREPORT,
 
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.