Package com.linkedin.helix.PropertyKey

Examples of com.linkedin.helix.PropertyKey.Builder.alertHistory()


      String val = alertStatusMap.get(AlertValueAndStatus.VALUE_NAME);
      boolean fired = Boolean.parseBoolean(alertStatusMap.get(AlertValueAndStatus.FIRED_NAME));
      Assert.assertEquals(Double.parseDouble(val), (double)i * 5 + 0.1);
      Assert.assertTrue(fired);
    }
    ZNRecord alertHistory = accessor.getProperty(keyBuilder.alertHistory()).getRecord();
   
    String deltakey = (String) (alertHistory.getMapFields().keySet().toArray()[0]);
    Map<String, String> delta = alertHistory.getMapField(deltakey);
    Assert.assertEquals(delta.size() , 3);
    for(int i = 2; i < 5; i++)
View Full Code Here


      String val = alertStatusMap.get(AlertValueAndStatus.VALUE_NAME);
      boolean fired = Boolean.parseBoolean(alertStatusMap.get(AlertValueAndStatus.FIRED_NAME));
      Assert.assertEquals(Double.parseDouble(val), (double)i * 5 + 0.1);
      Assert.assertTrue(fired);
    }
    alertHistory = accessor.getProperty(keyBuilder.alertHistory()).getRecord();
   
    deltakey = (String) (alertHistory.getMapFields().keySet().toArray()[1]);
    delta = alertHistory.getMapField(deltakey);
    Assert.assertTrue(delta.size() == 2);
    for(int i = 3; i < 5; i++)
View Full Code Here

      String date = dateFormat.format(new Date());

      HelixDataAccessor accessor = manager.getHelixDataAccessor();
      Builder keyBuilder = accessor.keyBuilder();

      HelixProperty property = accessor.getProperty(keyBuilder.alertHistory());
      ZNRecord alertFiredHistory;
      if(property == null)
      {
        alertFiredHistory = new ZNRecord(PropertyType.ALERT_HISTORY.toString());
      }
View Full Code Here

        String firstKey = (String)(alertFiredHistory.getMapFields().keySet().toArray()[0]);
        alertFiredHistory.getMapFields().remove(firstKey);
      }
      alertFiredHistory.setMapField(date, delta);
//      manager.getDataAccessor().setProperty(PropertyType.ALERT_HISTORY, alertFiredHistory);
      accessor.setProperty(keyBuilder.alertHistory(), new AlertHistory(alertFiredHistory));
      _alertBeanCollection.setAlertHistory(alertFiredHistory);
    }
  }

  public ClusterAlertMBeanCollection getClusterAlertMBeanCollection()
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.