Examples of keyBuilder()


Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

    }

//    DataAccessor accessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
//    boolean retVal = accessor.setProperty(PropertyType.PERSISTENTSTATS, record);
    Builder keyBuilder = accessor.keyBuilder();
    boolean retVal = accessor.setProperty(keyBuilder.persistantStat(), new PersistentStats(record));
    if (retVal == false)
    {
      logger.error("attempt to persist derived stats failed");
    }
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

  try {
      if (changeContext.getType().equals(NotificationContext.Type.INIT)
        || changeContext.getType().equals(NotificationContext.Type.CALLBACK)) {
    // DataAccessor dataAccessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();

    while (accessor.getProperty(keyBuilder.controllerLeader()) == null) {
        boolean success = tryUpdateController(manager);
        if (success) {
      updateHistory(manager);
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

  }

  public static String parseResourceName(String actualStatName, HelixManager manager)
  {
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    Builder kb = accessor.keyBuilder();
    List<IdealState> idealStates = accessor.getChildValues(kb.idealStates());
    for (IdealState idealState : idealStates)
    {
      String resourceName = idealState.getResourceName();
      if(actualStatName.contains("=" + resourceName + ".") || actualStatName.contains("=" + resourceName + ";"))
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

    }

    private boolean tryUpdateController(HelixManager manager) {
  // DataAccessor dataAccessor = manager.getDataAccessor();
  HelixDataAccessor accessor = manager.getHelixDataAccessor();
  Builder keyBuilder = accessor.keyBuilder();

  LiveInstance leader = new LiveInstance(manager.getInstanceName());
  try {
      leader.setLiveInstance(ManagementFactory.getRuntimeMXBean().getName());
      // TODO: this session id is not the leader's session id in
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

  }

  public static String parseInstanceName(String actualStatName, HelixManager manager)
  {
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    Builder kb = accessor.keyBuilder();
    List<LiveInstance> liveInstances = accessor.getChildValues(kb.liveInstances());
    for (LiveInstance instance : liveInstances)
    {
      String instanceName = instance.getInstanceName();
      if(actualStatName.startsWith(instanceName))
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

      delta.putAll(_alertActionTaken);
      SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-hh:mm:ss:SSS");
      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)
      {
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

  return false;
    }

    private void updateHistory(HelixManager manager) {
  HelixDataAccessor accessor = manager.getHelixDataAccessor();
  Builder keyBuilder = accessor.keyBuilder();

  LeaderHistory history = accessor.getProperty(keyBuilder.controllerLeaderHistory());
  if (history == null) {
      history = new LeaderHistory(PropertyType.HISTORY.toString());
  }
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

      if (context.getType() == Type.CALLBACK)
      {
        HelixManager manager = context.getManager();
        // DataAccessor accessor = manager.getDataAccessor();
        HelixDataAccessor accessor = manager.getHelixDataAccessor();
        Builder keyBuilder = accessor.keyBuilder();

        String instance = manager.getInstanceName();
        String sessionId = manager.getSessionId();

        // get resource name from partition key: "PARTICIPANT_LEADER_XXX_0"
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

//    DataAccessor accessor = manager.getDataAccessor();
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    StateModelDefinition stateModelDef = new StateModelDefinition(
        generator.generateConfigForMasterSlave());
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);

    context = new NotificationContext(manager);
    CurrentState currentStateDelta = new CurrentState("TestDB");
    currentStateDelta.setState("TestDB_0", "OFFLINE");
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.keyBuilder()

    StateModelConfigGenerator generator = new StateModelConfigGenerator();
    StateModelDefinition stateModelDef = new StateModelDefinition(
        generator.generateConfigForMasterSlave());
//    accessor.setProperty(PropertyType.STATEMODELDEFS, stateModelDef, "MasterSlave");
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);


    context = new NotificationContext(manager);
   
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.