Package com.linkedin.helix

Examples of com.linkedin.helix.PropertyKey$Builder


  @Override
  public void addConfigChangeListener(ScopedConfigChangeListener listener, ConfigScopeProperty scope)
  {
  Builder keyBuilder = new Builder(_clusterName);
 
  PropertyKey propertyKey = null;
  switch(scope)
  {
  case CLUSTER:
    propertyKey = keyBuilder.clusterConfigs();
    break;
View Full Code Here


      }
      else
      {
       
        PropertyKey propertyKey =
            keyBuilder.stateTransitionStatus(instanceName,
                                             sessionId,
                                             statusUpdateSubPath,
                                             statusUpdateKey);

        ZNRecord statusUpdateRecord = createMessageLogRecord(message);

        // For now write participant StatusUpdates to log4j.
        // we are using restlet as another data channel to report to controller.
       
        _logger.info("StatusUpdate path:" + propertyKey.getPath() + ", updates:"
              + statusUpdateRecord);
        accessor.updateProperty(propertyKey, new StatusUpdate(statusUpdateRecord));
       
      }
      _recordedMessages.put(message.getMsgId(), message.getMsgId());
    }

    if (instanceName.equalsIgnoreCase("Controller"))
    {
      accessor.updateProperty(keyBuilder.controllerTaskStatus(statusUpdateSubPath,
                                                              statusUpdateKey),
                              new StatusUpdate(record));
    }
    else
    {
     
      PropertyKey propertyKey =
          keyBuilder.stateTransitionStatus(instanceName,
                                           sessionId,
                                           statusUpdateSubPath,
                                           statusUpdateKey);
      // For now write participant StatusUpdates to log4j.
      // we are using restlet as another data channel to report to controller.
      _logger.info("StatusUpdate path:" + propertyKey.getPath() + ", updates:" + record);
      accessor.updateProperty(propertyKey, new StatusUpdate(record));
    }

    // If the error level is ERROR, also write the record to "ERROR" ZNode
    if (Level.HELIX_ERROR == level)
View Full Code Here

    Assert.assertEquals(instances.size(), 1, "Expecting one live instance");
    Assert.assertEquals(instances.get(0).getInstanceName(), manager.getInstanceName());
    // Update data in the live instance node, should trigger another live instance change
    // event
    HelixDataAccessor helixDataAccessor = manager.getHelixDataAccessor();
    PropertyKey propertyKey =
        helixDataAccessor.keyBuilder().liveInstance(manager.getInstanceName());
    LiveInstance instance = helixDataAccessor.getProperty(propertyKey);

    Map<String, String> map = new TreeMap<String, String>();
    map.put("k1", "v1");
View Full Code Here

      }
      else
      {

        PropertyKey propertyKey =
            keyBuilder.stateTransitionStatus(instanceName,
                                             sessionId,
                                             statusUpdateSubPath,
                                             statusUpdateKey);

        ZNRecord statusUpdateRecord = createMessageLogRecord(message);

        // For now write participant StatusUpdates to log4j.
        // we are using restlet as another data channel to report to controller.

        _logger.info("StatusUpdate path:" + propertyKey.getPath() + ", updates:"
              + statusUpdateRecord);
        accessor.updateProperty(propertyKey, new StatusUpdate(statusUpdateRecord));

      }
      _recordedMessages.put(message.getMsgId(), message.getMsgId());
    }

    if (instanceName.equalsIgnoreCase("Controller"))
    {
      accessor.updateProperty(keyBuilder.controllerTaskStatus(statusUpdateSubPath,
                                                              statusUpdateKey),
                              new StatusUpdate(record));
    }
    else
    {

      PropertyKey propertyKey =
          keyBuilder.stateTransitionStatus(instanceName,
                                           sessionId,
                                           statusUpdateSubPath,
                                           statusUpdateKey);
      // For now write participant StatusUpdates to log4j.
      // we are using restlet as another data channel to report to controller.
      _logger.info("StatusUpdate path:" + propertyKey.getPath() + ", updates:" + record);
      accessor.updateProperty(propertyKey, new StatusUpdate(record));
    }

    // If the error level is ERROR, also write the record to "ERROR" ZNode
    if (Level.HELIX_ERROR == level)
View Full Code Here

TOP

Related Classes of com.linkedin.helix.PropertyKey$Builder

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.