Package com.linkedin.helix

Examples of com.linkedin.helix.HelixDataAccessor


    Map<String, String> statFields = getStatFields("0", "0");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    // check persistent stats
    HelixDataAccessor accessor = _helixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    String persistentStat = "accumulate()(dbFoo.partition10.latency)";
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "0.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "0.0"));
View Full Code Here


      String command = jsonParameters.getCommand();

      if (command.equalsIgnoreCase(ClusterSetup.addIdealState))
      {
        ZNRecord newIdealState = jsonParameters.getExtraParameter(JsonParameters.NEW_IDEAL_STATE);
        HelixDataAccessor accessor =
            ClusterRepresentationUtil.getClusterDataAccessor(zkClient, clusterName);

        accessor.setProperty(accessor.keyBuilder().idealStates(resourceName),
                             new IdealState(newIdealState));

      }
      else if (command.equalsIgnoreCase(ClusterSetup.rebalance))
      {
View Full Code Here

    statFields = getStatFields("1", "10");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    // check persistent stats
    HelixDataAccessor accessor = _helixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    String persistentStat = "accumulate()(dbFoo.partition10.latency)";
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "2.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "10.0"));
View Full Code Here

    Map<String, String> statFields = getStatFields("0", "0");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    // check persistent stats
    HelixDataAccessor accessor = _helixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    String persistentStat = "accumulate()(dbFoo.partition10.latency)";
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "0.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "0.0"));
View Full Code Here

    Map<String, String> statFields = getStatFields("1", "10");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    // check persistent stats
    HelixDataAccessor accessor = _helixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    String persistentStat = "accumulate()(instance10.reportingage)";
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "1.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "10.0"));
View Full Code Here

    statFields = getStatFields("5", "10");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    // check persistent stats
    HelixDataAccessor accessor = _helixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    String persistentStat = "accumulate()(dbFoo.partition10.latency)";
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "1.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "10.0"));
View Full Code Here

    Map<String, String> statFields = getStatFields("0", "0");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    // check persistent stats
    HelixDataAccessor accessor = _helixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    String persistentStat = "window(3)(dbFoo.partition10.latency)";
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "0.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "0.0"));

    // add 2nd stat
    statFields = getStatFields("10", "1");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "0.0,10.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "0.0,1.0"));

    // add 3rd stat
    statFields = getStatFields("20", "2");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();
   
    rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "0.0,10.0,20.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "0.0,1.0,2.0"));
View Full Code Here

    String incomingStatName = "dbFoo.partition10.latency";
    Map<String, String> statFields = getStatFields("30", "3");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

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

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "10.0,20.0,30.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "1.0,2.0,3.0"));
  }
View Full Code Here

    String incomingStatName = "dbFoo.partition10.latency";
    Map<String, String> statFields = getStatFields("10", "1");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

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

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStat, "0.0,10.0,20.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStat, "0.0,1.0,2.0"));
  }
View Full Code Here

    Map<String, String> statFields = getStatFields("0", "0");
    _statsHolder.applyStat(incomingStatName, statFields);
    _statsHolder.persistStats();

    // check persistent stats
    HelixDataAccessor accessor = _helixManager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    ZNRecord rec = accessor.getProperty(keyBuilder.persistantStat()).getRecord();

    System.out.println("rec: " + rec.toString());
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStatOne, "0.0"));
    AssertJUnit.assertTrue(statRecordHasTimestamp(rec, persistentStatOne, "0.0"));
    AssertJUnit.assertTrue(statRecordHasValue(rec, persistentStatTwo, "0.0"));
View Full Code Here

TOP

Related Classes of com.linkedin.helix.HelixDataAccessor

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.